#93 [EPEL9] Update to 3.25.0
Merged 2 years ago by churchyard. Opened 2 years ago by churchyard.
rpms/ churchyard/python-tox 3.25.0  into  epel9

file modified
+6 -4
@@ -14,11 +14,11 @@ 

  # Unset -s on python shebang - ensure that extensions installed with pip

  # to user locations are seen and properly loaded

  # Fixes https://bugzilla.redhat.com/2057015

- %global py3_shebang_flags %nil

+ %global py3_shebang_flags %(echo %py3_shebang_flags | sed s/s//)

  

  Name:           python-tox

- Version:        3.24.5

- Release:        2%{?dist}

+ Version:        3.25.0

+ Release:        1%{?dist}

  Summary:        Virtualenv-based automation of test activities

  

  License:        MIT
@@ -34,7 +34,6 @@ 

  BuildRequires:  /usr/bin/gcc

  BuildRequires:  /usr/bin/git

  BuildRequires:  /usr/bin/pip

- BuildRequires:  /usr/bin/poetry

  BuildRequires:  /usr/bin/pytest

  BuildRequires:  /usr/bin/python

  BuildRequires:  libffi-devel
@@ -118,6 +117,9 @@ 

  

  

  %changelog

+ * Mon May 09 2022 Miro Hrončok <mhroncok@redhat.com> - 3.25.0-1

+ - Update to 3.25.0

+ 

  * Tue Feb 22 2022 Rich Megginson <rmeggins@redhat.com> - 3.24.5-2

  - Remove -s flag from tox shebang, make tox see user-installed plugins

  - Fixes: rhbz#2057015

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (tox-3.24.5.tar.gz) = 2b047c5682c2c57268fb46055207388d060fb31511d6e442dc49244a5ac53c4d2fecd7bb9a8e33bb02b580192926592523dfb991c4bd8b216559f71a1c548f9a

+ SHA512 (tox-3.25.0.tar.gz) = d98ed9f589c751ddc187618caf509fbc64e99f1b5eafeb9cbd919d94d10e15a55331658121efabac53ef07adeb71af15da8be86fc4f35688a8f9b93bf3e723d1

@@ -0,0 +1,88 @@ 

+ #!/usr/bin/python3

+ """

+ Several packages with various Python interpreters *Supplement* tox.

+ *Supplements* is a reverse dependency to *Recommends*.

+ 

+ See https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/NVVUXSVSPFQOWIGBE2JNI67HEO7R63ZQ/

+ 

+ This script:

+ 

+  1) figures out all packages in the enabled repositories supplementing tox

+  2) ensures there is a venv.sh test for each of them in tests.yml

+ 

+ That way, when we change tox (update, patch, etc.),

+ we will always test it with all Pythons that supplement it.

+ """

+ 

+ import shlex

+ import subprocess

+ import sys

+ import yaml

+ 

+ 

+ def parse_python_test_arg(command):

+     tokens = shlex.split(command)

+     for token in tokens:

+         if token.startswith('PYTHON='):

+             return token.removeprefix('PYTHON=')

+     # only check VERSION if PYTHON was not found

+     for token in tokens:

+         if token.startswith('VERSION='):

+             return 'python' + token.removeprefix('VERSION=')

+     raise RuntimeError(f'Could not determine the Python version from `{command}`')

+ 

+ 

+ # First, construct a set of various Pythons we test, e.g. {python3.10, python3.7, pypy3.6, ...}

+ tested_pythons = set()

+ with open('tests.yml') as f:

+     tests_yml = yaml.safe_load(f)

+ # this nested structure access is quite fragile,

+ # but at least it should fail the test if we reach to a wrong place

+ for test in tests_yml[-1]['roles'][0]['tests']:

+     for value in test.values():

+         run = value['run']

+         if run.endswith('./venv.sh'):

+             tested_pythons.add(parse_python_test_arg(run))

+ print('Tested Pythons found in tests.yml:', file=sys.stderr)

+ for python in sorted(tested_pythons):

+     print('    ', python, file=sys.stderr)

+ 

+ 

+ # Get all packages that supplement tox,

+ # no repo explicitly specified means we use the enabled repos on the CI system which should be what we want

+ repoquery_result = subprocess.check_output(['dnf', 'repoquery', '--whatsupplements', 'tox'], text=True)

+ supplementing_pkgs = set(repoquery_result.splitlines())

+ 

+ 

+ # It gets quite tricky, since packages like "pypy" can supplement tox, we get a set of provides for all of them

+ supplementing_pkgs_provides = {}

+ for nvra in supplementing_pkgs:

+     repoquery_result = subprocess.check_output(['dnf', '-q', 'repoquery', '--provides', nvra], text=True)

+     provides = set(repoquery_result.splitlines())

+     unversioned_provides = {provide.split(' ')[0] for provide in provides}

+     supplementing_pkgs_provides[nvra.rsplit('-', 2)[0]] = unversioned_provides

+ 

+ 

+ # We use this hack to treat -devel and -libs packages as if they were not such

+ def normalize_name(pkgname):

+     for suffix in '-devel', '-libs':

+         if pkgname.endswith(suffix):

+             return pkgname.removesuffix(suffix)

+     return pkgname

+ 

+ 

+ # Now, for each package that supplements tox, we check if there is a tested Python that *is* it

+ exit_code = 0

+ for pkg, provides in supplementing_pkgs_provides.items():

+     if normalize_name(pkg) in tested_pythons:

+         print(f'{pkg} is tested', file=sys.stderr)

+         continue

+     for provide in provides:

+         if normalize_name(provide) in tested_pythons:

+             print(f'{pkg} is tested (via {provide})', file=sys.stderr)

+             break

+     else:

+         print(f'{pkg} is NOT tested', file=sys.stderr)

+         exit_code = 1

+ 

+ sys.exit(exit_code)

file modified
+20
@@ -27,6 +27,9 @@ 

      - mock_with_tests:

          dir: .

          run: pyproject-rpm-macros/tests/mocktest.sh python-tox --enable-network --with tests

+     - all_supplementing_pythons:

+         dir: tests

+         run: ./all_supplementing_pythons.py

      - smoke27:

          dir: python/smoke

          run: VERSION=2.7 METHOD=virtualenv ./venv.sh
@@ -48,6 +51,18 @@ 

      - smoke310:

          dir: python/smoke

          run: VERSION=3.10 ./venv.sh

+     - smoke311:

+         dir: python/smoke

+         run: VERSION=3.11 ./venv.sh

+     - smoke_pypy37:

+         dir: python/smoke

+         run: PYTHON=pypy3.7 VERSION=3.7 ./venv.sh

+     - smoke_pypy38:

+         dir: python/smoke

+         run: PYTHON=pypy3.8 VERSION=3.8 ./venv.sh

+     - smoke_pypy39:

+         dir: python/smoke

+         run: PYTHON=pypy3.9 VERSION=3.9 ./venv.sh

      - pyproject_pytest:

          dir: pyproject-rpm-macros/tests

          run: ./mocktest.sh python-pytest
@@ -66,10 +81,15 @@ 

      - python3.8

      - python3.9

      - python3.10

+     - python3.11

      - python2-devel

      - python3-devel

+     - pypy3.7-devel

+     - pypy3.8-devel

+     - pypy3.9-devel

      - python3-tox

      - dnf

      - mock

      - rpmdevtools

      - rpm-build

+     - python3-pyyaml

no initial comment

Mockbuild with tests and the following Fedora 34 packages passed:

python3-pytest-randomly-3.5.0-2.fc34.noarch
python3-flaky-3.7.0-2.fc34.noarch
python3-execnet-1.7.1-5.fc34.noarch
python3-pytest-xdist-2.2.0-2.fc34.noarch

1 new commit added

  • /usr/bin/poetry is not needed for tests, poetry is pip-installed as a build backend
2 years ago

VERSION=3.9 ./venv.sh also works in mock

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Pull-Request has been merged by churchyard

2 years ago