#128 Update to 4.11.0 (rhbz#2189321)
Merged 9 months ago by churchyard. Opened 10 months ago by churchyard.
rpms/ churchyard/python-tox 4.11.0  into  rawhide

file removed
-36
@@ -1,36 +0,0 @@ 

- From bf13dbdb80573a10942a23e4b6071aaa5d3e64cf Mon Sep 17 00:00:00 2001

- From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>

- Date: Mon, 17 Jul 2023 11:35:38 +0200

- Subject: [PATCH] Update a test regex to work with Python 3.12+

- 

- Fixes https://github.com/tox-dev/tox/issues/3065

- 

- New message:

- 

-     "argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'type'"

- ---

-  docs/changelog/3065.bugfix.rst            | 1 +

-  tests/config/loader/test_memory_loader.py | 2 +-

-  2 files changed, 2 insertions(+), 1 deletion(-)

-  create mode 100644 docs/changelog/3065.bugfix.rst

- 

- diff --git a/docs/changelog/3065.bugfix.rst b/docs/changelog/3065.bugfix.rst

- new file mode 100644

- index 000000000..774b33b24

- --- /dev/null

- +++ b/docs/changelog/3065.bugfix.rst

- @@ -0,0 +1 @@

- +Update a regular expression in tests to match the exception message in both Python 3.12 and older.

- diff --git a/tests/config/loader/test_memory_loader.py b/tests/config/loader/test_memory_loader.py

- index 6f645540e..8ab7f8f62 100644

- --- a/tests/config/loader/test_memory_loader.py

- +++ b/tests/config/loader/test_memory_loader.py

- @@ -66,7 +66,7 @@ def test_memory_loader(value: Any, of_type: type[Any], outcome: Any) -> None:

-          (["m"], List[int], ValueError, "invalid literal for int"),

-          ({"m": 1}, Dict[int, int], ValueError, "invalid literal for int"),

-          ({1: "m"}, Dict[int, int], ValueError, "invalid literal for int"),

- -        (object, Path, TypeError, "expected str, bytes or os.PathLike object"),

- +        (object, Path, TypeError, r"str(, bytes)? or (an )?os\.PathLike object"),

-          (1, Command, TypeError, "1"),

-          (1, EnvList, TypeError, "1"),

-      ],

file modified
+33 -40
@@ -1,57 +1,58 @@ 

- From eb6cd0a5fe1734c5eee78b9889ba7a07fdeb2111 Mon Sep 17 00:00:00 2001

+ From c23f636eef39220989fcfde7aed6a505aaca993c Mon Sep 17 00:00:00 2001

  From: Lumir Balhar <lbalhar@redhat.com>

  Date: Tue, 10 Jan 2023 08:34:25 +0100

  Subject: [PATCH] fix tests

  

  ---

-  pyproject.toml          |  4 ----

+  pyproject.toml          |  5 -----

   src/tox/pytest.py       | 16 +++-------------

-  tests/test_provision.py | 18 ++----------------

+  tests/test_provision.py | 17 ++---------------

   3 files changed, 5 insertions(+), 33 deletions(-)

  

  diff --git a/pyproject.toml b/pyproject.toml

- index 19ee5ec..b806958 100644

+ index 9bdfbca..51c6980 100644

  --- a/pyproject.toml

  +++ b/pyproject.toml

