Skip to content

Do not install data_files with build-time absolute paths from wheels - #1091

Open
rpcope1 wants to merge 1 commit into
ibmdb:masterfrom
rpcope1:fix/setup-data-files-abs-path
Open

rpcope1 wants to merge 1 commit into
ibmdb:masterfrom
rpcope1:fix/setup-data-files-abs-path

Conversation

@rpcope1

@rpcope1 rpcope1 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

data_files places README.md, CHANGES.md and LICENSE in get_python_lib(), which is evaluated at build time. When a wheel is built in an isolated environment, the files end up in the wheel under the build environment's absolute path, and pip install puts them under site-packages/tmp/....

This change skips data_files when building a wheel (bdist_wheel). Everything else is unchanged:

Closes #1090

Verification (Linux x86_64, Python 3.13), wheels built with pip wheel . and python -m build:

Before:

     9164  ibm_db-3.3.0.dist-info/licenses/LICENSE
    23963  <build-env path>/lib/python3.13/site-packages/CHANGES.md
     9164  <build-env path>/lib/python3.13/site-packages/LICENSE
    35386  <build-env path>/lib/python3.13/site-packages/README.md

After:

     9164  ibm_db-3.3.0.dist-info/licenses/LICENSE

data_files places README.md, CHANGES.md and LICENSE in
get_python_lib(), which is evaluated when the package is built. When a
wheel is built in an isolated environment, that is the temporary build
environment's site-packages, so the wheel stores the files under its
absolute path (for example tmp/build-env-XXXXXXXX/lib/python3.12/
site-packages/README.md) and installs them under site-packages/tmp/.

Skip data_files when building a wheel. The wheel still carries LICENSE
in its .dist-info, and setup.py install is unchanged.

Signed-off-by: Robert Cope <robert@copesystems.com>
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

Successfully merging this pull request may close these issues.

Wheels install README.md, CHANGES.md and LICENSE under site-packages/tmp/build-env-*/...

2 participants