#25 Update to 7.0.1
Merged 2 years ago by churchyard. Opened 2 years ago by churchyard.
rpms/ churchyard/pytest 7  into  rawhide

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

- From 78fb97105f38dc286353bbc331a243b6e753fe3c Mon Sep 17 00:00:00 2001

- From: Petr Viktorin <encukou@gmail.com>

- Date: Wed, 6 Jan 2021 13:33:33 +0100

- Subject: [PATCH 1/2] Make code.FormattedExcinfo.get_source more defensive

- 

- When line_index was a large negative number, get_source failed

- on `source.lines[line_index]`.

- Use the same dummy Source as with a large positive line_index.

- ---

-  src/_pytest/_code/code.py | 6 +++---

-  1 file changed, 3 insertions(+), 3 deletions(-)

- 

- diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py

- index b852175606..af3bdf0561 100644

- --- a/src/_pytest/_code/code.py

- +++ b/src/_pytest/_code/code.py

- @@ -721,11 +721,11 @@ def get_source(

-      ) -> List[str]:

-          """Return formatted and marked up source lines."""

-          lines = []

- -        if source is None or line_index >= len(source.lines):

- +        if source is not None and line_index < 0:

- +            line_index += len(source.lines)

- +        if source is None or line_index >= len(source.lines) or line_index < 0:

-              source = Source("???")

-              line_index = 0

- -        if line_index < 0:

- -            line_index += len(source)

-          space_prefix = "    "

-          if short:

-              lines.append(space_prefix + source.lines[line_index].strip())

- 

- From 0a75c8e57b4b87ee533f3b08612590704b6743bb Mon Sep 17 00:00:00 2001

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

- Date: Thu, 22 Apr 2021 19:13:44 +0200

- Subject: [PATCH 2/2] Add a regression test for a more defensive

-  code.FormattedExcinfo.get_source

- 

- ---

-  testing/code/test_excinfo.py | 23 +++++++++++++++++++++++

-  1 file changed, 23 insertions(+)

- 

- diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py

- index e6a9cbaf73..287733dac7 100644

- --- a/testing/code/test_excinfo.py

- +++ b/testing/code/test_excinfo.py

- @@ -1397,6 +1397,29 @@ def test(tmp_path):

-      result.stderr.no_fnmatch_line("*INTERNALERROR*")

-  

-  

- +def test_regression_nagative_line_index(pytester):

- +    """

- +    With Python 3.10 alphas, there was an INTERNALERROR reported in

- +    https://github.com/pytest-dev/pytest/pull/8227

- +    This test ensures it does not regress.

- +    """

- +    pytester.makepyfile(

- +        """

- +        import ast

- +        import pytest

- +

- +

- +        def test_literal_eval():

- +            with pytest.raises(ValueError, match="^$"):

- +                ast.literal_eval("pytest")

- +    """

- +    )

- +    result = pytester.runpytest()

- +    result.stdout.fnmatch_lines(["* 1 failed in *"])

- +    result.stdout.no_fnmatch_line("*INTERNALERROR*")

- +    result.stderr.no_fnmatch_line("*INTERNALERROR*")

- +

- +

-  @pytest.mark.usefixtures("limited_recursion_depth")

-  def test_exception_repr_extraction_error_on_recursion():

-      """

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

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

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

- Date: Wed, 12 May 2021 13:30:46 +0200

- Subject: [PATCH] Ignore DeprecationWarnings in test_trial_error

- 

- Fixes https://github.com/pytest-dev/pytest/issues/8663

- ---

-  testing/test_unittest.py | 4 +++-

-  1 file changed, 3 insertions(+), 1 deletion(-)

- 

- diff --git a/testing/test_unittest.py b/testing/test_unittest.py

- index 8b00cb8..de8fc5c 100644

- --- a/testing/test_unittest.py

- +++ b/testing/test_unittest.py

- @@ -533,7 +533,9 @@ class TestTrialUnittest:

-                  # will crash both at test time and at teardown

-          """

-          )

- -        result = testdir.runpytest("-vv", "-oconsole_output_style=classic")

- +        result = testdir.runpytest(

- +            "-vv", "-oconsole_output_style=classic", "-W", "ignore::DeprecationWarning"

- +        )

