Skip to content

Please provide a source distribution with tests #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mgorny opened this issue May 21, 2025 · 3 comments · Fixed by #232
Closed

Please provide a source distribution with tests #231

mgorny opened this issue May 21, 2025 · 3 comments · Fixed by #232

Comments

@mgorny
Copy link

mgorny commented May 21, 2025

Since aiohttp started unconditionally requiring isal, I need to package it for Gentoo Linux. However, I don't seem to be able to find an usable archive for it:

  • the source distribution on PyPI is missing tests
  • the GitHub archive is not supported by versioningit

Could you please include test files in the source distribution, so that it could be used for packaging?

Additionally/alternatively, could you consider switching to setuptools-scm that is far more common and unlike versioningit, works with GitHub archives.

@rhpvorderman
Copy link
Collaborator

setuptools-scm gives a lot of problems with including the entire ISA-L source in the binary distribution. This is a waste, therefore it is not used.

The tests are also not necessary for distributing packages to users. So they are not included. (To save bandwith, cpu time, CO2 etc.)

I see how that is problematic for distro maintainers though. They did manage to package it in debian: https://tracker.debian.org/pkg/python-isal. Maybe you could do what they did?

@mgorny
Copy link
Author

mgorny commented May 26, 2025

setuptools-scm gives a lot of problems with including the entire ISA-L source in the binary distribution. This is a waste, therefore it is not used.

The tests are also not necessary for distributing packages to users. So they are not included. (To save bandwith, cpu time, CO2 etc.)

The vast majority of users use wheels anyway, making source distribution size a minor problem. On top of that, forcing people who need tests to download a dynamically created archive from GitHub has a far more significant environment footprint.

I see how that is problematic for distro maintainers though. They did manage to package it in debian: https://tracker.debian.org/pkg/python-isal. Maybe you could do what they did?

Debian literally patches out versioningit entirely. Practically speaking, the only way to package anything using versioningit without usable source distribution is to remove versioningit and manually repeat what it does — not only inlining the version number, but also manually creating src/isal/_version.py. Which implies that every distribution out there needs to carry and maintain similar patches.

At this point, perhaps the best solution would be to remove VCS versioning entirely and use static versioning instead. This would surely save bandwidth, CPU time and CO₂ on not having to download, install and run versioningit every time the package is being built.

@rhpvorderman
Copy link
Collaborator

Debian literally patches out versioningit entirely. Practically speaking, the only way to package anything using versioningit without usable source distribution is to remove versioningit and manually repeat what it does — not only inlining the version number, but also manually creating src/isal/_version.py. Which implies that every distribution out there needs to carry and maintain similar patches.

Good to know. That is indeed not ideal.

The vast majority of users use wheels anyway, making source distribution size a minor problem.

You are right. In fact, installing from source is non-trivial due to the dependencies, so I try to have as much binary builds as possible. So the source distribution can be a bit more complete.

At this point, perhaps the best solution would be to remove VCS versioning entirely and use static versioning instead. This would surely save bandwidth, CPU time and CO₂ on not having to download, install and run versioningit every time the package is being built.

Python-isal has more than a hundred thousand downloads at this point that are mostly wheels. So I doubt that the packaging effort has a significant impact.

Static versioning is what I used before, but I find it inconvenient. Like stated before, I wish to use setuptools_scm, but unfortunately that works suboptimally when a vendored source is present.

i believe versioningit also works from a source archive using the metadata that is put there using setuptools. So just updating the source distribution with the tests seems to be a good solution.

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 a pull request may close this issue.

2 participants