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

CI Tests failing (py 3.6 and 3.7) with version conflict: importlib_metadata #507

Closed
itsayellow opened this issue Sep 28, 2020 · 4 comments · Fixed by #509
Closed

CI Tests failing (py 3.6 and 3.7) with version conflict: importlib_metadata #507

itsayellow opened this issue Sep 28, 2020 · 4 comments · Fixed by #509

Comments

@itsayellow
Copy link
Contributor

itsayellow commented Sep 28, 2020

Describe the bug

Github CI tests are now failing for python 3.6 and python 3.7 with a version conflict. It appears to be due to the requirement for importlib-metadata < 2.0 and the provided importlib-metadata at v2.0.0.

I'm having trouble reading this Traceback. Is this due to virtualenv requiring importlib-metadata < 2.0?

Run nox --non-interactive --session tests-3.6
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 789, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (importlib-metadata 2.0.0 (/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages), Requirement.parse('importlib-metadata<2,>=0.12; python_version < "3.8"'), {'virtualenv'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.6.12/x64/bin/nox", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3126, in <module>
    @_call_aside
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
    f(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pkg_resources/__init__.py", line 784, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'importlib-metadata<2,>=0.12; python_version < "3.8"' distribution was not found and is required by virtualenv

How to reproduce

Expected behavior

@uranusjr
Copy link
Member

uranusjr commented Sep 29, 2020

It’s likely due to nox requiring an incompatible importlib-metadata version. Would it help to populate the CI environment (the one containing nox, not the one nox creates) with the new pip resolver (--use-feature=2020-resolver)?

@itsayellow
Copy link
Contributor Author

I don't quite understand what's going on, because when I run the tests locally using nox, there is no conflict on my local system.

I'm not sure what the mention of virtualenv in the error message means, it's hard to tell what the error is saying. Theoretically our version of nox shouldn't be using virtualenv.

@itsayellow
Copy link
Contributor Author

Oh I see what's happening on my system. To run my nox I'm using python 3.8 even when the tests use other python versions. So I never have a need for importlib-metadata which is only for python < 3.8.

Even @cs01's native-venv fork of nox still has virtualenv as a requirement. And virtualenv requires importlib-metadata < 2.0.0 for any python < 3.8. So with an existing importlib-metadata (required by something else presumably, or just preinstalled on github?) the virtualenv requirements fail.

@itsayellow
Copy link
Contributor Author

itsayellow commented Sep 29, 2020

Looks like on my local system I can replicate the failure using python3.7 running nox.

Also, --use-feature=2020-resolver seems to fix the problem!

Here is what causes the conflict. nox requires both:

  • argcomplete requires importlib-metadata>=0.23,<3
  • virtualenv requires importlib-metadata>=0.12,<2

@itsayellow itsayellow mentioned this issue Sep 29, 2020
1 task
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

Successfully merging a pull request may close this issue.

2 participants