#8 Update python-pluggy to 0.13.0 (#1750961)
Merged 3 days ago by churchyard. Opened 22 days ago by pkopkan.
rpms/ pkopkan/python-pluggy master  into  master

file removed
-214

@@ -1,214 +0,0 @@ 

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

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

- Date: Wed, 3 Jul 2019 00:51:04 +0200

- Subject: [PATCH 1/3] Replace importlib_metadata with importlib.metadata on

-  Python 3.8+

- 

- Fixes https://github.com/pytest-dev/pluggy/issues/222

- ---

-  changelog/222.trivial.rst     |  2 ++

-  docs/conf.py                  |  9 +++++++--

-  setup.py                      |  2 +-

-  src/pluggy/manager.py         |  8 ++++++--

-  testing/test_pluginmanager.py | 10 ++++++++--

-  5 files changed, 24 insertions(+), 7 deletions(-)

-  create mode 100644 changelog/222.trivial.rst

- 

- diff --git a/changelog/222.trivial.rst b/changelog/222.trivial.rst

- new file mode 100644

- index 0000000..0263e8c

- --- /dev/null

- +++ b/changelog/222.trivial.rst

- @@ -0,0 +1,2 @@

- +Replace ``importlib_metadata`` backport with ``importlib.metadata`` from the

- +standard library on Python 3.8+.

- diff --git a/docs/conf.py b/docs/conf.py

- index 550071d..0346563 100644

- --- a/docs/conf.py

- +++ b/docs/conf.py

- @@ -1,5 +1,10 @@

-  # -*- coding: utf-8 -*-

- -import importlib_metadata

- +import sys

- +

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

- +    from importlib import metadata

- +else:

- +    import importlib_metadata as metadata

-  

-  

