Update to 4.6.6.

This commit is contained in:
Thomas Moschny 2019-10-25 21:40:40 +02:00
parent 6388646657
commit b346051421
3 changed files with 6 additions and 136 deletions

View File

@ -1,129 +0,0 @@
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():

View File

@ -1,15 +1,11 @@
Name: pytest
Version: 4.6.5
Release: 4%{?dist}
Version: 4.6.6
Release: 1%{?dist}
Summary: Simple powerful testing with Python
License: MIT
URL: https://pytest.org
Source0: %{pypi_source}
# 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
# that is not possible as it depends on pytest
@ -143,6 +139,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} \
%{python3_sitelib}/__pycache__/pytest.*
%changelog
* Fri Oct 25 2019 Thomas Moschny <thomas.moschny@gmx.de> - 4.6.6-1
- Update to 4.6.6.
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 4.6.5-4
- Rebuilt for Python 3.8.0rc1 (#1748018)

View File

@ -1 +1 @@
SHA512 (pytest-4.6.5.tar.gz) = e09b36ed7e862ada429b72a2090274bf5e583de749137051eb047f1e565ad65ac66a59f1ad43bfa62395019b1d41615c45b6144eada05286091455501a21608e
SHA512 (pytest-4.6.6.tar.gz) = c5b6c21c352787eadce06be7529ecb6f6fd5f5eb193ec29e5a4cfff3d7e305f50c6f07aeac15bddce007d88077a35a8f59633111815321792ed3d9fa1011b684