pypa / pypa/setuptools

[BUG] Cannot specify build directory in bdist_wheel

Open
#4,732 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two setup.py commands in the issue and inspect the bdist_wheel handling of the -b and --skip-build options. Trace how the build directory is passed to the install step; done means a wheel built with --skip-build uses the specified fresh directory and no longer warns that build/lib is missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.