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

Python nightly tests fail: "InvalidVersion: Invalid version: '3.12.0a4+'" #1556

Closed
nedbat opened this issue Feb 11, 2023 · 3 comments
Closed
Labels
bug Something isn't working fixed

Comments

@nedbat
Copy link
Owner

nedbat commented Feb 11, 2023

The nightly builds started failing Feb 10 2023, 2:28am. This is the 3.12 build, but 3.10 and 3.11 failed with similar messages:

_________________________ EnvironmentTest.test_bug_862 _________________________
  [gw0] linux -- Python 3.12.0 /home/runner/work/coveragepy/coveragepy/.tox/py312/bin/python
  
  self = <tests.test_process.EnvironmentTest object at 0x7f387912bb00>
  
      @pytest.mark.skipif(env.WINDOWS, reason="Windows can't make symlinks")
      def test_bug_862(self) -> None:
          # This simulates how pyenv and pyenv-virtualenv end up creating the
          # coverage executable.
          self.make_file("elsewhere/bin/fake-coverage", """\
              #!{executable}
              import sys, pkg_resources
              sys.exit(pkg_resources.load_entry_point('coverage', 'console_scripts', 'coverage')())
              """.format(executable=sys.executable))
          os.chmod("elsewhere/bin/fake-coverage", stat.S_IREAD | stat.S_IEXEC)
          os.symlink("elsewhere", "somewhere")
          self.make_file("foo.py", "print('inside foo')")
          self.make_file("bar.py", "import foo")
          out = self.run_command("somewhere/bin/fake-coverage run bar.py")
  >       assert "inside foo\n" == out
  E       assert 'inside foo\n' == "Traceback (m...'3.12.0a4+'\n"
  E         + inside foo
  E         - Traceback (most recent call last):
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 3030, in _dep_map
  E         -     return self.__dep_map
  E         -            ^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2826, in __getattr__
  E         -     raise AttributeError(attr)
  E         - AttributeError: _DistInfoDistribution__dep_map
  E         - 
  E         - During handling of the above exception, another exception occurred:
  E         - 
  E         - Traceback (most recent call last):
  E         -   File "/tmp/pytest-of-runner/pytest-0/popen-gw0/t348/somewhere/bin/fake-coverage", line 3, in <module>
  E         -     sys.exit(pkg_resources.load_entry_point('coverage', 'console_scripts', 'coverage')())
  E         -              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 522, in load_entry_point
  E         -     return get_distribution(dist).load_entry_point(group, name)
  E         -            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2855, in load_entry_point
  E         -     return ep.load()
  E         -            ^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2467, in load
  E         -     self.require(*args, **kwargs)
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2489, in require
  E         -     reqs = self.dist.requires(self.extras)
  E         -            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2746, in requires
  E         -     dm = self._dep_map
  E         -          ^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 3032, in _dep_map
  E         -     self.__dep_map = self._compute_dependencies()
  E         -                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 3049, in _compute_dependencies
  E         -     common = types.MappingProxyType(dict.fromkeys(reqs_for_extra(None)))
  E         -                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/__init__.py", line 3046, in reqs_for_extra
  E         -     if not req.marker or req.marker.evaluate({'extra': extra}):
  E         -                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/_vendor/packaging/markers.py", line 245, in evaluate
  E         -     return _evaluate_markers(self._markers, current_environment)
  E         -            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/_vendor/packaging/markers.py", line 137, in _evaluate_markers
  E         -     groups[-1].append(_evaluate_markers(marker, environment))
  E         -                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/_vendor/packaging/markers.py", line 151, in _evaluate_markers
  E         -     groups[-1].append(_eval_op(lhs_value, op, rhs_value))
  E         -                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/_vendor/packaging/markers.py", line 109, in _eval_op
  E         -     return spec.contains(lhs, prereleases=True)
  E         -            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/_vendor/packaging/specifiers.py", line 565, in contains
  E         -     normalized_item = _coerce_version(item)
  E         -                       ^^^^^^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/_vendor/packaging/specifiers.py", line 36, in _coerce_version
  E         -     version = Version(version)
  E         -               ^^^^^^^^^^^^^^^^
  E         -   File "/home/runner/work/coveragepy/coveragepy/.tox/py312/lib/python3.12/site-packages/pkg_resources/_vendor/packaging/version.py", line 197, in __init__
  E         -     raise InvalidVersion(f"Invalid version: '{version}'")
  E         - pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '3.12.0a4+'
  
  /home/runner/work/coveragepy/coveragepy/tests/test_process.py:853: AssertionError
@nedbat nedbat added bug Something isn't working needs triage next and removed needs triage labels Feb 11, 2023
@nedbat
Copy link
Owner Author

nedbat commented Feb 13, 2023

The failure started because of the setuptools version upgrade in 712bd2b. Not sure why, but locally I end up with setuptools==65.6.3, and in CI I get 67.2.0.

@nedbat
Copy link
Owner Author

nedbat commented Feb 14, 2023

This is temporarily fixed by pinning setuptools in 7887212.

@nedbat nedbat removed the next label Feb 14, 2023
@nedbat
Copy link
Owner Author

nedbat commented May 3, 2023

This is temporarily fixed in a different way in cf3602f.

@nedbat nedbat closed this as completed May 7, 2023
@nedbat nedbat added the fixed label May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

1 participant