diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index 95afac5..6406766 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -171,8 +171,10 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 %changelog -* Wed Sep 13 2023 Karolina Surma - 1.10.0-1 +* Wed Sep 13 2023 Python Maint - 1.10.0-1 - Add %%_pyproject_check_import_allow_no_modules for automated environments +- Fix handling of tox 4 provision without and explicit tox minversion +- Fixes: rhbz#2240590 * Fri Jul 21 2023 Fedora Release Engineering - 1.9.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/pyproject_buildrequires.py b/pyproject_buildrequires.py index 844fd38..7b0fc87 100644 --- a/pyproject_buildrequires.py +++ b/pyproject_buildrequires.py @@ -386,7 +386,7 @@ def generate_tox_requirements(toxenv, requirements): provision_content = provision.read() if provision_content and r.returncode != 0: provision_requires = json.loads(provision_content) - if 'minversion' in provision_requires: + if provision_requires.get('minversion') is not None: requirements.add(f'tox >= {provision_requires["minversion"]}', source='tox provision (minversion)') if 'requires' in provision_requires: diff --git a/pyproject_buildrequires_testcases.yaml b/pyproject_buildrequires_testcases.yaml index aba6002..2e6e91e 100644 --- a/pyproject_buildrequires_testcases.yaml +++ b/pyproject_buildrequires_testcases.yaml @@ -589,6 +589,43 @@ tox provision satisfied: python3dist(inst) result: 0 +tox provision no minversion: + installed: + setuptools: 50 + wheel: 1 + tox: 3.5.3 + tox-current-env: 0.0.6 + toxenv: + - py3 + setup.py: | + from setuptools import setup + setup( + name='test', + version='0.1', + ) + tox.ini: | + [tox] + requires = + setuptools > 40 + wheel > 2 + expected: + - | # tox 3 + python3dist(setuptools) >= 40.8 + python3dist(wheel) + python3dist(wheel) + python3dist(tox-current-env) >= 0.0.6 + python3dist(setuptools) > 40.0 + python3dist(wheel) > 2.0 + - | # tox 4 + python3dist(setuptools) >= 40.8 + python3dist(wheel) + python3dist(wheel) + python3dist(tox-current-env) >= 0.0.6 + python3dist(setuptools) > 40.0 + python3dist(wheel) > 2.0 + python3dist(tox) + result: 0 + Default build system, unmet deps in requirements file: installed: setuptools: 50