#12 Update to 4.6.4, move python2-pytest to its own source package
Merged 2 months ago by churchyard. Opened 2 months ago by churchyard.
rpms/ churchyard/pytest 4.6  into  master

file removed
-23

@@ -1,23 +0,0 @@ 

- From 77526f412c46099785f567a49edbeddb6688fa60 Mon Sep 17 00:00:00 2001

- From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= <mimi.vx@gmail.com>

- Date: Thu, 4 Apr 2019 12:53:55 +0200

- Subject: [PATCH] Skip test_source_mtime_long_long on 32bit and lower platforms

- 

- ---

-  testing/test_assertrewrite.py | 3 +++

-  1 file changed, 3 insertions(+)

- 

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

- index 72bfbcc55..fb3f81770 100644

- --- a/testing/test_assertrewrite.py

- +++ b/testing/test_assertrewrite.py

- @@ -1232,6 +1232,9 @@ def test_simple_failure():

-          result.stdout.fnmatch_lines(["*E*assert (1 + 1) == 3"])

-  

-  

- +@pytest.mark.skipif(

- +    sys.maxsize <= (2 ** 31 - 1), reason="Causes OverflowError on 32bit systems"

- +)

-  @pytest.mark.parametrize("offset", [-1, +1])

-  def test_source_mtime_long_long(testdir, offset):

-      """Support modification dates after 2038 in rewritten files (#4903).

file added
+129

@@ -0,0 +1,129 @@ 

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

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

+ Date: Wed, 3 Jul 2019 01:46:44 +0200

+ Subject: [PATCH] Replace importlib_metadata with importlib.metadata on

+  Python 3.8+

+ 

+ Fixes https://github.com/pytest-dev/pytest/issues/5537

+ ---

+  changelog/5537.bugfix.rst      | 2 ++

+  setup.py                       | 2 +-

+  src/_pytest/compat.py          | 6 ++++++

+  src/_pytest/config/__init__.py | 2 +-

+  testing/acceptance_test.py     | 2 +-

+  testing/test_assertion.py      | 3 ++-

+  testing/test_config.py         | 3 +--

+  testing/test_entry_points.py   | 2 +-

+  8 files changed, 15 insertions(+), 7 deletions(-)

+  create mode 100644 changelog/5537.bugfix.rst

+ 

+ diff --git a/setup.py b/setup.py

+ index 18d3220..491a6f5 100644

+ --- a/setup.py

+ +++ b/setup.py

+ @@ -15,7 +15,7 @@ INSTALL_REQUIRES = [

+      'pathlib2>=2.2.0;python_version<"3.6"',

+      'colorama;sys_platform=="win32"',

+      "pluggy>=0.12,<1.0",

+ -    "importlib-metadata>=0.12",

+ +    'importlib-metadata>=0.12;python_version<"3.8"',

+      "wcwidth",

+  ]

+  

+ diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py

+ index df661bf..4366391 100644

+ --- a/src/_pytest/compat.py

+ +++ b/src/_pytest/compat.py

+ @@ -61,6 +61,12 @@ else:

+          return None

+  

+  

+ +if sys.version_info >= (3, 8):

+ +    from importlib import metadata as importlib_metadata  # noqa

+ +else:

+ +    import importlib_metadata  # noqa

+ +

+ +

+  def _format_args(func):

+      return str(signature(func))

+  

+ diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py

+ index 6d44bf3..b35faff 100644

+ --- a/src/_pytest/config/__init__.py

+ +++ b/src/_pytest/config/__init__.py

+ @@ -13,7 +13,6 @@ import sys

+  import types

+  import warnings

+  

+ -import importlib_metadata

+  import py

+  import six

+  from packaging.version import Version

+ @@ -31,6 +30,7 @@ from .findpaths import exists

+  from _pytest import deprecated

+  from _pytest._code import ExceptionInfo

+  from _pytest._code import filter_traceback

+ +from _pytest.compat import importlib_metadata

+  from _pytest.compat import lru_cache

+  from _pytest.compat import safe_str

+  from _pytest.outcomes import fail

+ diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py

+ index 7016cf1..2e1a3fa 100644

+ --- a/testing/acceptance_test.py

+ +++ b/testing/acceptance_test.py

+ @@ -9,11 +9,11 @@ import textwrap

+  import types

+  

+  import attr

+ -import importlib_metadata

+  import py

+  import six

+  

+  import pytest

+ +from _pytest.compat import importlib_metadata

+  from _pytest.main import EXIT_NOTESTSCOLLECTED

+  from _pytest.main import EXIT_USAGEERROR

+  from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG

+ diff --git a/testing/test_assertion.py b/testing/test_assertion.py

+ index 2085ffd..61b990a 100644

+ --- a/testing/test_assertion.py

+ +++ b/testing/test_assertion.py

+ @@ -179,7 +179,8 @@ class TestImportHookInstallation(object):

+                  return check

+              """,

