Closed AWhetter closed 5 months ago
If I remember correctly, an sdist generally does not include data files, as it is meant as a "source distribution". I think you need bdist for this, or a wheel.
Data files aren't generated at build time, and are therefore considered a source file. It's difficult to find a single place as a source for this but data files are included by source distributions by setuptools (https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html#controlling-files-in-the-distribution) and flit (https://flit.pypa.io/en/latest/rationale.html?highlight=data%20files#why-use-flit "Data files within a package directory are automatically included. Missing data files has been a common packaging mistake with other tools.").
In addition, the pip documentation describes installing from source distributions as a valid workflow: https://packaging.python.org/en/latest/tutorials/installing-packages/#source-distributions-vs-wheels
Maybe an older version of setuptools was used in the release process than what I'm testing with.
Ah, then this is possible. At best, it was distributed by pip from February 2023 (the date of the last release) but more likely a number of months if not years before that since it happens from one of my personal machines and I can't remember the last time I updated pip
If you make an sdist using that same setup.py, can you confirm that the generated file contains the files you expect?
In the example at the end of the issue description I was using setuptools v58.1.0 and that worked. If I'm using the latest and greatest everything then it also works:
λ python --version
Python 3.11.6
λ python -m venv .venv
λ .venv/bin/pip install --upgrade pip
...
Successfully installed pip-23.3.2
λ .venv/bin/pip install build
...
Successfully installed build-1.0.3 packaging-23.2 pyproject_hooks-1.0.0
λ .venv/bin/python -m build
...
copying Qt-stubs/Qt.pyi -> Qt.py-1.3.8/Qt-stubs
...
λ tar tvf dist/Qt.py-1.3.8.tar.gz
...
-rw-r--r-- ashley/ashley 512 2024-01-21 21:34 Qt.py-1.3.8/Qt-stubs/Qt.pyi
...
So the setup.py appears to be correct.
I've pushed an unchanged 1.3.9 using the latest version of pip and Python 3.11.4 now, hopefully that settles it, let me know.
I've used 1.3.10 and it works great. Thank you!
The sdist (the tarball uploaded to pypi) is missing the Qt-stubs directory. Therefore installing from the sdist fails with the following:
I'm unsure how this happened. The README mentions that the sdist is built by running the setup.py, and the setup.py correctly includes the necessary files:
Maybe an older version of setuptools was used in the release process than what I'm testing with. Running the setup.py directly is deprecated (https://packaging.python.org/en/latest/discussions/setup-py-deprecated/). Perhaps the release instructions need to be updated to mention running
python -m build
?