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

"pip install pdoc3" fails because of "yanked" version of "setuptools-scm 6.2.0" #357

Closed
dlukyanov opened this issue Sep 1, 2021 · 3 comments
Labels
invalid This is not a (valid) bug report

Comments

@dlukyanov
Copy link

pip install pdoc3 fails with error:

Collecting pdoc3==0.10.0
  Downloading https://files.pythonhosted.org/packages/95/be/69267c988fb7236cd60c452a4e7fb9a7991729476db490b634a07e7dfcdf/pdoc3-0.10.0.tar.gz (86kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k7kdl0l8/pdoc3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k7kdl0l8/pdoc3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-k7kdl0l8/pdoc3/pip-egg-info
          cwd: /tmp/pip-install-k7kdl0l8/pdoc3/
     Complete output (21 lines):
     Traceback (most recent call last):
	   ...
       File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 735, in finalize_options
         ep.load()(self, ep.name, value)
       File "/tmp/pip-install-k7kdl0l8/pdoc3/.eggs/setuptools_scm-6.2.0-py3.8.egg/setuptools_scm/integration.py", line 29, in version_keyword
         dist.metadata.version = _get_version(config)
       File "/tmp/pip-install-k7kdl0l8/pdoc3/.eggs/setuptools_scm-6.2.0-py3.8.egg/setuptools_scm/__init__.py", line 188, in _get_version
         dump_version(
       File "/tmp/pip-install-k7kdl0l8/pdoc3/.eggs/setuptools_scm-6.2.0-py3.8.egg/setuptools_scm/__init__.py", line 94, in dump_version
         version_fields = parsed_version.release
     AttributeError: 'Version' object has no attribute 'release'

Steps to Reproduce

Dockerfile:

FROM registry.access.redhat.com/ubi8/ubi

RUN yum install -y \
        python38 \
        python38-pip \
        python38-devel \
        gcc-c++ \
        procps

# RUN pip3 install setuptools-scm==6.0.1  # uncomment this to make it work
# current version of setuptools-scm 6.2.0 with label=yanked
# and pdoc3 uses the latest even it's not a release?
RUN pip3 install pdoc3==0.10.0

ENTRYPOINT /bin/bash

use command to build docker and it will fail:

docker build -t test-pdoc3 -f Dockerfile .

NOTE: this docker was working fine just several days ago and now it fails.

After investigation i found that pdoc3 uses setuptools_scm-6.2.0 (yanked version) during setup...

https://pypi.org/project/setuptools-scm/6.2.0/

@kernc
Copy link
Member

kernc commented Sep 1, 2021

We specify any setuptools-scm version as a setup requirement:

pdoc/setup.py

Lines 53 to 56 in f358893

setup_requires=[
'setuptools_git',
'setuptools_scm',
],

If pip install pdoc3 pulls in the yanked version, I'd say that's a pip/setuptools bug. See pypa/pip#8262.

It might help (and is perhaps always advised) to run this beforehand:

RUN pip3 install --upgrade pip setuptools

@pfmoore
Copy link

pfmoore commented Sep 1, 2021

Older versions of setuptools would handle setup_requires using easy_install which is no longer supported and does not respect the "yanked" flag. New versions of setuptools should pass setup_requires as build requirements, which recent versions of pip will install normally into an isolated build environment, respecting the "yanked" flag.

@dlukyanov please ensure this issue can be reproduced using the latest versions of pip and setuptools. It's not possible to tell from the information in your report what versions of pip and setuptools are being used.

@dlukyanov
Copy link
Author

# python3 --version
Python 3.8.6

# python3 -m pip install pip --upgrade
Successfully installed pip-21.2.4

# python3 -m pip --version
pip 21.2.4 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

after this if you try to install pdoc3 - it will fail with error described above

however after python3 -m pip install pip setuptools --upgrade the installation of pdoc3 works fine.

@kernc kernc added the invalid This is not a (valid) bug report label Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This is not a (valid) bug report
Development

No branches or pull requests

3 participants