Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Install failure with Python 3.4 on upgrade of tox from 2.9.0 -> 2.9.1 #76

Closed
ssteinerx opened this issue Sep 30, 2017 · 12 comments
Closed

Comments

@ssteinerx
Copy link

Worked on 2.9.0, fails on 2.9.1.

Python 3.4 is the only failure of 2.7, 3.4, 3.5, 3.6 builds.

Traceback is pretty long but the final result is:

The command "pip install -U tox-travis" failed and exited with 2 during .

This is where things went wrong:

2.31s$ pip install -U tox-travis
Collecting tox-travis
  Downloading tox_travis-0.8-py2.py3-none-any.whl
Collecting tox>=2.0 (from tox-travis)
  Downloading tox-2.9.1-py2.py3-none-any.whl (73kB)
    100% |████████████████████████████████| 81kB 3.1MB/s 
Collecting six (from tox>=2.0->tox-travis)
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting virtualenv>=1.11.2; python_version != "3.2" (from tox>=2.0->tox-travis)
  Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)
    100% |████████████████████████████████| 1.8MB 751kB/s 
Collecting py>=1.4.17 (from tox>=2.0->tox-travis)
  Using cached py-1.4.34-py2.py3-none-any.whl
Collecting pluggy<1.0,>=0.3.0 (from tox>=2.0->tox-travis)
  Downloading pluggy-0.5.2.tar.gz
Building wheels for collected packages: pluggy
  Running setup.py bdist_wheel for pluggy ... done
  Stored in directory: /home/travis/.cache/pip/wheels/22/b2/db/618ae8dcba2994fb9ebce70ec1c1ab4923df89a77edac7e901
Successfully built pluggy
Installing collected packages: six, virtualenv, py, pluggy, tox, tox-travis
  Found existing installation: six 1.10.0
    Uninstalling six-1.10.0:
      Successfully uninstalled six-1.10.0
  Rolling back uninstall of six
Exception:
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2813, in _dep_map
    return self.__dep_map
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2624, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

Full log:

https://travis-ci.org/pydanny/cookiecutter-djangopackage/jobs/281635173

@obestwalter
Copy link
Member

obestwalter commented Sep 30, 2017

Hi @ssteinerx, I am pretty sure this is unrelated to tox - especially if it was fine with 2.9.0 - 2.9.1 does not contain any actual changes. It was released because the changelog on pypi had a rendering error. I also tried locally just now with python3.4 and there was also no problem. Did you try to force a fresh build?

@obestwalter
Copy link
Member

I just had a look at the log and this looked familiar ...

FileNotFoundError: [Errno 2] No such file or directory: '/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/six-1.10.0.dist-info/METADATA'

This looks very much like this: pypa/setuptools#951

@ssteinerx
Copy link
Author

@obestwalter This is run by Travis and the only install command is:

pip install -U tox-travis

so I'm not sure how much fresher I can make it.

I'm going to poke around a bit and see what versions of setuptools is being used on each Python version. Maybe I have to force a setuptools upgrade first.

@obestwalter
Copy link
Member

It is definitely strange that this starts happening now in your build and only with 3.4, that's why I thought that somehow a forced rebuild would make it go away.

Maybe this will help: pypa/setuptools#951 (comment)

@ssteinerx
Copy link
Author

setuptools versions aren't consistent:

2.7 -- setuptools (36.3.0)
3.4 -- setuptools (35.0.2)
3.5 -- setuptools (36.3.0)
3.6 -- setuptools (36.2.0)
pypy -- setuptools (36.2.3)

3.4 is the only one that fails (failed, didn't do it just now).

Seems like a fixed-ish setuptools issue. Race conditions (if that's really what it was) are tricksy.

I'm going to force upgrade setuptools in my test.

Maybe requiring the updated version here would prevent these spurious problems in other projects?

@obestwalter
Copy link
Member

Maybe requiring the updated version here would prevent these spurious problems in other projects?

What would you suggest?

@ssteinerx
Copy link
Author

ssteinerx commented Sep 30, 2017

@obestwalter Perhaps a quick mention of this bug at the top of the README:

As per #76, setuptools < 36 may cause spurious errors.

Please ensure that setuptools is upgraded before reporting related bugs.

This can be done with:

install: pip install -U setuptools && pip install tox-travis

If nothing else, this will prevent another bug report like this one.

I'm also going to report on Travis/tox when I get a chance since this kind of bug can really show up in any project (as evidenced by all the referencers to pypa/setuptools#951) and should be either prevented with a setuptools update or at least annotated.

Of course, these types of silly issues are what led me to discover tox-travis in the first place...

@obestwalter
Copy link
Member

Good idea. How about baking that into a PR and we'll get it merged?

Of course, these types of silly issues are what led me to discover tox-travis in the first place...

So there's a good side to everything 😁

@ryanhiebert
Copy link
Collaborator

If we can improve the setuptools version selector to avoid this issue, I think that would be preferable to adding a note that people probably won't read to the readme.

@obestwalter
Copy link
Member

@ryanhiebert true - that would definitely be better, much harder to get right also though.

@ssteinerx
Copy link
Author

Unfortunately, I'm not convinced that the "race condition" that supposedly causes the issue was ever addressed...it may have just moved around a bit. Nor am I sure, given that, that any particular intermediate version is better than any other.

@rpkilby
Copy link
Member

rpkilby commented Oct 26, 2017

Hi all, I think we can close this here, as this is ultimately related to tox depending on six, and is not directly related to tox-travis. As a quick test, I ran a build against the current master of tox, and reproduced the race condition (build). I have also ran into this issue separately in a PR for tox (build).

If we can improve the setuptools version selector to avoid this issue, I think that would be preferable

That should work. Listing setuptools first in the requirements should ensure it's upgraded before six, and bypass the race condition. I'll open a corresponding PR on tox.

@rpkilby rpkilby closed this as completed Oct 26, 2017
igordejanovic added a commit to igordejanovic/parglare that referenced this issue Nov 15, 2017
therefromhere added a commit to prismaticd/django-assertmaxnumqueries that referenced this issue Dec 11, 2017
samueldmeyer added a commit to samueldmeyer/explainable_ML_public_policy that referenced this issue Mar 21, 2018
afiorillo added a commit to afiorillo/textblob-de that referenced this issue Sep 3, 2018
afiorillo added a commit to afiorillo/textblob-de that referenced this issue Sep 3, 2018
afiorillo added a commit to afiorillo/textblob-de that referenced this issue Sep 3, 2018
afiorillo added a commit to afiorillo/textblob-de that referenced this issue Sep 3, 2018
afiorillo added a commit to afiorillo/textblob-de that referenced this issue Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants