Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #448 switch to pyproject.toml #456

Merged
merged 18 commits into from
Mar 19, 2024
Merged

Fix #448 switch to pyproject.toml #456

merged 18 commits into from
Mar 19, 2024

Conversation

robnagler
Copy link
Member

@robnagler robnagler requested a review from e-carlin March 18, 2024 23:52
Copy link
Member

@e-carlin e-carlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried creating/installing a new package and got the error below

[py3;@e5f2fce0e61a radiasoft]$ mkdir foo
[py3;@e5f2fce0e61a radiasoft]$ cd foo
[py3;@e5f2fce0e61a foo]$ git init
Initialized empty Git repository in /home/vagrant/src/radiasoft/foo/.git/
[py3;@e5f2fce0e61a foo]$ pykern projex init-rs-tree 'egc description'
pykern projex init-rs-tree 'egc description'
[py3;@e5f2fce0e61a foo]$ pip install -e .
pip install -e .
Obtaining file:///home/vagrant/src/radiasoft/foo
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
      Use '--' to separate paths from revisions, like this:
      'git <command> [<revision>...] -- [<file>...]'
      Traceback (most recent call last):
        File "/home/vagrant/src/radiasoft/pykern/pykern/pksetup.py", line 414, in _check_output
          res = subprocess.check_output(*args, **kwargs)
        File "/home/vagrant/.pyenv/versions/3.9.15/lib/python3.9/subprocess.py", line 424, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/home/vagrant/.pyenv/versions/3.9.15/lib/python3.9/subprocess.py", line 528, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['git', 'rev-parse', '--abbrev-ref', 'HEAD']' returned non-zero exit status 128.

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/home/vagrant/src/radiasoft/foo/setup.py", line 9, in <module>
          pykern.pksetup.setup(
        File "/home/vagrant/src/radiasoft/pykern/pykern/pksetup.py", line 390, in setup
          base = _state(base, kwargs)
        File "/home/vagrant/src/radiasoft/pykern/pykern/pksetup.py", line 653, in _state
          state["version"], s = _version(base)
        File "/home/vagrant/src/radiasoft/pykern/pykern/pksetup.py", line 703, in _version
          v2, sha = _version_from_git(base)
        File "/home/vagrant/src/radiasoft/pykern/pykern/pksetup.py", line 750, in _version_from_git
          branch = _check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).rstrip()
        File "/home/vagrant/src/radiasoft/pykern/pykern/pksetup.py", line 420, in _check_output
          sys.stderr.write(e.output)
      TypeError: write() argument must be str, not bytes
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip

@e-carlin
Copy link
Member

Disregard my previous message. I needed to have a commit for the subprocess to work.

Copy link
Member

@e-carlin e-carlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two nits

pykern/pkunit.py Show resolved Hide resolved
pykern/pkcollections.py Outdated Show resolved Hide resolved
@robnagler robnagler merged commit ae58285 into master Mar 19, 2024
2 checks passed
@robnagler robnagler deleted the 448-pyproject-toml branch March 19, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for pyproject.toml or setup.py
2 participants