Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] Cannot specify build directory in bdist_wheel #4732

Open
rossburton opened this issue Nov 5, 2024 · 3 comments
Open

[BUG] Cannot specify build directory in bdist_wheel #4732

rossburton opened this issue Nov 5, 2024 · 3 comments
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@rossburton
Copy link

setuptools version

72.1.0

Python version

3.9

OS

Linux

Additional environment information

No response

Description

To ensure clean builds, we want to build python modules with a fresh build directory:

$ python3 setup.py build -b /a/fresh/directory

However, we can't then use this build tree with bdist_wheel as there's no option to specify where the build tree is when using --skip-build:

$ python3 ./setup.py bdist_wheel -b /a/fresh/directory --skip-build
running bdist_wheel
installing to /a/fresh/directory
running install
running install_lib
warning: install_lib: 'build/lib' does not exist -- no Python modules to install

Yes I know invoking setup.py is deprecated but there's no way to pass -j to build...

Expected behavior

bdist_wheel has an option to tell is where the build tree is.

How to Reproduce

$ python3 setup.py build -b /a/fresh/directory
$ python3 setup.py bdist_wheel -b /a/fresh/directory

Output

warning: install_lib: 'build/lib' does not exist -- no Python modules to install
@rossburton rossburton added bug Needs Triage Issues that need to be evaluated for severity and status. labels Nov 5, 2024
@abravalheri
Copy link
Contributor

You can try setting up the relative fields in setup.cfg for the [build] and [bdist_wheel] sections.

Please note that using setup.py as a CLI tool is deprecated (since the implementation of PEP 517, setup.py is only seen as a configuration file, not as a CLI), so it no longer receives the same level of support of other functionalities (or feature requests).

@rossburton
Copy link
Author

My goal is to do this for all packages we build, I just discovered DIST_EXTRA_CONFIG and it appears that setting it to a file like this does the right thing:

[build]
build_base = /my/build/path

This appears to be the only way to set the build directory when using a pep517 build tool?

@abravalheri
Copy link
Contributor

Yes, in the current state of implementation of setuptools that should work.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

2 participants