peterbe / hashin

Helping you write hashed entries for packages in your requirements.txt
https://www.peterbe.com/plog/hashin
MIT License
105 stars 27 forks source link

Add python 3.9 and 3.10 in the test matrix. #133

Closed pcorpet closed 2 years ago

pcorpet commented 2 years ago

Also use python 3.10 for linting.

peterbe commented 2 years ago

Hehe. That's surprising. It tried to install Python 3.1. Try

      matrix:
        python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10']

to see if that resolves the problem.

peterbe commented 2 years ago

Any idea why it might be failing there?

peterbe commented 2 years ago

The full error in https://github.com/peterbe/hashin/runs/4718005525?check_suite_focus=true is:

  Traceback (most recent call last):
    File "/home/runner/work/hashin/hashin/.tox/py310/lib/python3.10/site-packages/_pytest/config/__init__.py", line 382, in _getconftestmodules
      return self._path2confmods[path]
  KeyError: local('/home/runner/work/hashin/hashin/tests')

  During handling of the above exception, another exception occurred:
  Traceback (most recent call last):
    File "/home/runner/work/hashin/hashin/.tox/py310/lib/python3.10/site-packages/_pytest/config/__init__.py", line 413, in _importconftest
      return self._conftestpath2mod[conftestpath]
  KeyError: local('/home/runner/work/hashin/hashin/tests/conftest.py')

  During handling of the above exception, another exception occurred:
  Traceback (most recent call last):
    File "<frozen importlib._bootstrap>", line 939, in _find_spec
  AttributeError: 'AssertionRewritingHook' object has no attribute 'find_spec'

  During handling of the above exception, another exception occurred:
  Traceback (most recent call last):
    File "/home/runner/work/hashin/hashin/.tox/py310/lib/python3.10/site-packages/_pytest/config/__init__.py", line 419, in _importconftest
      mod = conftestpath.pyimport()
    File "/home/runner/work/hashin/hashin/.tox/py310/lib/python3.10/site-packages/py/_path/local.py", line 704, in pyimport
      __import__(modname)
    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 941, in _find_spec
    File "<frozen importlib._bootstrap>", line 915, in _find_spec_legacy
    File "/home/runner/work/hashin/hashin/.tox/py310/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 158, in find_module
      source_stat, co = _rewrite_test(self.config, fn_pypath)
    File "/home/runner/work/hashin/hashin/.tox/py310/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 408, in _rewrite_test
      co = compile(tree, fn.strpath, "exec", dont_inherit=True)
  TypeError: required field "lineno" missing from alias
  ERROR: could not load /home/runner/work/hashin/hashin/tests/conftest.py

  ERROR: InvocationError for command /home/runner/work/hashin/hashin/.tox/py310/bin/pytest tests (exited with code 4)

Do we need to upgrade the pytest version in test-requirements.txt to make it work?

pcorpet commented 2 years ago

Apparently yes. Let me try some local testing before pushing something again. https://github.com/pytest-dev/pytest/pull/8540

pcorpet commented 2 years ago

Hmm, the new pytest does not support python 2.7. Time to drop support of python 2? at least in testing matrix?

peterbe commented 2 years ago

Hmm.. That didn't work. Any chance you can take a look?

pcorpet commented 2 years ago

My fault entirely, I mistyped the latest version of pytest. Please try again.