- @@ -73,8 +73,6 @@ optional-dependencies.docs = [

+ @@ -72,9 +72,6 @@ optional-dependencies.docs = [

   ]

   optional-dependencies.testing = [

     "build[virtualenv]>=0.10",

  -  "covdefaults>=2.3",

- -  "devpi-process>=0.3",

-    "diff-cover>=7.5",

-    "distlib>=0.3.6",

+ -  "detect-test-pollution>=1.1.1",

+ -  "devpi-process>=1",

+    "diff-cover>=7.7",

+    "distlib>=0.3.7",

     "flaky>=3.7",

- @@ -82,7 +80,6 @@ optional-dependencies.testing = [

-    "hatchling>=1.14",

-    "psutil>=5.9.4",

-    "pytest>=7.2.2",

- -  "pytest-cov>=4",

-    "pytest-mock>=3.10",

-    "pytest-xdist>=3.2.1",

+ @@ -82,7 +79,6 @@ optional-dependencies.testing = [

+    "hatchling>=1.18",

+    "psutil>=5.9.5",

+    "pytest>=7.4",

+ -  "pytest-cov>=4.1",

+    "pytest-mock>=3.11.1",

+    "pytest-xdist>=3.3.1",

     "re-assert>=1.1",

- @@ -120,7 +117,6 @@ paths.source = [

+ @@ -148,7 +144,6 @@ paths.source = [

   report.fail_under = 88

   report.omit = ["src/tox/config/cli/for_docs.py", "tests/execute/local_subprocess/bad_process.py", "tests/type_check/*"]

   run.parallel = true

  -run.plugins = ["covdefaults"]

   

-  [tool.isort]

-  known_first_party = ["tox", "tests"]

+  [tool.mypy]

+  python_version = "3.11"

  diff --git a/src/tox/pytest.py b/src/tox/pytest.py

- index 0bc9905..65701b5 100644

+ index d7243bd..0e14e5d 100644

  --- a/src/tox/pytest.py

  +++ b/src/tox/pytest.py

- @@ -26,7 +26,6 @@ from _pytest.logging import LogCaptureFixture

-  from _pytest.monkeypatch import MonkeyPatch

-  from _pytest.python import Function

-  from _pytest.tmpdir import TempPathFactory

+ @@ -16,7 +16,6 @@ from typing import TYPE_CHECKING, Any, Callable, Iterator, Protocol, Sequence, c

+  

+  import pytest

+  from _pytest.fixtures import SubRequest

  -from devpi_process import IndexServer

-  from pytest_mock import MockerFixture

   from virtualenv.info import fs_supports_symlink

   

- @@ -286,9 +285,9 @@ class ToxProject:

-                  m.setattr(sys, "argv", [sys.executable, "-m", "tox"] + list(args))

+  import tox.run

+ @@ -276,9 +275,9 @@ class ToxProject:

+                  m.setattr(sys, "argv", [sys.executable, "-m", "tox", *list(args)])

                   m.setenv("VIRTUALENV_SYMLINK_APP_DATA", "1")

                   m.setenv("VIRTUALENV_SYMLINKS", "1")

  -                m.setenv("VIRTUALENV_PIP", "embed")
@@ -63,12 +64,12 @@ 

                   try:

                       tox_run(args)

                   except SystemExit as exception:

- @@ -472,15 +471,6 @@ def enable_pypi_server(monkeypatch: MonkeyPatch, url: str | None) -> None:

+ @@ -472,15 +471,6 @@ def enable_pypi_server(monkeypatch: pytest.MonkeyPatch, url: str | None) -> None

       monkeypatch.setenv("PIP_TIMEOUT", str(2))

   

   

  -@pytest.fixture(scope="session")

- -def pypi_server(tmp_path_factory: TempPathFactory) -> Iterator[IndexServer]:

+ -def pypi_server(tmp_path_factory: pytest.TempPathFactory) -> Iterator[IndexServer]:

  -    # takes around 2.5s

  -    path = tmp_path_factory.mktemp("pypi")

  -    with IndexServer(path) as server:
@@ -80,18 +81,10 @@ 

   def _invalid_index_fake_port() -> int:  # noqa: PT005

       with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as socket_handler:

  diff --git a/tests/test_provision.py b/tests/test_provision.py

- index 290e48d..475d7f4 100644

+ index f9275fb..ddf8607 100644

  --- a/tests/test_provision.py

  +++ b/tests/test_provision.py

- @@ -12,7 +12,6 @@ from unittest import mock

-  from zipfile import ZipFile

-  

-  import pytest

- -from devpi_process import Index, IndexServer

-  from filelock import FileLock

-  from packaging.requirements import Requirement

-  

- @@ -93,21 +92,9 @@ def tox_wheels(tox_wheel: Path, tmp_path_factory: TempPathFactory) -> list[Path]

+ @@ -92,21 +92,9 @@ def tox_wheels(tox_wheel: Path, tmp_path_factory: TempPathFactory) -> list[Path]

           return result

   

   
@@ -115,7 +108,7 @@ 

   

   

   def test_provision_requires_nok(tox_project: ToxProjectCreator) -> None:

- @@ -156,7 +143,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -

+ @@ -155,7 +143,6 @@ def test_provision_requires_ok(tox_project: ToxProjectCreator, tmp_path: Path) -

   

   

   @pytest.mark.integration()
@@ -124,5 +117,5 @@ 

       ini = "[tox]\nrequires=demo-pkg-inline\n[testenv]\npackage=skip\n[testenv:.tox]\nplatform=wrong_platform"

       proj = tox_project({"tox.ini": ini})

  -- 

- 2.39.2

+ 2.40.1

  

file modified
+11 -6
@@ -19,8 +19,8 @@ 

  %undefine _py3_shebang_s

  

  Name:           python-tox

- Version:        4.4.12

- Release:        4%{?dist}

+ Version:        4.11.0 

+ Release:        1%{?dist}

  Summary:        Virtualenv-based automation of test activities

  

Suggestion: Add an SPDX comment on an extra commit here.

  License:        MIT
@@ -28,13 +28,11 @@ 

  Source0:        %{pypi_source tox}

  

  # Remove dependency on devpi-process.

+ # Remove dependency on detect-test-pollution.

  # Remove coverage-related dependencies.

  # Adjust virtualenv environment variables to make it work with our patched virtualenv.

  Patch1:         fix-tests.patch

  

- # Update a test regex to work with Python 3.12+

- Patch2:         https://github.com/tox-dev/tox/pull/3066.patch

- 

  BuildArch:      noarch

  

  BuildRequires:  python3-devel
@@ -49,6 +47,9 @@ 

  BuildRequires:  libffi-devel

  # xdist is not used upstream, but we use it to speed up the %%check

  BuildRequires:  python3-pytest-xdist

+ # for test_allowed_implicit_cli_envs[py310]

+ # TODO remove this once https://github.com/tox-dev/tox/pull/3108 is released

Not a blocker, but I would backport this PR instead of buildrequiring python3.10

+ BuildRequires:  python3.10

  %if %{with ci_tests}

  # The CI tests only work if the tested tox is installed :(

  BuildRequires:  tox = %{version}-%{release}
@@ -105,7 +106,8 @@ 

  

  # Upstream updates dependencies too aggressively

  # see https://github.com/tox-dev/tox/pull/2843#discussion_r1065028356

- sed -ri -e 's/"(packaging|filelock|platformdirs|psutil|diff-cover|pyproject-api|pytest-xdist|wheel)>=.*/"\1",/g' \

+ sed -ri -e 's/"(packaging|filelock|platformdirs|psutil|diff-cover|pyproject-api|pytest|pytest-mock|pytest-xdist|wheel|pluggy|distlib|cachetools)>=.*/"\1",/g' \

Were pytest, pytest-mock, wheel, distlib, cachetools and time-machine added there for completeness to disable the aggressive versioning requirements or did something change?

+         -e "s/'(time-machine)>=[^;']+/'\1/" \

          -e 's/"(virtualenv)>=.*/"\1>=20",/g' \

          -e 's/"(hatchling)>=.*/"\1>=1.13",/g' \

      pyproject.toml
@@ -159,6 +161,9 @@ 

  

  

  %changelog

+ * Wed Aug 30 2023 Miro Hrončok <mhroncok@redhat.com> - 4.11.0-1

+ - Update to 4.11.0 (rhbz#2189321)

+ 

  * Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.12-4

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

  

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

- SHA512 (tox-4.4.12.tar.gz) = 896ecef178b0625246ffe4ab3a9a0c03650eb78633fa92706e93475d6589ac29d65bbf91b9ecfacfa8154739eefd463aeb1252be68998cdffddc270a4f89edd0

+ SHA512 (tox-4.11.0.tar.gz) = 3e2e9f09874c39f6928d2502e5d01ca48721fc777d758f1d4b3df012261c3adc9e93a89ff6dcf7950fb4245df2624ff8c7cb84feb9424a8fcb6ab12117728692

file modified
+4
@@ -66,6 +66,9 @@ 

      - smoke_pypy39:

          dir: python/smoke

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

+     - smoke_pypy310:

+         dir: python/smoke

+         run: PYTHON=pypy3.10 VERSION=3.10 ./venv.sh

      - pyproject_pytest:

          dir: pyproject-rpm-macros/tests

          run: ./mocktest.sh python-pytest
@@ -88,6 +91,7 @@ 

      - python3.12-devel

      - python2-devel

      - pypy3.9-devel

+     - pypy3.10-devel

      - python3-tox

      - python3-dnf

      - mock

no initial comment

1 new commit added

  • CI: Add PyPy 3.10
10 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/f9cd2a4359ae47b686112ca214aaf890

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/a60b466c57f846f2ba74bfa7406529d8

rebased onto 9ec60fc

10 months ago

Rebased just to include a link to https://github.com/tox-dev/tox/pull/3108 in a comment. No code changes.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/53f53074ab044084b942f5724f0fcf70

Not a blocker, but I would backport this PR instead of buildrequiring python3.10

Suggestion: Add an SPDX comment on an extra commit here.

Were pytest, pytest-mock, wheel, distlib, cachetools and time-machine added there for completeness to disable the aggressive versioning requirements or did something change?

Not a blocker, but I would backport this PR instead of buildrequiring python3.10

I added the requirement before PR existed and was lazy to backport it later. Since this is probably temporary anyway, I don't mind BuildRequring Python 3.10 for a while.


Suggestion: Add an SPDX comment on an extra commit here.

https://src.fedoraproject.org/rpms/python-tox/c/4934b264923dd3124e0f1b88f756430ecf78432f?branch=rawhide

(This comment happened before we agreed on adding the comment. Since this will not go into RHEL, I don't mind we don't have it.)


Were pytest, pytest-mock, wheel, distlib, cachetools and time-machine added there for completeness to disable the aggressive versioning requirements or did something change?

Upstream pinned newer versions for those, some of them not available on Fedora 38, some of them not even on Fedora 39.

Not a blocker, but I would backport this PR instead of buildrequiring python3.10

I added the requirement before PR existed and was lazy to backport it later. Since this is probably temporary anyway, I don't mind BuildRequring Python 3.10 for a while.


Suggestion: Add an SPDX comment on an extra commit here.

https://src.fedoraproject.org/rpms/python-tox/c/4934b264923dd3124e0f1b88f756430ecf78432f?branch=rawhide

(This comment happened before we agreed on adding the comment. Since this will not go into RHEL, I don't mind we don't have it.)


Were pytest, pytest-mock, wheel, distlib, cachetools and time-machine added there for completeness to disable the aggressive versioning requirements or did something change?

Upstream pinned newer versions for those, some of them not available on Fedora 38, some of them not even on Fedora 39.

Ack. Another thing. I noticed that also in the previous rebases no impact test was done, same as here. Any reasons for that or just an oversight?

Generally, I assumed the CI coverage here is good enough not to break anything, but this has been a big jump -- I'll do it.

For rawhide: https://copr.fedorainfracloud.org/coprs/churchyard/tox-4.11/builds/

If the results are good, I will not do this for f38 and f39.

  • [x] PR solves the issue it claims to address (updates the package, solves a bug, etc.)
  • [x] Resulting RPM package is installable on the destination Fedora release
  • [x] No dependent RPM packages will stop being installable when the PR is merged and built
  • [x] PR is tested sufficiently and the test results are OK (green CI, impact check issues addressed)
    waiting on Copr
  • [x] PR is open against all relevant Fedora releases
  • [x] (If PR is open against more Fedora releases) branches don't diverge unnecessarily
  • [x] (If PR is open against older Fedora releases) PR doesn't contain backwards incompatible changes
    waiting on Copr
  • [x] Each commit's scope is sane (there are no irrelevant changes combined together)
  • [x] Each commit message is relevant
  • [x] (If it's linked), the right (problem, product) BZ ticket is referenced
  • [x] (If it's linked), BZ ticket reference is in the correct format in %changelog and/or commit message
  • [-] (If needed) Release is bumped
  • [-] (When adding patches) Patch purpose is documented in the specfile
  • [-] (When backporting patches) Patch origin and/or authorship is traceable
  • [x] (When creating patches from scratch) The patch is proposed upstream or justified as downstream-only

For rawhide: https://copr.fedorainfracloud.org/coprs/churchyard/tox-4.11/builds/

If the results are good, I will not do this for f38 and f39.

All failures failed in https://copr.fedorainfracloud.org/coprs/churchyard/tox-control/builds/ as well, except for sagemath which is still running but fails in koschei.

Everything looks good, feel free to merge.

Pull-Request has been merged by churchyard

9 months ago