-
Notifications
You must be signed in to change notification settings - Fork 108
[MNT] - Update build procedure #282
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
Conversation
ryanhammonds
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having issues with python -m build. I had to first pip install build, but then got an error:
Traceback (most recent call last):
File "/Users/ryanhammonds/projects/fooof/.env/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/Users/ryanhammonds/projects/fooof/.env/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ryanhammonds/projects/fooof/.env/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/fm/pn7dn_wn7mz0nw0h4v1_5p840000gn/T/build-env-olz3x4aj/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/fm/pn7dn_wn7mz0nw0h4v1_5p840000gn/T/build-env-olz3x4aj/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/private/var/folders/fm/pn7dn_wn7mz0nw0h4v1_5p840000gn/T/build-env-olz3x4aj/lib/python3.11/site-packages/setuptools/build_meta.py", line 488, in run_setup
self).run_setup(setup_script=setup_script)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/fm/pn7dn_wn7mz0nw0h4v1_5p840000gn/T/build-env-olz3x4aj/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
exec(code, locals())
File "", line 15, in
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
I'm trying to figure out what went wrong since requirements.txt should be in the path I'm running from.
|
@ryanhammonds - I originally had this error too! I think it's because the Are you trying to run Also, yeh, |
|
Thanks! That was it. I was accidentally running the build from system python and not env. Once I ran from an env with this branch everything worked. |
Continuing the updates for things that are changing in the Python ecosystem - this updates away from calling
setup.pydirectly in the build process, as this is now suggested against.New versions of

setuptoolsprint this out when running our current build command (python setup.py sdist bdist_wheel):Link: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html
I didn't do the deep dive - but there is a useful table that indicates the new approach, using
https://github.com/pypa/build
Related to which, this PR:
buildto create the distributionrequirements.txtto the MANIFEST.inbuildneeds it, as it builds the distribution in a venv)Comparing the output distribution files, as far as I can tell they are the same from build as calling
setup.py.Notably, as far as I understand, since we are using
setup.py(and notpyproject.toml), I thinkbuildin this case usessetuptoolsand thesetup.pyfile in the same way, so nothing really changes under the hood. This PR therefore just moves into the current best practice, and perhaps makes us a bit more ready if we do decide to update topyproject.tomlat some point (which I think is becoming the new standard).In terms of review - @ryanhammonds, when you get a chance could you double check that you can run the new
buildcommand and that it seems to work on your system?