If binary wheel is not available to the platform, it would be install from sdist. One issue found that setup.py will remove src and copy from ../src if it is present.
i.e. installation from sdist would install files out of the sdist archive.
e.g. pip install ....path/to/sxtwl-2.0.7.tar.gz
setup.py would be run in directory /tmp/pip-req-build-g4txwujj on linux. If /tmp/src is present, files under src in sdist would be erased and replaced (by whatever under /tmp/src/)
as a test:
# on linux
mkdir /tmp/src
# (create virtual environment and install setup tools)
# the following would fail:
pip install ....path/to/sxtwl-2.0.7.tar.gz
Similar issue found if it is installed by uv; setup.py is run in directory: ~/.cache/uv/sdists-v6/path/random1/random2/src, that means ../src is present.
Any idea to change as below:
- remove
/src from python/.gitignore
- create symbolic link
python/src to ../src
- remove below from
setup.py
if os.path.isdir("../src"):
if os.path.isdir("src"):
shutil.rmtree("src")
shutil.copytree("../src", "src")
If binary wheel is not available to the platform, it would be install from
sdist. One issue found thatsetup.pywill removesrcand copy from../srcif it is present.i.e. installation from
sdistwould install files out of the sdist archive.e.g.
pip install ....path/to/sxtwl-2.0.7.tar.gzsetup.pywould be run in directory/tmp/pip-req-build-g4txwujjon linux. If/tmp/srcis present, files undersrcinsdistwould be erased and replaced (by whatever under /tmp/src/)as a test:
Similar issue found if it is installed by
uv;setup.pyis run in directory:~/.cache/uv/sdists-v6/path/random1/random2/src, that means../srcis present.Any idea to change as below:
/srcfrompython/.gitignorepython/srcto../srcsetup.py