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

Add pyproject.toml with build_system to specify setuptools requirement #79

Open
tboddyspargo opened this issue Oct 19, 2023 · 3 comments

Comments

@tboddyspargo
Copy link

tboddyspargo commented Oct 19, 2023

Hi, @wbond! I believe I've understood that you're working on a new release, so I wanted to make this small request.

I'm hopeful that adding a pyproject.toml file with a build system specified (or some other method of specifying build dependencies) will help in some cases to make sure that setuptools is available in the build environment.

[build-system]
requires = ["setuptools"]

It may be rare for setuptools to not be present, but my team has recently run into this error:

Collecting oscrypto@ git+https://github.com/wbond/oscrypto.git@d5f3437ed24257895ae1edd9e503cfb352e635a8
  Cloning https://github.com/wbond/oscrypto.git (to revision d5f3437ed24257895ae1edd9e503cfb352e635a8) to /tmp/pip-install-y2l8htzj/oscrypto_e9d6d3d3015f45daba710e66e4847541
  Running command git clone --filter=blob:none --quiet https://github.com/wbond/oscrypto.git /tmp/pip-install-y2l8htzj/oscrypto_e9d6d3d3015f45daba710e66e4847541
  Running command git rev-parse -q --verify 'sha^d5f3437ed24257895ae1edd9e503cfb352e635a8'
  Running command git fetch -q https://github.com/wbond/oscrypto.git d5f3437ed24257895ae1edd9e503cfb352e635a8
  Running command git checkout -q d5f3437ed24257895ae1edd9e503cfb352e635a8
  Resolved https://github.com/wbond/oscrypto.git to commit d5f3437ed24257895ae1edd9e503cfb352e635a8
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
      [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.
hint: See above for details.

Exited with code exit status 1

While we are attempting work-arounds (obviously, pip install -U setuptools), this is much tricker to resolve than anticipated because we are caching the virtual environment in CI and it may be corrupting (?) the setuptools installation, so this error still comes up despite explicitly installing setuptools.

Anyway, my hope is that the presence of some explicit build requirements might allow the isolated environment to install its own version of setuptools with more success.

Thanks for your consideration!

@wbond
Copy link
Owner

wbond commented Oct 19, 2023

What tool are you planning to consume pyproject.toml with?

@tboddyspargo
Copy link
Author

tboddyspargo commented Oct 19, 2023

What tool are you planning to consume pyproject.toml with?

My hope is that when performing pip install oscrypto @ git+https://github.com/wbond/oscrypto.git@d5f3437ed24257895ae1edd9e503cfb352e635a8, pip will be able to use pyproject.toml (or some expression of build requirements) to install setuptools and any other build dependencies in its isolated build environment without needing to rely on the global/virtual environment for the presence of setuptools. setuptools is not guaranteed to be present in all environments (example, example), so explicitly declaring the build requirement in some pip-supported manner may help in some situations (like in my team's case, hopefully).

@wbond
Copy link
Owner

wbond commented Oct 19, 2023

I didn’t realize pip now supports pyproject.toml

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

No branches or pull requests

2 participants