summaryrefslogtreecommitdiff
path: root/dev-python/pydocstyle
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-14 19:44:42 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-14 19:44:42 +0100
commit4392d53af7ce45ccfe6eb14146479ef0e2bd790a (patch)
tree505de6d6499defff572e53779c70f5fac1118499 /dev-python/pydocstyle
parent926f46a6d07cdbc78d625b2dfca6a3c27a95b14a (diff)
gentoo auto-resync : 14:10:2022 - 19:44:42
Diffstat (limited to 'dev-python/pydocstyle')
-rw-r--r--dev-python/pydocstyle/Manifest3
-rw-r--r--dev-python/pydocstyle/files/pydocstyle-6.1.1-tomli.patch90
-rw-r--r--dev-python/pydocstyle/pydocstyle-6.1.1-r2.ebuild (renamed from dev-python/pydocstyle/pydocstyle-6.1.1-r1.ebuild)5
3 files changed, 96 insertions, 2 deletions
diff --git a/dev-python/pydocstyle/Manifest b/dev-python/pydocstyle/Manifest
index 4edf24c1d7f3..f29b416b480d 100644
--- a/dev-python/pydocstyle/Manifest
+++ b/dev-python/pydocstyle/Manifest
@@ -1,4 +1,5 @@
AUX pydocstyle-6.1.1-disarm-pip-install.patch 1001 BLAKE2B d82d9b358cdd6b517cf64f5b620e767342ba6230ebda715e039be2b5bdbef639ad5d0e715f033658887bede3ee330da79f2a6ca3e1a597466f3bbffdd617d371 SHA512 434a576cad8fe6a2c8086893982887306ad6b4797c1ed0c3682782a3a9ec1109fc48d94ad469cd11128232d773d5beaef2cfc1c9a68c0386581e4864d43371fa
+AUX pydocstyle-6.1.1-tomli.patch 2889 BLAKE2B 9e246941b41b19ee463f50e76075f3cdbc47ce48af6e6678e22826c5e184629a7fe6532540f7088174cebce4dfd97099e79eb9e106ef342af3814cf6d72a1755 SHA512 2e34de862def3f56e88e5feb0dfb1fc8f634f72c7796735c55d8830245a3dff1b95f5199d99299b87a680c8debaf5e7e1ced934a1bc07122d2faff1df54601ae
DIST pydocstyle-6.1.1.tar.gz 73982 BLAKE2B 6a896221fdcd257f0475472e1cf87ef892d8292a4c0faf661595adb17e2d18f4a8277cda498197309d34597c448203856c272256277a7e35fba20e2e5ba47f2b SHA512 ce4932a6601c80d05a46600f5af7df54798025a5f3dc41ab8cf1bc0d63e7f78b70cccb17dc99ddab25eda9abd639f91468fca1b1ceb4539708350212e481a156
-EBUILD pydocstyle-6.1.1-r1.ebuild 907 BLAKE2B 57f32b8f5e4ec34f8bda21894780e698a054bdc5550e8adadc7acdcb36d7ac95ee369214b0d2c5900242e8d61bfae7b44de3840b8a59338ebe86df27b891751c SHA512 0073f98c21a90b393de547bb7116041fd20d04eeeb0246059a14dad6ebfa17718acfdc7d895083b772f53df3f79b3fdaf19d76a48acd0df295d66bc5b48b3e34
+EBUILD pydocstyle-6.1.1-r2.ebuild 982 BLAKE2B bc5778cfc802aad80bd9bdf123e46e16ebf9dc9e8db929fef7ff0de6f2568d0ff9c404c5dfac57ddd9f48af94eadd9a439dae28caabec0261a5ae4df6f73567d SHA512 fc42be5ad6943b9c17c1d28284009d8e2e27a1cc9e4a59e2bc235175543b80be6dab817baff6b08a90c1ac2fbbd1d94592cbe7362ec83685c5042e644320892b
MISC metadata.xml 665 BLAKE2B ac358d1ac5d68d11710048ccd4050f45cee96788829ee806bc5f4364c0f6b03707dcf15dd0cb9e7e3870cd9feebcead3c44b8f6bbff6738aa593079685c2a3c0 SHA512 7642d1384de3ec4bd55f7afc69ce67ad018eb9294f104234c5f3eb23a2c7a5ab36bda890a440fb5a7af8045d215048caf4b15bb3d965f414b755b51a269337cc
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
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
)