Skip to content

Python wheel pollutes global namespace with LICENSE.txt, README.md, THIRD_PARTY_NOTICES.md #2999

@andersk

Description

@andersk

HiGHS/CMakeLists.txt

Lines 576 to 581 in 7df0786

if (PYTHON_BUILD_SETUP OR CMAKE_INSTALL_DOCDIR STREQUAL "" OR NOT BUILD_CXX)
install(FILES
README.md
LICENSE.txt
THIRD_PARTY_NOTICES.md
DESTINATION .)

$ curl -s 'https://files.pythonhosted.org/packages/2d/38/3b37047686105955e2d54ec753c3b9e9d135bdd8e5ee1df310a87be25472/highspy-1.14.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl' | bsdtar -tf -
LICENSE.txt
README.md
THIRD_PARTY_NOTICES.md
highspy/
highspy/__init__.py
highspy/__init__.pyi
highspy/_core.cpython-314-x86_64-linux-gnu.so
highspy/highs.py
highspy/_core/
highspy/_core/__init__.pyi
highspy/_core/cb.pyi
highspy/_core/simplex_constants.pyi
highspy-1.14.0.dist-info/
highspy-1.14.0.dist-info/METADATA
highspy-1.14.0.dist-info/WHEEL
highspy-1.14.0.dist-info/RECORD
highspy-1.14.0.dist-info/licenses/
highspy-1.14.0.dist-info/licenses/AUTHORS
highspy-1.14.0.dist-info/licenses/LICENSE.txt
$ pip install highspy
$ ls "$VIRTUAL_ENV/lib/python3.14/site-packages/"
highspy
highspy-1.14.0.dist-info
LICENSE.txt
numpy
numpy-2.4.4.dist-info
numpy.libs
pip
pip-25.2.dist-info
pip-25.2.virtualenv
__pycache__
README.md
THIRD_PARTY_NOTICES.md
_virtualenv.pth
_virtualenv.py

The HiGHS LICENSE.txt, README.md, and THIRD_PARTY_NOTICES.md files do not belong here in the top level of the Python environment, outside of anything named highspy.

This causes conflicts in Nixpkgs with other packages that incorrectly pollute the Python environment in the same way:

$ nix build --expr 'with import (fetchTarball {url = "https://github.com/NixOS/nixpkgs/archive/15f4ee454b1dce334612fa6843b3e05cf546efab.tar.gz"; sha256 = "17pr9kf46019gf9nkg7jsa0h81adwbkdjwlk0i57nycnhad3vph1";}) {system = "x86_64-linux";}; python3.withPackages (ps: [ps.autoflake ps.highspy])'

error: Cannot build '/nix/store/z4jdnj6spk8hnnc8aq3iw1j1d17924kg-python3-3.13.12-env.drv'.
       Reason: builder failed with exit code 25.
       Output paths:
         /nix/store/yzmcff81gxz1l076x9h2zfi24hsiljlc-python3-3.13.12-env
       Last 6 log lines:
       > structuredAttrs is enabled
       > pkgs.buildEnv error: two given paths contain a conflicting subpath:
       >   `/nix/store/rq9bq6bknp4yf4bi7in3dyj3ihm2i5j4-python3.13-highspy-1.14.0/lib/python3.13/site-packages/README.md' and
       >   `/nix/store/gl0x8cyirm35i6qswzvvr1h0rx4lsyqh-python3.13-autoflake-2.3.2/lib/python3.13/site-packages/README.md'
       > hint: this may be caused by two different versions of the same package in buildEnv's `paths` parameter
       > hint: `pkgs.nix-diff` can be used to compare derivations
       For full logs, run:
         nix log /nix/store/z4jdnj6spk8hnnc8aq3iw1j1d17924kg-python3-3.13.12-env.drv

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions