WDscholia / scholia

Wikidata-based scholarly profiles
https://scholia.toolforge.org
Other
219 stars 78 forks source link

python 3.10 tests do not work #2183

Closed WolfgangFahl closed 1 year ago

WolfgangFahl commented 1 year ago

Describe the bug tox config is missing 3.10 To Reproduce tox -e py310 GLOB sdist-make: /home/wf/source/python/scholia/setup.py ERROR: invocation failed (exit code 1), logfile: /home/wf/source/python/scholia/.tox/log/GLOB-0.log =========================================================================== log start =========================================================================== Traceback (most recent call last): File "/home/wf/source/python/scholia/setup.py", line 2, in from setuptools import setup, find_packages File "/usr/lib/python3/dist-packages/setuptools/init.py", line 10, in import distutils.core ModuleNotFoundError: No module named 'distutils.core'

============================================================================ log end ============================================================================ ERROR: FAIL could not package project - v = InvocationError('/usr/bin/python3.9 setup.py sdist --formats=zip --dist-dir .tox/dist', 1) Expected behavior tests work on python 3.10

WolfgangFahl commented 1 year ago

workaround:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt install python3.9-venv
python3.9 -m venv .venv
source .venv/bin/activate
tox -e py39
egonw commented 1 year ago

Okay, it turned out we only needed to add an additional environment to the tox config file:

image

WolfgangFahl commented 1 year ago

@egonw great - i configure my jenkinks nightly build now for python 3.10 I get a warning:

WARNING: test command found but not installed in testenv
  cmd: /hd/luxio/var/lib/jenkins/jobs/scholia/workspace/.venv/bin/python
  env: /hd/luxio/var/lib/jenkins/jobs/scholia/workspace/.tox/py310
Maybe you forgot to specify a dependency? See also the allowlist_externals envconfig setting.

Then i get:

py310 run-test-pre: PYTHONHASHSEED='1461203360'
___________________________________ summary ____________________________________
  py310: commands succeeded
  congratulations :)

Finished: SUCCESS

but did this actually run any tests? There should be an output such as:

py39 run-test-pre: PYTHONHASHSEED='2432178477'
py39 run-test: commands[0] | python -m pytest --doctest-modules scholia
============================= test session starts ==============================
platform linux -- Python 3.9.16, pytest-7.2.0, pluggy-1.0.0
cachedir: .tox/py39/.pytest_cache
rootdir: /hd/luxio/var/lib/jenkins/jobs/scholia/workspace
collected 68 items

scholia/api.py .........                                                 [ 13%]
scholia/arxiv.py ..                                                      [ 16%]
scholia/github.py .                                                      [ 17%]
scholia/googlescholar.py .                                               [ 19%]
scholia/model.py ..                                                      [ 22%]
scholia/qs.py .                                                          [ 23%]
scholia/query.py .................................                       [ 72%]
scholia/tex.py ...                                                       [ 76%]
scholia/utils.py ....                                                    [ 82%]
scholia/wikipedia.py .                                                   [ 83%]
scholia/scrape/ceurws.py ....                                            [ 89%]
scholia/scrape/jmlr.py .                                                 [ 91%]
scholia/scrape/nips.py ...                                               [ 95%]
scholia/scrape/ojs.py ...                                                [100%]

============================= 68 passed in 45.78s ==============================
py39 run-test: commands[1] | python -m pytest tests
============================= test session starts ==============================
platform linux -- Python 3.9.16, pytest-7.2.0, pluggy-1.0.0
cachedir: .tox/py39/.pytest_cache
rootdir: /hd/luxio/var/lib/jenkins/jobs/scholia/workspace
collected 15 items

tests/test_arxiv.py .                                                    [  6%]
tests/test_ask_query.py ...                                              [ 26%]
tests/test_query.py ....                                                 [ 53%]
tests/test_scrape_ojs.py .                                               [ 60%]
tests/test_tex.py ...                                                    [ 80%]
tests/test_text.py .                                                     [ 86%]
tests/test_utils.py .                                                    [ 93%]
tests/scrape/test_ojs.py .                                               [100%]

============================= 15 passed in 43.58s ==============================
___________________________________ summary ____________________________________
  py39: commands succeeded
  congratulations :)
Finished: SUCCESS

I am going back to the python 3.9 config for the time being

egonw commented 1 year ago

Dunno. I get to see the same output on GitHub that you see for py39. Did you get all patches? https://github.com/WDscholia/scholia/pull/2201/commits

@fnielsen may see what I did wrong. I'm not a regular Python user