-          result.stdout.fnmatch_lines(

-              [

-                  "test_trial_error.py::TC::test_four FAILED",

- 

- 

file modified
+36 -37
@@ -1,20 +1,12 @@ 

  Name:           pytest

- Version:        6.2.5

- Release:        2%{?dist}

+ %global base_version 7.0.1

+ #global prerelease ...

+ Version:        %{base_version}%{?prerelease:~%{prerelease}}

+ Release:        1%{?dist}

  Summary:        Simple powerful testing with Python

  License:        MIT

  URL:            https://pytest.org

- Source0:        %{pypi_source}

- 

- # Make code.FormattedExcinfo.get_source more defensive

- # Merged upstream, https://github.com/pytest-dev/pytest/pull/8227

- # Rebased slightly

- Patch1:         8227.patch

- 

- # Ignore DeprecationWarnings in test_trial_error

- # Merged upstream, https://github.com/pytest-dev/pytest/pull/8664

- # Rebased slightly

- Patch3:         8664.patch

+ Source0:        %{pypi_source pytest %{base_version}%{?prerelease}}

  

  # When building pytest for the first time with new Python version

  # we might not yet have all the BRs, those conditionals allow us to do that.
@@ -38,21 +30,12 @@ 

  %bcond_without docs

  

  BuildRequires:  python3-devel

- BuildRequires:  python3-setuptools

- BuildRequires:  python3-setuptools_scm

- 

- # Those are also runtime deps, needed for tests and docs

- # We keep them unconditionality, so we don't accidentally build pytest

- # before them and get broken dependencies

- BuildRequires:  python3-attrs

- BuildRequires:  python3-iniconfig

- BuildRequires:  python3-packaging

- BuildRequires:  python3-pluggy >= 0.12

- BuildRequires:  python3-py >= 1.5.0

- BuildRequires:  python3-toml

+ BuildRequires:  pyproject-rpm-macros >= 0-51

  

  %if %{with tests}

- BuildRequires:  python3-hypothesis

+ # we avoid using %%pyproject_buildrequires -x testing as it mixes optional and non-optional deps

+ BuildRequires:  python3-hypothesis >= 3.56

+ BuildRequires:  python3-pygments >= 2.7.2

  BuildRequires:  python3-xmlschema

  %if %{with optional_tests}

  BuildRequires:  python3-argcomplete
@@ -99,23 +82,32 @@ 

  The pytest framework makes it easy to write small tests, yet scales to support

  complex functional testing for applications and libraries.

  

+ 

  %prep

- %autosetup -p1 -n %{name}-%{version}

+ %autosetup -p1 -n %{name}-%{base_version}%{?prerelease}

+ 

+ 

+ %generate_buildrequires

+ %pyproject_buildrequires -r

+ 

  

  %build

- %py3_build

+ %pyproject_wheel

  

  %if %{with docs}

  for l in doc/* ; do

-   make -C $l html PYTHONPATH=$(pwd)/src SPHINXBUILD=%{_bindir}/sphinx-build-3

+   %make_build -C $l html PYTHONPATH=%{pyproject_build_lib}

  done

  for f in README CHANGELOG CONTRIBUTING ; do

    rst2html ${f}.rst > ${f}.html

  done

  %endif

  

+ 

  %install

- %py3_install

+ %pyproject_install

+ %pyproject_save_files _pytest pytest

+ 

  mv %{buildroot}%{_bindir}/pytest %{buildroot}%{_bindir}/pytest-%{python3_version}

  ln -snf pytest-%{python3_version} %{buildroot}%{_bindir}/pytest-3

  mv %{buildroot}%{_bindir}/py.test %{buildroot}%{_bindir}/py.test-%{python3_version}
@@ -139,32 +131,39 @@ 

       -name '*.py' \

       -exec sed -i -e '1{/^#!/d}' {} \;

  

+ 

  %if %{with tests}

  %check

  %global __pytest %{buildroot}%{_bindir}/pytest

- # test_errors_in_xfail_skip_expressions: https://github.com/pytest-dev/pytest/issues/9413

- %pytest testing %{?with_timeout:--timeout=30} -rs -k "not test_errors_in_xfail_skip_expressions"

+ # optional_tests deps contain pytest-xdist, so we can use it to run tests faster

+ %pytest testing %{?with_timeout:--timeout=30} %{?with_optional_tests:-n auto} -rs

  %endif

  

- %files -n python3-%{name}

+ 

+ %files -n python3-%{name} -f %{pyproject_files}

  %if %{with docs}

  %doc CHANGELOG.html

  %doc README.html

  %doc CONTRIBUTING.html

  %doc _htmldocs/html

  %endif

- %license LICENSE

  %{_bindir}/pytest

  %{_bindir}/pytest-3

  %{_bindir}/pytest-%{python3_version}

  %{_bindir}/py.test

  %{_bindir}/py.test-3

  %{_bindir}/py.test-%{python3_version}

- %{python3_sitelib}/pytest-*.egg-info/

- %{python3_sitelib}/_pytest/

- %{python3_sitelib}/pytest/

+ 

  

  %changelog

+ * Tue Mar 01 2022 Miro Hrončok <mhroncok@redhat.com> - 7.0.1-1

+ - Update to 7.0.1

+ - Fixes: rhbz#2050629

+ 

+ * Fri Jan 21 2022 Miro Hrončok <mhroncok@redhat.com> - 7.0.0~rc1-1

+ - Update to 7.0.0rc1

+ - Fixes: rhbz#2029764

+ 

  * Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.5-2

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

  

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

- SHA512 (pytest-6.2.5.tar.gz) = 7624563a9d967da4cbf82cfff90bae8c0cca07b32e291dc7c5efa787725ed1a255edd066bf0d5fbd89b8cbed8cf5b619fe7c7017f44a7f8a014e3310c06bdbf9

+ SHA512 (pytest-7.0.1.tar.gz) = 21493717159a64fe6467bd096b578b127d81438d04f5b03ba2f4047237054f865a1f50a4e291b9d95b1a144f59bc7a8b3a00008493f4fb4f14bff7fb65c5edc2

no initial comment

1 new commit added

  • Convert to pyproject-rpm-macros
2 years ago

4 new commits added

  • Convert to pyproject-rpm-macros
  • Update to 7.0.0rc1
  • Remove a no longer needed workaround
  • Temporarily skip test_errors_in_xfail_skip_expressions
2 years ago

1 new commit added

  • Run the tests in %check in parallel with -n auto when possible
2 years ago

5 new commits added

  • Run the tests in %check in parallel with -n auto when possible
  • Convert to pyproject-rpm-macros
  • Update to 7.0.0rc1
  • Remove a no longer needed workaround
  • Temporarily skip test_errors_in_xfail_skip_expressions
2 years ago

5 new commits added

  • Run the tests in %check in parallel with -n auto when possible
  • Convert to pyproject-rpm-macros
  • Update to 7.0.0rc1
  • Remove a no longer needed workaround
  • Temporarily skip test_errors_in_xfail_skip_expressions
2 years ago
python-fasjson-client.src
(python3.10dist(pytest) >= 4.6.11 with python3.10dist(pytest) < 7)

python-fastapi.src
(python3dist(pytest) < 7 with python3dist(pytest) >= 6.2.4)

python-pikepdf.src
(python3dist(pytest) < 7~~ with python3dist(pytest) >= 6)

python-priority.src
(python3dist(pytest) < 7 with python3dist(pytest) >= 6.2)

python3-pytest-httpx.noarch
(python3.10dist(pytest) >= 6 with python3.10dist(pytest) < 7)

python3-pytest-testmon.noarch
(python3.10dist(pytest) < 7~~ with python3.10dist(pytest) >= 5)

cc @nphilipp @music @qulogic @zdohnal @eclipseo @fab @radez

Can the requirements be relaxed?

For python-fastapi, almost surely. I have to loosen requirements in that package all the time. I’ll go ahead and make the change and hope for the best. I tried to test it, but python-httpx is broken.

Error: 
 Problem: conflicting requests
  - nothing provides (python3.10dist(httpcore) < 0.14 with python3.10dist(httpcore) >= 0.13.3) needed by python3-httpx-0.19.0-1.fc36.noarch

This is the list of failures unique to the pytest-7 copr:

$ comm -12 <(copr monitor churchyard/pytest-7 --output-format text-row | grep failed$ | cut -f1 | sort) <(copr monitor churchyard/pytest-6 --output-format text-row | grep succeeded$ | cut -f1 | sort)

I'll go and see them one by one, but it'll take some time.

```
python-priority.src
(python3dist(pytest) < 7 with python3dist(pytest) >= 6.2)

```

cc @eclipseo

Can the requirements be relaxed?

Relaxed, tested, building now.

rebased onto d3e79b8

2 years ago

rebased onto 7faf670

2 years ago

Build succeeded.

I still see packages pinning pytest to < 7:

python-click-0:8.0.4-1.fc37.src
python3dist(pytest) < 7~~

There is https://github.com/pallets/click/commit/91b2cd67dd04b2843fd6c71e582876c826f5b78e

cc @cstratak -- let's try to include that?

EDIT: Fixed


Also:

python-fasjson-client-0:1.0.5-1.fc36.src
(python3.10dist(pytest) >= 4.6.11 with python3.10dist(pytest) < 7)

No response in https://github.com/fedora-infra/fasjson-client/issues/233

cc @nphilipp again, could you please see if the dependency can be relaxed?

https://bugzilla.redhat.com/show_bug.cgi?id=2059975


python-odata-query-0:0.4.2-3.fc36.src
(python3dist(pytest) < 7~~ with python3dist(pytest) >= 6.2)

cc @rominf could you please see if the dependency can be relaxed?

https://bugzilla.redhat.com/show_bug.cgi?id=2059977


python-pikepdf-0:4.4.1-1.fc36.src
(python3dist(pytest) < 7~~ with python3dist(pytest) >= 6)

cc @qulogic again, could you please see if the dependency can be relaxed?

https://bugzilla.redhat.com/show_bug.cgi?id=2059978


python3-pytest-httpx-0:0.18.0-1.fc36.noarch
(python3.10dist(pytest) >= 6 with python3.10dist(pytest) < 7)

cc @fab again, could you please see if the dependency can be relaxed?

https://bugzilla.redhat.com/show_bug.cgi?id=2059979


python3-pytest-testmon-0:1.2.2-2.fc36.noarch
(python3.10dist(pytest) < 7~~ with python3.10dist(pytest) >= 5)

cc @radez again, could you please see if the dependency can be relaxed?

https://bugzilla.redhat.com/show_bug.cgi?id=2059980

I still see packages pinning pytest to < 7:

python-click-0:8.0.4-1.fc37.src python3dist(pytest) < 7~~

There is https://github.com/pallets/click/commit/91b2cd67dd04b2843fd6c71e582876c826f5b78e

cc @cstratak -- let's try to include that?

Done.

Around 100 packages failed to build in Copr. I've resubmitted them again without checking the reasons and also submitted them to the pytest 6 control copr.

For reference, here is the list:

ansible-core
azure-cli
cvise
elements-alexandria
fasttrack
jpype
m2crypto
oraculum
osinfo-db-tools
paternoster
patool
pew
pg_activity
pgcli
poetry
psi4
pyicu
python-aiohttp
python-animatplot
python-APScheduler
python-azure-appconfiguration
python-azure-core
python-azure-mgmt-containerinstance
python-azure-mgmt-containerregistry
python-azure-mgmt-databoxedge
python-azure-mgmt-datamigration
python-azure-mgmt-eventhub
python-azure-mgmt-loganalytics
python-azure-mgmt-maps
python-azure-mgmt-rdbms
python-azure-mgmt-recoveryservices
python-azure-mgmt-redis
python-azure-mgmt-sql
python-azure-mgmt-web
python-b4
python-behave
python-brian2
python-cartopy
python-cheroot
python-colcon-cd
python-colcon-cmake
python-colcon-core
python-colcon-coveragepy-result
python-colcon-defaults
python-colcon-devtools
python-colcon-ed
python-colcon-lcov-result
python-colcon-library-path
python-colcon-metadata
python-colcon-mixin
python-colcon-notification
python-colcon-output
python-cu2qu
python-dateutil
python-dbus-next
python-devtools
python-diff-cover
python-django-extensions
python-elephant
python-fasjson-client
python-fiat
python-glymur
python-google-cloud-testutils
python-inspyred
python-ipyparallel
python-joblib
python-language-server
python-matplotlib
python-mne
python-molten
python-netssh2
python-ntlm-auth
python-parameterized
python-promise
python-pybv
python-pygit2
python-pytest-cases
python-pytest-flake8
python-pytest-isort
python-pytest-mpi
python-pytest-postgresql
python-pytest-toolbox
python-pytest-xprocess
python-qcelemental
python-ratelimiter
python-requests_ntlm
python-respx
python-rpmautospec
python-seaborn
python-socks
python-sphinxcontrib-openapi
python-sphinxcontrib-programoutput
python-sphinx-tabs
python-sphinx-testing
python-sqlalchemy1.3
python-steps
python-trio
python-uranium
python-zeep
pythran
pyxattr
scipy
sourcextractor++
xeus

Opened 20 bugzillas for the build failures. Edited above.

I've also opened bugzillas for the pinned pytest<7 problem. Edited above.

I've built this pytest against setuptools 60.9.3 in the testing Copr and the build succeeds (nevermind the status badge): https://copr.fedorainfracloud.org/coprs/ksurma/setuptools-60/build/3635302/

Pull-Request has been merged by churchyard

2 years ago

Build succeeded.