+              "mainwrapper.py": """\

+ -            import pytest, importlib_metadata

+ +            import pytest

+ +            from _pytest.compat import importlib_metadata

+  

+              class DummyEntryPoint(object):

+                  name = 'spam'

+ diff --git a/testing/test_config.py b/testing/test_config.py

+ index 0678a0d..60cdbaf 100644

+ --- a/testing/test_config.py

+ +++ b/testing/test_config.py

+ @@ -6,10 +6,9 @@ from __future__ import print_function

+  import sys

+  import textwrap

+  

+ -import importlib_metadata

+ -

+  import _pytest._code

+  import pytest

+ +from _pytest.compat import importlib_metadata

+  from _pytest.config import _iter_rewritable_modules

+  from _pytest.config.exceptions import UsageError

+  from _pytest.config.findpaths import determine_setup

+ diff --git a/testing/test_entry_points.py b/testing/test_entry_points.py

+ index ad64d00..95ebc41 100644

+ --- a/testing/test_entry_points.py

+ +++ b/testing/test_entry_points.py

+ @@ -3,7 +3,7 @@ from __future__ import absolute_import

+  from __future__ import division

+  from __future__ import print_function

+  

+ -import importlib_metadata

+ +from _pytest.compat import importlib_metadata

+  

+  

+  def test_pytest_entry_points_are_identical():

file modified
+23 -74

@@ -1,15 +1,14 @@ 

- %{?python_enable_dependency_generator}

- %global pylib_version 1.5.0

- 

  Name:           pytest

- Version:        4.4.1

- Release:        2%{?dist}

+ Version:        4.6.4

+ Release:        1%{?dist}

  Summary:        Simple powerful testing with Python

  License:        MIT

  URL:            https://pytest.org

  Source0:        %{pypi_source}

- # https://github.com/pytest-dev/pytest/issues/5046

- Patch0:         5045.patch

+ 

+ # Use importlib.metadata from stdlib on Python 3.8

+ # Rebased from https://github.com/pytest-dev/pytest/pull/5539

+ Patch0:         5539.patch

  

  # The test in this specfile use pytest-timeout

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

@@ -39,32 +38,6 @@ 

  %description

  py.test provides simple, yet powerful testing for Python.

  

- %package -n python2-%{name}

- Summary:        Simple powerful testing with Python

- BuildRequires:  python2-atomicwrites

- BuildRequires:  python2-attrs

- BuildRequires:  python2-devel

- BuildRequires:  python2-funcsigs

- BuildRequires:  python2-mock

- BuildRequires:  python2-more-itertools >= 4.0.0

- BuildRequires:  python2-pathlib2 >= 2.2.0

- BuildRequires:  python2-pluggy >= 0.9

- BuildRequires:  python2-py >= %{pylib_version}

- BuildRequires:  python2-setuptools

- BuildRequires:  python2-setuptools_scm

- BuildRequires:  python2-six

- 

- %if %{with timeout}

- BuildRequires:  python2-pytest-timeout

- %endif

- 

- %{?python_provide:%python_provide python2-%{name}}

- # the python2 package was named pytest up to 2.8.7-2

- Provides:       %{name} = %{version}-%{release}

- Obsoletes:      %{name} < 2.8.7-3

- 

- %description -n python2-%{name}

- py.test provides simple, yet powerful testing for Python.

  

  %package -n python3-%{name}

  Summary:        Simple powerful testing with Python

@@ -73,11 +46,13 @@ 

  BuildRequires:  python3-devel

  BuildRequires:  python3-hypothesis

  BuildRequires:  python3-more-itertools

- BuildRequires:  python3-pluggy >= 0.9

- BuildRequires:  python3-py >= %{pylib_version}

+ BuildRequires:  python3-pluggy >= 0.12

+ BuildRequires:  python3-py >= 1.5.0

  BuildRequires:  python3-setuptools

  BuildRequires:  python3-setuptools_scm

  BuildRequires:  python3-six

+ BuildRequires:  python3-wcwidth

+ BuildRequires:  (python3-importlib-metadata if python3 < 3.8)

  

  %if %{with timeout}

  BuildRequires:  python3-pytest-timeout

@@ -92,7 +67,8 @@ 

  %endif

  

  %{?python_provide:%python_provide python3-%{name}}

- Obsoletes:      platform-python-%{name} < %{version}-%{release}

+ Provides:       pytest = %{version}-%{release}

+ Conflicts:      python2-pytest < 4.6

  

  %description -n python3-%{name}

  py.test provides simple, yet powerful testing for Python.

@@ -101,7 +77,6 @@ 

  %autosetup -p1

  

  %build

- %py2_build

  %py3_build

  

  %if %{with docs}

@@ -114,20 +89,15 @@ 

  %endif

  

  %install

- %py2_install

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

- ln -snf pytest-%{python2_version} %{buildroot}%{_bindir}/pytest-2

- mv %{buildroot}%{_bindir}/py.test %{buildroot}%{_bindir}/py.test-%{python2_version}

- ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test-2

  %py3_install

  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}

  ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/py.test-3

  

- # use 2.X per default

- ln -snf pytest-%{python2_version} %{buildroot}%{_bindir}/pytest

- ln -snf py.test-%{python2_version} %{buildroot}%{_bindir}/py.test

+ # We use 3.X per default

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

+ ln -snf py.test-%{python3_version} %{buildroot}%{_bindir}/py.test

  

  %if %{with docs}

  mkdir -p _htmldocs/html

@@ -139,21 +109,12 @@ 

  %endif

  

  # remove shebangs from all scripts

- find %{buildroot}{%{python2_sitelib},%{python3_sitelib}} \

+ find %{buildroot}%{python3_sitelib} \

       -name '*.py' \

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

  

  %check

- # Metafunc tests use python2-hypothesis, which forms a dependency

- # cycle with pytest.

- PATH=%{buildroot}%{_bindir}:${PATH} \

- PYTHONPATH=%{buildroot}%{python2_sitelib} \

-   %{buildroot}%{_bindir}/pytest-%{python2_version} -r s testing \

-   --ignore testing/python/metafunc.py \

-   %if %{with timeout}

-   --timeout=30

-   %endif

- 

+ PYTHONDONTWRITEBYTECODE=1 \

  PATH=%{buildroot}%{_bindir}:${PATH} \

  PYTHONPATH=%{buildroot}%{python3_sitelib} \

    %{buildroot}%{_bindir}/pytest-%{python3_version} -r s testing \

@@ -161,24 +122,6 @@ 

    --timeout=30

    %endif

  

- %files -n python2-%{name}

- %if %{with docs}

- %doc CHANGELOG.html

- %doc README.html

- %doc CONTRIBUTING.html

- %doc _htmldocs/html

- %endif

- %license LICENSE

- %{_bindir}/pytest

- %{_bindir}/pytest-2

- %{_bindir}/pytest-%{python2_version}

- %{_bindir}/py.test

- %{_bindir}/py.test-2

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

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

- %{python2_sitelib}/_pytest/

- %{python2_sitelib}/pytest.py*

- 

  %files -n python3-%{name}

  %if %{with docs}

  %doc CHANGELOG.html

@@ -187,8 +130,10 @@ 

  %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/

@@ -197,6 +142,10 @@ 

  %{python3_sitelib}/__pycache__/pytest.*

  

  %changelog

+ * Mon Jul 01 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.4-1

+ - Update to 4.6.4, move python2-pytest to its own source package

+ - Make /usr/bin/pytest and /usr/bin/py.test Python 3

+ 

  * Fri Jun 21 2019 Petr Viktorin <pviktori@redhat.com> - 4.4.1-2

  - Remove optional test dependencies for Python 2 entirely

  

file modified
+1 -1

@@ -1,1 +1,1 @@ 

- SHA512 (pytest-4.4.1.tar.gz) = a4bc18fe7d8db5433d4d52c0ced38d3d0e6a785710bdc772e007fb1f0f516db2267e608845e075ce4d69a5e71a5e741cc6d84b04622e0a04bd2ad3b6576a1473

+ SHA512 (pytest-4.6.4.tar.gz) = d3dd85b9b114df98bf22ffe61cdec53fbf815f0f6defc24ae804836aedd0eb1e5fd21baf1a4c3878aa75ec89514aa6b4a6d8487fe4caeefc5ce518ee1432c092

rebased onto 9376c2e

2 months ago

1 new commit added

  • Use importlib.metadata from stdlib on Python 3.8
2 months ago

1 new commit added

  • Make /usr/bin/pytest and /usr/bin/py.test Python 3
2 months ago

Pushed: Make /usr/bin/pytest and /usr/bin/py.test Python 3

+1, merge when python2-pytest is in.

The PYTEST.pyc issue might be here as well, will check before merging.

1 new commit added

  • Don't write PYTEST.pyc bytecode
2 months ago

Yes, pushed a "Don't write PYTEST.pyc bytecode" commit.

Note that I'd very much prefer an ack from the package maintainers, but this has been here sitting for ~3 weeks without response, so I'll take @pviktori's review instead.

Sorry, I'm a bit busy atm. Looks good to me.

Pull-Request has been merged by churchyard

2 months ago