Skip to content
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

Requested lz4~=4.3 from file, but installing version 0.0.0/version: none #280

Open
EvilSupahFly opened this issue Jul 8, 2024 · 0 comments

Comments

@EvilSupahFly
Copy link

EvilSupahFly commented Jul 8, 2024

Trying to build a flatpak application from a Python project which requires lz4.

However, when building from source, the build fails:

========================================================================
Building module python3-lz4 in /home/evilsupahfly/src/Flatpak Testing/.flatpak-builder/build/python3-lz4-1
========================================================================
Running: pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "lz4==4.3.3" --no-build-isolation
Using pip 24.0 from /usr/lib/python3.11/site-packages/pip (python 3.11)
Looking in links: file:///run/build/python3-lz4
ERROR: Could not find a version that satisfies the requirement lz4==4.3.3 (from versions: none)
ERROR: No matching distribution found for lz4==4.3.3
Error: module python3-lz4: Child process exited with code 1

According to the help I got from my original help request on python.org, this is a bug in lz4 itself:

As can be seen on GitHub, the pyproject.toml file doesn’t specify a version number. pyproject.toml is in fact quite minimal in this case; it’s only specifying some build dependencies, and expecting the setup.py process to create all the needed metadata.

But this project wants to compute the version using setuptools-scm, an extension to setuptools that checks version control to retrieve information about the project and compute things like the version number.

More specifically, it’s configured to use setuptools-scm to write a version number into a lz4/version.py file in the source directory, and then use that during building to set the version for metadata. (The file is then also available for the program to use internally at runtime.) The GitHub repository doesn’t contain this file (version control wouldn’t be tracking it on the devs’ machine) and neither does the source tarball. This is a problem, because it prevents anyone else from building from the source tarball - when unpacked on someone else’s machine, there’s no Git repo from which to extract the version info.

So when the package is built from the sdist, it can’t produce the necessary file, therefore can’t inform the metadata creation process, and therefore falls back to a default version number.

So when attempting to build from source, it fails because the metadata doesn't contain any useable version information.

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

No branches or pull requests

1 participant