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

regression from 7.x: unable to install some libraries (e.g. setuptools_scm_git_archive, pikepdf) - version detected as 0.0 #727

Closed
saifelse opened this issue Jun 22, 2022 · 12 comments

Comments

@saifelse
Copy link

The following works:

docker run -it python:3.9-alpine /bin/sh -c \
  'pip install setuptools_scm==6.4.2 && pip install --no-build-isolation setuptools_scm_git_archive==1.2 --no-binary :all:'

But fails when upgrading to 7.0.2:

docker run -it python:3.9-alpine /bin/sh -c \
  'pip install setuptools_scm==7.0.2 && pip install --no-build-isolation setuptools_scm_git_archive==1.2 --no-binary :all:'

Output:

Collecting setuptools_scm==7.0.2
  Downloading setuptools_scm-7.0.2-py3-none-any.whl (40 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.7/40.7 KB 2.9 MB/s eta 0:00:00
Collecting packaging>=20.0
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.8/40.8 KB 6.7 MB/s eta 0:00:00
Collecting tomli>=1.0.0
  Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting typing-extensions
  Downloading typing_extensions-4.2.0-py3-none-any.whl (24 kB)
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/site-packages (from setuptools_scm==7.0.2) (58.1.0)
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 KB 10.8 MB/s eta 0:00:00
Installing collected packages: typing-extensions, tomli, pyparsing, packaging, setuptools_scm
Successfully installed packaging-21.3 pyparsing-3.0.9 setuptools_scm-7.0.2 tomli-2.0.1 typing-extensions-4.2.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Collecting setuptools_scm_git_archive==1.2
  Downloading setuptools_scm_git_archive-1.2.tar.gz (3.4 kB)
  Preparing metadata (setup.py) ... done
  WARNING: Requested setuptools_scm_git_archive==1.2 from https://files.pythonhosted.org/packages/78/a2/aee5edbf18bbd5dd6b90a762e54d15182bc840e8ac34fc1993f99795ebe7/setuptools_scm_git_archive-1.2.tar.gz#sha256=92e8149c1f4a62fe170962b4ff8cb3d53bfa90fc944f1f1758cebaef56a67f13, but installing version 0.0
Discarding https://files.pythonhosted.org/packages/78/a2/aee5edbf18bbd5dd6b90a762e54d15182bc840e8ac34fc1993f99795ebe7/setuptools_scm_git_archive-1.2.tar.gz#sha256=92e8149c1f4a62fe170962b4ff8cb3d53bfa90fc944f1f1758cebaef56a67f13 (from https://pypi.org/simple/setuptools-scm-git-archive/): Requested setuptools_scm_git_archive==1.2 from https://files.pythonhosted.org/packages/78/a2/aee5edbf18bbd5dd6b90a762e54d15182bc840e8ac34fc1993f99795ebe7/setuptools_scm_git_archive-1.2.tar.gz#sha256=92e8149c1f4a62fe170962b4ff8cb3d53bfa90fc944f1f1758cebaef56a67f13 has inconsistent version: filename has '1.2', but metadata has '0.0'
ERROR: Could not find a version that satisfies the requirement setuptools_scm_git_archive==1.2 (from versions: 1.0, 1.1, 1.2)
ERROR: No matching distribution found for setuptools_scm_git_archive==1.2
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.

The notable line in the output is:

https://files.pythonhosted.org/packages/78/a2/aee5edbf18bbd5dd6b90a762e54d15182bc840e8ac34fc1993f99795ebe7/setuptools_scm_git_archive-1.2.tar.gz#sha256=92e8149c1f4a62fe170962b4ff8cb3d53bfa90fc944f1f1758cebaef56a67f13 (from https://pypi.org/simple/setuptools-scm-git-archive/): Requested setuptools_scm_git_archive==1.2 from https://files.pythonhosted.org/packages/78/a2/aee5edbf18bbd5dd6b90a762e54d15182bc840e8ac34fc1993f99795ebe7/setuptools_scm_git_archive-1.2.tar.gz#sha256=92e8149c1f4a62fe170962b4ff8cb3d53bfa90fc944f1f1758cebaef56a67f13 has inconsistent version: filename has '1.2', but metadata has '0.0'

A workaround I've found is to use this escape hatch: https://github.com/pypa/setuptools_scm/blob/f1f35bd0f20a983a919d73a646a2ad9a3e36d5d4/src/setuptools_scm/_overrides.py#L15-L20

docker run -it -e 'SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SETUPTOOLS_SCM_GIT_ARCHIVE=1.2' python:3.9-alpine /bin/sh -c \
  'pip install setuptools_scm==7.0.2 && pip install --no-build-isolation setuptools_scm_git_archive==1.2 --no-binary :all:'
@saifelse saifelse changed the title regression from 7.x: unable to install some libraries (e.g. setuptools_scm_git_archive, pikepdf) regression from 7.x: unable to install some libraries (e.g. setuptools_scm_git_archive, pikepdf) - version detected as 0.0 Jun 22, 2022
@saifelse
Copy link
Author

I suspect this is related to #580

@RonnyPfannschmidt
Copy link
Contributor

I suspect its related to entrypoint matching vs archive contents

@dreua
Copy link

dreua commented Jun 23, 2022

Same here, thanks for the bug report and workaround!

See flathub/com.github.jeromerobert.pdfarranger@159f3c4 for an example on how to apply it on a flatpak build. Make sure you set the variable for the build of the affected package itself, in this case pikepdf. Setting it when building other packages depending on the affected package won't work.

I was a bit confused by the fact that pip reported from versions: none because it sounded more like a change in search paths or such. Should I create a new issue about that?

ERROR: Could not find a version that satisfies the requirement pikepdf>=1.17.0 (from pdfarranger) (from versions: none)

The build of img2pdf reported pikepdf as version 0.0 which hints in the right direction. (Full flatpak build log)

@RonnyPfannschmidt
Copy link
Contributor

I suspect this can easily be fixed by having the built in git support also consume the 3rd party plugin data

Im out of commission due to a cold for a few days

jbarlow83 added a commit to pikepdf/pikepdf that referenced this issue Jun 23, 2022
jbarlow83 added a commit to pikepdf/pikepdf that referenced this issue Jun 24, 2022
@RonnyPfannschmidt
Copy link
Contributor

the bug is in https://github.com/pypa/setuptools_scm/blob/21e58d4ebd9aedc1477a5021b0370f66963c4341/src/setuptools_scm/git.py#L293-L296

as this code runs instead of the one from the git_archive plugin, the value is wrong

the code should only use this if there is a node in the archival data

RonnyPfannschmidt added a commit that referenced this issue Jun 27, 2022
…o-version-for-empty

fix #727: correctly handle incomplete archivals from setuptools_scm_g…
@djhoese
Copy link

djhoese commented Jun 27, 2022

Can someone verify that this is fixed with 7.0.4? I'm still seeing a similar issue and filed #735 for what I was seeing.

@dreua
Copy link

dreua commented Jun 27, 2022

I don't think 7.0.4 is released yet.

@djhoese
Copy link

djhoese commented Jun 27, 2022

Ah I must have gotten the version number mixed up. Even 7.0.3 is not out. Thanks. I will try using the git version in some testing and see what I get. Thanks.

@JakeFDev
Copy link

Looks like its merged in and awaiting release?

@dreua
Copy link

dreua commented Jul 1, 2022

According to the git log it is already fixed in 7.0.3 i.e. the changelog is wrong. Haven't tested it yet.

@djhoese
Copy link

djhoese commented Jul 1, 2022

Looks like 7.0.4 was just released on PyPI 3 hours ago.

@dreua
Copy link

dreua commented Jul 3, 2022

I can confirm it's fixed in 7.0.3. It would be nice if someone could fix the changelog.

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Jan 5, 2023
https://build.opensuse.org/request/show/1055978
by user dirkmueller + dimstar_suse
- update to 0.8.3:
  * Workaround pypa/setuptools-scm#727
  * Add support for Tesseravt 5 + Linux
  * Fix file descriptor leak (thanks to oda)
  * Make the dependency on setuptools_scm optional
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

5 participants