Yelp / venv-update

Synchronize your virtualenv quickly and exactly.
http://venv-update.rtfd.org
MIT License
176 stars 34 forks source link

Version 3.2.1 fails installing some wheels with "'int' object has no attribute 'requirements' error" #222

Open Kreisfahrer opened 5 years ago

Kreisfahrer commented 5 years ago

Error occurs on Windows with venv-update version 3.2.1, pip version 18.1, python version 3.6. Command pip-faster.EXE install -rrequirements.txt

Stack trace:

Using cached https://files.pythonhosted.org/packages/ff/17/5cbb026005115301a8fb2f9b0e3e8d32313142fe8b617070e7baad20554f/requests-2.20.1-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'C:\\Users\\.../.cache\\pip-faster\\wheelhouse\\https:'

Exception:
Traceback (most recent call last):
  File "d:\...\.tox\local\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main
    status = self.run(options, args)
  File "d:\...\.tox\local\lib\site-packages\pip_faster.py", line 398, in run
    required = requirement_set.requirements.values()
AttributeError: 'int' object has no attribute 'requirements'
You are using pip version 18.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
ERROR: could not install deps [-rrequirements.txt]; v = InvocationError("'D:\\\\...\\\\.tox\\\\local\\\\Scripts\\\\pip-faster.EXE install -rrequirements.txt venv-update>=2.1.3'", 2)

It works fine on version 3.2.0.

asottile commented 5 years ago

This appears to be a duplicate of #206. Windows currently isn't supported as the paths we pick for cache directories contain : which is invalid there (reserved for use in the drive letter). I'm surprised that it worked on 3.2.0 given that I don't think anything changed in that code between versions

Kreisfahrer commented 5 years ago

It's probably surprising, but I have successfully used it on Windows 10 with tox-pip-extensions plugin until version 3.2.1. Right now I have pinned venv-update to 3.2.0 and it works perfectly fine. Just curious if it actually worth to support windows...

asottile commented 5 years ago

It's probably not hard, I think you could make the cache bits work with something simple like:

if os.name == 'nt':
    index_url = index_url.replace(':', '_')

here: https://github.com/Yelp/venv-update/blob/02860446c983f8df10db221d66e22a7a912a550c/pip_faster.py#L89

and here: https://github.com/Yelp/venv-update/blob/02860446c983f8df10db221d66e22a7a912a550c/pip_faster.py#L162

but note that we've never tested venv-update on anything but linux, if we want to actually support windows we should probably set up CI for it in some capacity

I'm also very surprised that 3.2.0 works, given the code that's erroring (and what I suspect is crashing) did not change between 3.2.0 and 3.2.1