public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pydocstyle/, dev-python/pydocstyle/files/
@ 2021-05-18  8:51 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2021-05-18  8:51 UTC (permalink / raw
  To: gentoo-commits

commit:     51ebc9362e5e9e3a8c5647a43d1a925c2a364e4c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 18 07:44:08 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 18 08:48:28 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51ebc936

dev-python/pydocstyle: Bump to 6.1.1

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pydocstyle/Manifest                     |  1 +
 .../pydocstyle-6.1.1-disarm-pip-install.patch      | 31 ++++++++++++++++++++++
 dev-python/pydocstyle/pydocstyle-6.1.1.ebuild      | 27 +++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/dev-python/pydocstyle/Manifest b/dev-python/pydocstyle/Manifest
index 809dedd258d..4192487cbf2 100644
--- a/dev-python/pydocstyle/Manifest
+++ b/dev-python/pydocstyle/Manifest
@@ -1 +1,2 @@
 DIST pydocstyle-6.0.0.tar.gz 72143 BLAKE2B 1036a5eab38a38bda0f98371f7e4094248cf5057a9afd8743a478f153a5f06feab6b3e7d6be031615b5e88c388786f59a0619f774f492e40a722f39973051d5b SHA512 609a10307aa24513f476ef639771fc095fe7a65ffd8d530fad02886369c62969c69a5134fd0ec79a1e07d1b6cb8f920c3478db546c26aefb0e45771777c02a0b
+DIST pydocstyle-6.1.1.tar.gz 73982 BLAKE2B 6a896221fdcd257f0475472e1cf87ef892d8292a4c0faf661595adb17e2d18f4a8277cda498197309d34597c448203856c272256277a7e35fba20e2e5ba47f2b SHA512 ce4932a6601c80d05a46600f5af7df54798025a5f3dc41ab8cf1bc0d63e7f78b70cccb17dc99ddab25eda9abd639f91468fca1b1ceb4539708350212e481a156

diff --git a/dev-python/pydocstyle/files/pydocstyle-6.1.1-disarm-pip-install.patch b/dev-python/pydocstyle/files/pydocstyle-6.1.1-disarm-pip-install.patch
new file mode 100644
index 00000000000..b0467a13643
--- /dev/null
+++ b/dev-python/pydocstyle/files/pydocstyle-6.1.1-disarm-pip-install.patch
@@ -0,0 +1,31 @@
+From 46947c9dca95caeb7b1f4348994d1aa2b8db93ec Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 18 May 2021 10:02:16 +0200
+Subject: [PATCH] Disarm install_package fixture
+
+---
+ src/tests/test_integration.py | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/src/tests/test_integration.py b/src/tests/test_integration.py
+index eb4994f..4242476 100644
+--- a/src/tests/test_integration.py
++++ b/src/tests/test_integration.py
+@@ -128,14 +128,7 @@ def install_package(request):
+     This is so we can run the integration tests on the installed console
+     script.
+     """
+-    cwd = os.path.join(os.path.dirname(__file__), '..', '..')
+-    subprocess.check_call(
+-        [sys.executable, "-m", "pip", "install", "-e", "."], cwd=cwd
+-    )
+     yield
+-    subprocess.check_call(
+-        [sys.executable, "-m", "pip", "uninstall", "-y", "pydocstyle"], cwd=cwd
+-    )
+ 
+ 
+ @pytest.yield_fixture(scope="function", params=['ini', 'toml'])
+-- 
+2.31.1
+

diff --git a/dev-python/pydocstyle/pydocstyle-6.1.1.ebuild b/dev-python/pydocstyle/pydocstyle-6.1.1.ebuild
new file mode 100644
index 00000000000..f97c88a48af
--- /dev/null
+++ b/dev-python/pydocstyle/pydocstyle-6.1.1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( pypy3 python3_{7..10} )
+inherit distutils-r1
+
+DESCRIPTION="Python docstring style checker"
+HOMEPAGE="https://github.com/PyCQA/pydocstyle/"
+SRC_URI="https://github.com/PyCQA/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x64-macos"
+
+RDEPEND="dev-python/snowballstemmer[${PYTHON_USEDEP}]"
+BDEPEND="
+	test? ( dev-python/toml[${PYTHON_USEDEP}] )"
+
+distutils_enable_tests --install pytest
+# Requires network to lookup github issues
+#distutils_enable_sphinx docs dev-python/sphinx_rtd_theme dev-python/sphinxcontrib-issuetracker
+
+PATCHES=(
+	"${FILESDIR}"/pydocstyle-6.1.1-disarm-pip-install.patch
+)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/pydocstyle/, dev-python/pydocstyle/files/
@ 2022-10-14 12:05 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2022-10-14 12:05 UTC (permalink / raw
  To: gentoo-commits

commit:     3c882c7e1cf750038f7a8a59c37a3a2ab627cd9d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 14 12:04:47 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Oct 14 12:05:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c882c7e

dev-python/pydocstyle: Use tomli/tomllib instead of toml

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../pydocstyle/files/pydocstyle-6.1.1-tomli.patch  | 90 ++++++++++++++++++++++
 ...-6.1.1-r1.ebuild => pydocstyle-6.1.1-r2.ebuild} |  5 +-
 2 files changed, 94 insertions(+), 1 deletion(-)

diff --git a/dev-python/pydocstyle/files/pydocstyle-6.1.1-tomli.patch b/dev-python/pydocstyle/files/pydocstyle-6.1.1-tomli.patch
new file mode 100644
index 000000000000..8be2adca5ba1
--- /dev/null
+++ b/dev-python/pydocstyle/files/pydocstyle-6.1.1-tomli.patch
@@ -0,0 +1,90 @@
+From 4c9ed77d3629a69febdaa14d153d3db869b58e4f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 12 Oct 2022 16:37:40 +0200
+Subject: [PATCH] Use tomllib/tomli for reading .toml configs
+
+Use the built-in `tomllib` module in Python 3.11 and the modern `tomli`
+package in older Python versions to read .toml configs instead of
+the unmaintained and broken `toml` package.
+
+Fixes #599
+Fixes #600
+---
+ docs/release_notes.rst   |  1 +
+ requirements/runtime.txt |  2 +-
+ requirements/tests.txt   |  1 -
+ setup.py                 |  2 +-
+ src/pydocstyle/config.py | 20 ++++++++++++--------
+ 5 files changed, 15 insertions(+), 11 deletions(-)
+
+diff --git a/requirements/runtime.txt b/requirements/runtime.txt
+index 80302751..b4e9ca76 100644
+--- a/requirements/runtime.txt
++++ b/requirements/runtime.txt
+@@ -1,2 +1,2 @@
+ snowballstemmer==1.2.1
+-toml==0.10.2
++tomli==2.0.1; python_version < "3.11"
+diff --git a/setup.py b/setup.py
+index a9c5df1c..6c0671c7 100644
+--- a/setup.py
++++ b/setup.py
+@@ -8,7 +8,7 @@
+     'snowballstemmer',
+ ]
+ extra_requirements = {
+-    'toml': ['toml'],
++    'toml': ['tomli; python_version < "3.11"'],
+ }
+ 
+ 
+diff --git a/src/pydocstyle/config.py b/src/pydocstyle/config.py
+index ed00c874..db7ed1b6 100644
+--- a/src/pydocstyle/config.py
++++ b/src/pydocstyle/config.py
+@@ -4,6 +4,7 @@
+ import itertools
+ import operator
+ import os
++import sys
+ from collections import namedtuple
+ from collections.abc import Set
+ from configparser import NoOptionError, NoSectionError, RawConfigParser
+@@ -13,10 +14,13 @@
+ from .utils import __version__, log
+ from .violations import ErrorRegistry, conventions
+ 
+-try:
+-    import toml
+-except ImportError:  # pragma: no cover
+-    toml = None  # type: ignore
++if sys.version_info >= (3, 11):
++    import tomllib
++else:
++    try:
++        import tomli as tomllib
++    except ImportError:  # pragma: no cover
++        tomllib = None  # type: ignore
+ 
+ 
+ def check_initialized(method):
+@@ -59,15 +63,15 @@ def read(self, filenames, encoding=None):
+         read_ok = []
+         for filename in filenames:
+             try:
+-                with open(filename, encoding=encoding) as fp:
+-                    if not toml:
++                with open(filename, "rb") as fp:
++                    if not tomllib:
+                         log.warning(
+                             "The %s configuration file was ignored, "
+-                            "because the `toml` package is not installed.",
++                            "because the `tomli` package is not installed.",
+                             filename,
+                         )
+                         continue
+-                    self._config.update(toml.load(fp))
++                    self._config.update(tomllib.load(fp))
+             except OSError:
+                 continue
+             if isinstance(filename, os.PathLike):

diff --git a/dev-python/pydocstyle/pydocstyle-6.1.1-r1.ebuild b/dev-python/pydocstyle/pydocstyle-6.1.1-r2.ebuild
similarity index 88%
rename from dev-python/pydocstyle/pydocstyle-6.1.1-r1.ebuild
rename to dev-python/pydocstyle/pydocstyle-6.1.1-r2.ebuild
index e3d4a9f3dd1b..2c8dc81111c3 100644
--- a/dev-python/pydocstyle/pydocstyle-6.1.1-r1.ebuild
+++ b/dev-python/pydocstyle/pydocstyle-6.1.1-r2.ebuild
@@ -27,7 +27,9 @@ RDEPEND="
 "
 BDEPEND="
 	test? (
-		dev-python/toml[${PYTHON_USEDEP}]
+		$(python_gen_cond_dep '
+			dev-python/tomli[${PYTHON_USEDEP}]
+		' 3.{8..10})
 	)
 "
 
@@ -37,4 +39,5 @@ distutils_enable_tests pytest
 
 PATCHES=(
 	"${FILESDIR}"/pydocstyle-6.1.1-disarm-pip-install.patch
+	"${FILESDIR}"/${P}-tomli.patch
 )


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-14 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-18  8:51 [gentoo-commits] repo/gentoo:master commit in: dev-python/pydocstyle/, dev-python/pydocstyle/files/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2022-10-14 12:05 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox