Page MenuHomePhabricator

spicerack: tox creates py39-tests env even when python 3.9 isn't available
Closed, ResolvedPublic

Description

$ rm -rf .tox
$ tox -e py39-flake8
py39-flake8 create: /home/kormat/gerrit/operations/software/spicerack.git/.tox/py39-tests
py39-flake8 installdeps: .[tests]
py39-flake8 develop-inst: /home/kormat/gerrit/operations/software/spicerack.git
...
  py39-flake8: commands succeeded
  congratulations :)
$ .tox/py39-tests/bin/python --version
Python 3.8.5
$ lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description:    Linux Mint 20.1
Release:        20.1
Codename:       ulyssa
tox:
  Installed: 3.13.2-2
  Candidate: 3.13.2-2
  Version table:
 *** 3.13.2-2 500
        500 http://mirror.init7.net/ubuntu focal/universe amd64 Packages
        500 http://mirror.init7.net/ubuntu focal/universe i386 Packages
        100 /var/lib/dpkg/status

Event Timeline

Volans triaged this task as Medium priority.Feb 9 2021, 10:10 AM
Volans added a project: SRE-tools.
Volans raised the priority of this task from Medium to High.Feb 9 2021, 11:05 AM
Volans added projects: ci-test-error, Jenkins.

This is happening in CI too!

11:59:21 py39-unit run-test: commands[0] | py.test --strict-markers --cov-report=term-missing --cov=spicerack spicerack/tests/unit
11:59:21 [827] /src$ /src/.tox/py39-tests/bin/py.test --strict-markers --cov-report=term-missing --cov=spicerack spicerack/tests/unit
11:59:22 ============================= test session starts ==============================
11:59:22 platform linux -- Python 3.7.3, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
11:59:22 cachedir: .tox/py39-tests/.pytest_cache

Bizarrely, even when python 3.9 _is_ available, it still doesn't get used:

$ rm -rf .tox
$ tox -e py39-flake8 --notest
$ .tox/py39-tests/bin/python --version
Python 3.8.5
$ python3.9 --version
Python 3.9.1
hashar added a subscriber: hashar.

CI uses tox 3.10.0 but it should be able to recognize 3.9.

Given spicerack tox.ini has:

[tox]
skip_missing_interpreters = True

I would expect tox -e py39-flake8 to emit:

SKIPPED: InterpreterNotFound: python3.9

But with tox 3.10.0 and dumping the config --showconfig it has:

[testenv:py39-flake8]
  basepython      = /usr/bin/python3

tox 3.14.0 is not affected. The changelog https://tox.readthedocs.io/en/latest/changelog.html#v3-14-0-2019-09-03 notably has:

Fix regression failing to detect future and past py## factors - by @asottile https://github.com/tox-dev/tox/pull/1377

So I guess we should update the CI images to use the latest tox version (3.21.4).

Volans removed Volans as the assignee of this task.Feb 9 2021, 2:52 PM
Volans added a subscriber: Volans.

Change 663026 had a related patch set uploaded (by David Caro; owner: David Caro):
[integration/config@master] tox: upgrade all images to tox 3.21.4

https://gerrit.wikimedia.org/r/663026

I added a 'naive' patch, as it's the first time that I even see that repo xd, I'll need some help testing it properly, so feel free to ping me if you can help. Thanks!

Change 663029 had a related patch set uploaded (by David Caro; owner: David Caro):
[integration/config@master] Bump versions to newer tox-buster and related images

https://gerrit.wikimedia.org/r/663029

Change 663026 merged by jenkins-bot:
[integration/config@master] tox-buster: upgrade all images to tox 3.21.4

https://gerrit.wikimedia.org/r/663026

Mentioned in SAL (#wikimedia-releng) [2021-02-09T19:31:24Z] <James_F> Docker: Building and publishing tox-buster &c. with tox 3.21.4 T274232

Change 663029 merged by jenkins-bot:
[integration/config@master] jjb: Bump versions to newer tox-buster and related images

https://gerrit.wikimedia.org/r/663029

OK, this seems to work in CI.

Before:

00:05:20.152 py39-unit run-test: commands[0] | py.test --strict-markers --cov-report=term-missing --cov=spicerack spicerack/tests/unit
00:05:20.155 [827] /src$ /src/.tox/py39-tests/bin/py.test --strict-markers --cov-report=term-missing --cov=spicerack spicerack/tests/unit
00:05:21.161 ============================= test session starts ==============================
00:05:21.161 platform linux -- Python 3.7.3, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
00:05:21.161 cachedir: .tox/py39-tests/.pytest_cache

After:

00:06:03.626 SKIPPED: InterpreterNotFound: python3.9

Seems good to me, thank you for the patches, updates etc.

I have announced the tox upgrade on wikitech-l https://lists.wikimedia.org/pipermail/wikitech-l/2021-February/094258.html

Closing this as it's already deployed and announced :)