You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build module fails for sdist or wheel. This is an existing project and this build step used to work properly.
> python3 -m build --sdist
* Creating venv isolated environment...
* Installing packages in isolated environment... (setuptools >= 40.8.0, wheel)
* Getting build dependencies for sdist...
Traceback (most recent call last):
File "/root/.local/lib/python3.6/site-packages/pep517/in_process/_in_process.py", line 351, in <module>
main()
File "/root/.local/lib/python3.6/site-packages/pep517/in_process/_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/root/.local/lib/python3.6/site-packages/pep517/in_process/_in_process.py", line 285, in get_requires_for_build_sdist
return hook(config_settings)
File "/tmp/build-env-zul88ngt/lib64/python3.6/site-packages/setuptools/build_meta.py", line 167, in get_requires_for_build_sdist
return self._get_build_requires(config_settings, requirements=[])
File "/tmp/build-env-zul88ngt/lib64/python3.6/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires
self.run_setup()
File "/tmp/build-env-zul88ngt/lib64/python3.6/site-packages/setuptools/build_meta.py", line 268, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/build-env-zul88ngt/lib64/python3.6/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 31, in <module>
import scidbbridge
File "/foo/__init__.py", line 24, in <module>
import boto3
ModuleNotFoundError: No module named 'boto3'
ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist
You can't import boto3 inside the isolated environment unless you install it inside the isolated environment (in pyproject.toml). Though do you really need to? Usually, to make the SDist/wheel, you should not need the imports (which are only install requirements). Perhaps you are trying to import your own package inside setup.py? This is an antipattern; setuptools and most other backends provide ways to single-source the version without loading your package during the SDist/wheel build, which I'd guess is what you might be trying to do? Oh, yes, you linked the source, that's exactly why. I'd either use setuptool's setup.cfg version = attr: scridbbridge.__version__ option for version (and hope it can read the AST), or use a backend like hatchling that can read the version via regex.
I was having a similar issue as we're moving from setup.py over to build for our project and....sure enough I was importing our library in setup.py. Problem solved!
The
build
module fails forsdist
orwheel
. This is an existing project and this build step used to work properly.boto3
in listed insetup.py
:This is the package source and here is the package on PyPI.
I tired the build on both Python
3.10.8
with build0.10.0
and Python3.6.8
with build0.9.0
. Theboto3
package is installed on the host system.The text was updated successfully, but these errors were encountered: