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

Cannot vendor enum34 (fails to fetch license) #12

Closed
smola opened this issue Sep 15, 2020 · 2 comments
Closed

Cannot vendor enum34 (fails to fetch license) #12

smola opened this issue Sep 15, 2020 · 2 comments

Comments

@smola
Copy link

smola commented Sep 15, 2020

Trying to fetch license for enum34 raises an exception, and the license fallback is not picked up.

This seems to be a pip issue: pypa/pip#8214

Example configuration:

# pyproject.toml

[tool.vendoring]
destination = "_vendor/"
requirements = "_vendor/vendor.txt"
namespace = "_vendor"
protected-files = ["__init__.py", "vendor.txt"]
patches-dir = "tools/vendoring/patches"

[tool.vendoring.transformations]
substitute = []
drop = []

[tool.vendoring.typing-stubs]

[tool.vendoring.license.directories]
enum34 = "enum"

[tool.vendoring.license.fallback-urls]
enum34 = "https://raw.githubusercontent.com/pradyunsg/vendoring/master/LICENSE"
# _vendor/vendor.txt
enum34==1.1.10

vendoring sync . output:

Load configuration... Done!
Clean existing libraries... Done!
Add vendored libraries... Done!
Fetch licenses...
  Running pip download -r _vendor/vendor.txt --no-binary :all: --no-deps --dest /tmp/vendoring-cache
    Collecting enum34==1.1.10
      Using cached enum34-1.1.10.tar.gz (28 kB)
        ERROR: Command errored out with exit status 1:
         command: /home/smola/.pyenv/versions/3.8.5/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-download-t2hxg965/enum34/setup.py'"'"'; __file__='"'"'/tmp/pip-download-t2hxg965/enum34/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-pip-egg-info-3_1sdg4u
             cwd: /tmp/pip-download-t2hxg965/enum34/
        Complete output (11 lines):
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/home/smola/.pyenv/versions/3.8.5/lib/python3.8/site-packages/setuptools/__init__.py", line 5, in <module>
            import distutils.core
          File "/home/smola/.pyenv/versions/3.8.5/lib/python3.8/distutils/core.py", line 16, in <module>
            from distutils.dist import Distribution
          File "/home/smola/.pyenv/versions/3.8.5/lib/python3.8/distutils/dist.py", line 9, in <module>
            import re
          File "/home/smola/.pyenv/versions/3.8.5/lib/python3.8/re.py", line 145, in <module>
            class RegexFlag(enum.IntFlag):
        AttributeError: module 'enum' has no attribute 'IntFlag'
        ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Command exited with non-zero exit code: 1
@pradyunsg
Copy link
Owner

Thanks for filing this issue! ^>^

I don't think there's much that vendoring can do here. The thing that's failing is the pip download call, and there's nothing we can do from within vendoring that'll make that command pass. :)

@smola
Copy link
Author

smola commented Apr 6, 2021

I didn't test it yet, but I think this should be fixed in the next pip release by this:
pypa/pip#9689

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

2 participants