summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-10-14 13:14:58 +0200
committerMichał Górny <mgorny@gentoo.org>2022-10-14 13:14:58 +0200
commit69078e4e931ff888b20e74ad4c9ed3cb2d57cd5a (patch)
treeaa3c8aa18ca1058b32590cef3e9debb8e66fc21b /dev-python/autopep8
parentpackage.deprecated: Add dev-python/toml (diff)
downloadgentoo-69078e4e931ff888b20e74ad4c9ed3cb2d57cd5a.tar.gz
gentoo-69078e4e931ff888b20e74ad4c9ed3cb2d57cd5a.tar.bz2
gentoo-69078e4e931ff888b20e74ad4c9ed3cb2d57cd5a.zip
dev-python/autopep8: Use tomli instead of toml
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/autopep8')
-rw-r--r--dev-python/autopep8/autopep8-1.7.0-r1.ebuild (renamed from dev-python/autopep8/autopep8-1.7.0.ebuild)4
-rw-r--r--dev-python/autopep8/autopep8-9999.ebuild3
-rw-r--r--dev-python/autopep8/files/autopep8-1.7.0-tomli.patch57
3 files changed, 62 insertions, 2 deletions
diff --git a/dev-python/autopep8/autopep8-1.7.0.ebuild b/dev-python/autopep8/autopep8-1.7.0-r1.ebuild
index 31163b3a63e5..58d653e49809 100644
--- a/dev-python/autopep8/autopep8-1.7.0.ebuild
+++ b/dev-python/autopep8/autopep8-1.7.0-r1.ebuild
@@ -23,7 +23,8 @@ SLOT="0"
RDEPEND="
>=dev-python/pycodestyle-2.9.1[${PYTHON_USEDEP}]
- dev-python/toml[${PYTHON_USEDEP}]"
+ dev-python/tomli[${PYTHON_USEDEP}]
+"
distutils_enable_tests pytest
@@ -34,4 +35,5 @@ EPYTEST_DESELECT=(
PATCHES=(
"${FILESDIR}"/autopep8-1.6.0-lib2to3-deprecation-pytest.patch
+ "${FILESDIR}"/${P}-tomli.patch
)
diff --git a/dev-python/autopep8/autopep8-9999.ebuild b/dev-python/autopep8/autopep8-9999.ebuild
index 91c5dbfceeba..bb50e6c643bd 100644
--- a/dev-python/autopep8/autopep8-9999.ebuild
+++ b/dev-python/autopep8/autopep8-9999.ebuild
@@ -24,6 +24,7 @@ SLOT="0"
RDEPEND="
>=dev-python/pycodestyle-2.8.0[${PYTHON_USEDEP}]
- dev-python/toml[${PYTHON_USEDEP}]"
+ dev-python/tomli[${PYTHON_USEDEP}]
+"
distutils_enable_tests unittest
diff --git a/dev-python/autopep8/files/autopep8-1.7.0-tomli.patch b/dev-python/autopep8/files/autopep8-1.7.0-tomli.patch
new file mode 100644
index 000000000000..6a8dd147d474
--- /dev/null
+++ b/dev-python/autopep8/files/autopep8-1.7.0-tomli.patch
@@ -0,0 +1,57 @@
+From d0836947df66a052a1d18925a64feb0374598f02 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 6 Apr 2022 18:30:11 +0200
+Subject: [PATCH] Use tomli in place of unmaintained toml package
+
+Use the modern `tomli` TOML parser instead of `toml`. The latter
+package is no longer maintained and does not support TOML 1.0.
+---
+ autopep8.py | 10 +++++-----
+ setup.py | 2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/autopep8.py b/autopep8.py
+index d856f711..ab1a88ac 100755
+--- a/autopep8.py
++++ b/autopep8.py
+@@ -4040,13 +4040,13 @@ def read_config(args, parser):
+
+ def read_pyproject_toml(args, parser):
+ """Read pyproject.toml and load configuration."""
+- import toml
++ import tomli
+
+ config = None
+
+ if os.path.exists(args.global_config):
+- with open(args.global_config) as fp:
+- config = toml.load(fp)
++ with open(args.global_config, "rb") as fp:
++ config = tomli.load(fp)
+
+ if not args.ignore_local_config:
+ parent = tail = args.files and os.path.abspath(
+@@ -4054,8 +4054,8 @@ def read_pyproject_toml(args, parser):
+ while tail:
+ pyproject_toml = os.path.join(parent, "pyproject.toml")
+ if os.path.exists(pyproject_toml):
+- with open(pyproject_toml) as fp:
+- config = toml.load(fp)
++ with open(pyproject_toml, "rb") as fp:
++ config = tomli.load(fp)
+ break
+ (parent, tail) = os.path.split(parent)
+
+diff --git a/setup.py b/setup.py
+index caa639bf..4849574a 100755
+--- a/setup.py
++++ b/setup.py
+@@ -10,7 +10,7 @@
+
+
+ INSTALL_REQUIRES = (
+- ['pycodestyle >= 2.9.1', 'toml']
++ ['pycodestyle >= 2.9.1', 'tomli']
+ )
+
+