-  extensions = [

- @@ -24,7 +29,7 @@

-  copyright = u"2016, Holger Krekel"

-  author = "Holger Krekel"

-  

- -release = importlib_metadata.version(project)

- +release = metadata.version(project)

-  # The short X.Y version.

-  version = u".".join(release.split(".")[:2])

-  

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

- index 0f26fa0..ae2cd84 100644

- --- a/setup.py

- +++ b/setup.py

- @@ -37,7 +37,7 @@ def main():

-          author_email="holger@merlinux.eu",

-          url="https://github.com/pytest-dev/pluggy",

-          python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",

- -        install_requires=["importlib-metadata>=0.12"],

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

-          extras_require={"dev": ["pre-commit", "tox"]},

-          classifiers=classifiers,

-          packages=["pluggy"],

- diff --git a/src/pluggy/manager.py b/src/pluggy/manager.py

- index 27c86f6..6aecb2a 100644

- --- a/src/pluggy/manager.py

- +++ b/src/pluggy/manager.py

- @@ -1,9 +1,13 @@

-  import inspect

- +import sys

-  from . import _tracing

-  from .hooks import HookImpl, _HookRelay, _HookCaller, normalize_hookimpl_opts

-  import warnings

-  

- -import importlib_metadata

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

- +    from importlib import metadata

- +else:

- +    import importlib_metadata as metadata

-  

-  

-  def _warn_for_function(warning, function):

- @@ -279,7 +283,7 @@ def load_setuptools_entrypoints(self, group, name=None):

-          :return: return the number of loaded plugins by this call.

-          """

-          count = 0

- -        for dist in importlib_metadata.distributions():

- +        for dist in metadata.distributions():

-              for ep in dist.entry_points:

-                  if (

-                      ep.group != group

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

- index b226c41..693280c 100644

- --- a/testing/test_pluginmanager.py

- +++ b/testing/test_pluginmanager.py

- @@ -2,8 +2,9 @@

-  ``PluginManager`` unit and public API testing.

-  """

-  import pytest

- +import sys

-  import types

- -import importlib_metadata

- +

-  from pluggy import (

-      PluginManager,

-      PluginValidationError,

- @@ -12,6 +13,11 @@

-      HookspecMarker,

-  )

-  

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

- +    from importlib import metadata

- +else:

- +    import importlib_metadata as metadata

- +

-  

-  hookspec = HookspecMarker("example")

-  hookimpl = HookimplMarker("example")

- @@ -466,7 +472,7 @@ class Distribution(object):

-      def my_distributions():

-          return (dist,)

-  

- -    monkeypatch.setattr(importlib_metadata, "distributions", my_distributions)

- +    monkeypatch.setattr(metadata, "distributions", my_distributions)

-      num = pm.load_setuptools_entrypoints("hello")

-      assert num == 1

-      plugin = pm.get_plugin("myname")

- 

- From 763b661fc15c04f85bcf6b501280641b88041d0a Mon Sep 17 00:00:00 2001

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

- Date: Wed, 3 Jul 2019 01:02:41 +0200

- Subject: [PATCH 2/3] Workaround

-  https://github.com/pytest-dev/pytest/issues/5523

- 

- ---

-  tox.ini | 2 +-

-  1 file changed, 1 insertion(+), 1 deletion(-)

- 

- diff --git a/tox.ini b/tox.ini

- index 431aceb..eb917aa 100644

- --- a/tox.ini

- +++ b/tox.ini

- @@ -38,7 +38,7 @@ commands =

-  minversion=2.0

-  testpaths = testing

-  #--pyargs --doctest-modules --ignore=.tox

- -addopts=-ra

- +addopts=-r a

-  filterwarnings =

-    error

-  

- 

- From 1bf30d695d13c656015eaf0b29d9445d3788da68 Mon Sep 17 00:00:00 2001

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

- Date: Wed, 3 Jul 2019 01:09:26 +0200

- Subject: [PATCH 3/3] Update tests matrix to reflect recent changes in pytest

- 

- No Python 3.8 on AppVeyor yet.

- ---

-  .travis.yml  | 8 ++++----

-  appveyor.yml | 3 +--

-  tox.ini      | 2 +-

-  3 files changed, 6 insertions(+), 7 deletions(-)

- 

- diff --git a/.travis.yml b/.travis.yml

- index 994146d..d72f517 100644

- --- a/.travis.yml

- +++ b/.travis.yml

- @@ -32,16 +32,16 @@ jobs:

-        env: TOXENV=py37-pytestrelease-coverage

-      - python: '3.8-dev'

-        env: TOXENV=py38-pytestrelease-coverage

- -    - python: '2.7'

- -      env: TOXENV=py27-pytestmaster-coverage

- -    - python: '2.7'

- -      env: TOXENV=py27-pytestfeatures-coverage

-      - python: '3.6'

-        env: TOXENV=py36-pytestmaster-coverage

-      - python: '3.6'

-        env: TOXENV=py36-pytestfeatures-coverage

-      - python: '3.6'

-        env: TOXENV=benchmark

- +    - python: '3.7'

- +      env: TOXENV=py37-pytestmaster-coverage

- +    - python: '3.7'

- +      env: TOXENV=py37-pytestfeatures-coverage

-  

-      - stage: deploy

-        python: '3.6'

- diff --git a/appveyor.yml b/appveyor.yml

- index 8d1a57d..560151c 100644

- --- a/appveyor.yml

- +++ b/appveyor.yml

- @@ -7,9 +7,8 @@ environment:

-    - TOXENV: "py34-pytestrelease"

-    - TOXENV: "py35-pytestrelease"

-    - TOXENV: "py36-pytestrelease"

- +  - TOXENV: "py37-pytestrelease"

-    - TOXENV: "pypy-pytestrelease"

- -  - TOXENV: "py27-pytestmaster"

- -  - TOXENV: "py27-pytestfeatures"

-    - TOXENV: "py36-pytestmaster"

-    - TOXENV: "py36-pytestfeatures"

-  

- diff --git a/tox.ini b/tox.ini

- index eb917aa..ebcd004 100644

- --- a/tox.ini

- +++ b/tox.ini

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

-  [tox]

- -envlist=linting,docs,py{27,34,35,36,py,py3}-pytestrelease,py{27,36}-pytest{master,features}

- +envlist=linting,docs,py{27,34,35,36,37,38,py,py3}-pytestrelease,py{36,37}-pytest{master,features}

-  

-  [testenv]

-  commands=

file modified
+9 -5

@@ -4,16 +4,14 @@ 

  %bcond_without tests

  

  Name:           python-pluggy

- Version:        0.12.0

- Release:        5%{?dist}

+ Version:        0.13.0

+ Release:        1%{?dist}

  Summary:        The plugin manager stripped of pytest specific details

  

  License:        MIT

  URL:            https://github.com/pytest-dev/pluggy

  Source0:        %{pypi_source}

  

- # Use importlib.metadata from stdlib on Python 3.8

- Patch0:         %{url}/pull/223.patch

  

  BuildArch:      noarch

  

@@ -22,8 +20,11 @@ 

  BuildRequires:  python3-setuptools_scm

  %if %{with tests}

  BuildRequires:  python3-pytest

+ # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1756902

+ %if 0%{?fedora} <= 31

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

  %endif

+ %endif

  

  %global _description\

  The plugin manager stripped of pytest specific details.

@@ -51,7 +52,7 @@ 

  %if %{with tests}

  %check

  # TODO investigate test_load_setuptools_instantiation failure

- PYTHONPATH=$PWD %{__python3} -m pytest testing -k "not test_load_setuptools_instantiation"

+ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest testing -k "not test_load_setuptools_instantiation"

  %endif

  

  

@@ -63,6 +64,9 @@ 

  

  

  %changelog

+ * Mon Nov 18 2019 Patrik Kopkan <pkopkan@redhat.com> - 0.13.0-1

+ - Update to 0.13.0 (#1750961)

+ 

  * Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.12.0-5

  - Rebuilt for Python 3.8.0rc1 (#1748018)

  

file modified
+1 -1

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

- SHA512 (pluggy-0.12.0.tar.gz) = a3a64caefc797334b73b0614e467613b99909037a62dcbfbb0cf917788ee8d12af4f43d7c371634ac6eb6f32a5aa08e51aa8179e70b5998d4d055cd7f535129f

+ SHA512 (pluggy-0.13.0.tar.gz) = 82cf7d8aa4a0e09f8ba5048cd7ce038f34ca1453fe0c5a7926a2113e64528d0861955f8544035b4ffd61f0227e3d30d8d4180a05bf80e0de4809546e990bd4c7

no initial comment

Thank you for your patch. The build fails due to

No matching package to install: '(python3-importlib-metadata if python3 < 3.8)'
DEBUG util.py:593:  Not all dependencies satisfied
DEBUG util.py:593:  Error: Some packages could not be found.
DEBUG util.py:741:  Child return code was: 1

rebased onto 9956445

20 days ago

rebased onto 56d8de9

20 days ago
No matching package to install: '(python3-importlib-metadata if python3 < 3.8)'

this is a known dnf-stack bug and unfortunately, it needs to be workarounded the way @pkopkan did it. not sure about the comment there. if you want a bug to link to, try https://bugzilla.redhat.com/show_bug.cgi?id=1756902

That bug is ON_QA. @mrunge, does it work for you, if you upgrade to the updates-testing versions of the dnf packages?

rebased onto 0f267b5

12 days ago

referenced the bug in comment, thanks Miro.

0%{?fedora} <= 31 is true on RHEL. you may either acknowledge it and drop the rhel part, or workaround ti by a crazy (0%{?fedora} && 0%{?fedora} <= 31 )

Thanks again for your work here.

@churchyard if you're satisfied with the patch, please don't hesitate to merge it.

I will when I do. The %if conditional is however wrong.

rebased onto c498cfc

4 days ago

there should be no slash between %{buildroot} and %{python3_sitelib}

rebased onto bcbedd1

4 days ago

Looks good. Testing if pytest builds.

Metadata Update from @churchyard:
- Request assigned

3 days ago

pytest builds, so does pluggy with updated pluggy.

Pull-Request has been merged by churchyard

3 days ago

@mrunge Do you mind adding @python-sig as comaintainers?

I don't mind, I just did. Thank you for the reminder.