summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-07-30 08:30:01 +0200
committerMichał Górny <mgorny@gentoo.org>2020-07-30 16:30:54 +0200
commit4efca2579ada33cc1cefc39327cab5a485a4a228 (patch)
tree992967187850596e6c3099b84c40dfea9dd8edaa
parentsys-libs/libcap-ng: Put python dep into BDEPEND (diff)
downloadgentoo-4efca2579ada33cc1cefc39327cab5a485a4a228.tar.gz
gentoo-4efca2579ada33cc1cefc39327cab5a485a4a228.tar.bz2
gentoo-4efca2579ada33cc1cefc39327cab5a485a4a228.zip
dev-python/iniconfig: New dep of dev-python/pytest
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--dev-python/iniconfig/Manifest1
-rw-r--r--dev-python/iniconfig/files/iniconfig-1.0.0-pytest-5.patch57
-rw-r--r--dev-python/iniconfig/iniconfig-1.0.0.ebuild25
-rw-r--r--dev-python/iniconfig/metadata.xml7
4 files changed, 90 insertions, 0 deletions
diff --git a/dev-python/iniconfig/Manifest b/dev-python/iniconfig/Manifest
new file mode 100644
index 00000000000..83d9ec04a49
--- /dev/null
+++ b/dev-python/iniconfig/Manifest
@@ -0,0 +1 @@
+DIST iniconfig-1.0.0.tar.gz 7807 BLAKE2B a77c4d8c6f549db911110505ac5a367be5175adbb580211d4aded14d1108e189fd6d6a229ac4e0e742baafa9b037d58c2bbc810897c8b274c07493c518ef752e SHA512 639a4e765637110f69627fb18a5e719b6d648e5549fd857168183d97da7880434d447c9af1e254dd2aa5d0e36cbd3f5c4ffabf8a949ed3d6294002e7e1b2f6e1
diff --git a/dev-python/iniconfig/files/iniconfig-1.0.0-pytest-5.patch b/dev-python/iniconfig/files/iniconfig-1.0.0-pytest-5.patch
new file mode 100644
index 00000000000..f8fca367b34
--- /dev/null
+++ b/dev-python/iniconfig/files/iniconfig-1.0.0-pytest-5.patch
@@ -0,0 +1,57 @@
+From da205253f0d78204900ec82b6cb2cb0afd9f1254 Mon Sep 17 00:00:00 2001
+From: Stanislav Levin <slev@altlinux.org>
+Date: Thu, 8 Aug 2019 19:43:12 +0300
+Subject: [PATCH] Fix Pytest 5 errors
+
+This fixes
+"""
+pytest.PytestDeprecationWarning: raises(..., 'code(as_a_string)')
+is deprecated, use the context manager form or use `exec()` directly.
+"""
+
+Fixes: https://github.com/RonnyPfannschmidt/iniconfig/issues/6
+Signed-off-by: Stanislav Levin <slev@altlinux.org>
+---
+ test_iniconfig.py | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/test_iniconfig.py b/test_iniconfig.py
+index 27fd53f..fe12421 100644
+--- a/test_iniconfig.py
++++ b/test_iniconfig.py
+@@ -150,27 +150,25 @@ def test_iniconfig_from_file(tmpdir):
+ assert list(config.sections) == ['metadata']
+ config = IniConfig(path, "[diff]")
+ assert list(config.sections) == ['diff']
+- py.test.raises(TypeError, "IniConfig(data=path.read())")
++ with pytest.raises(TypeError):
++ IniConfig(data=path.read())
+
+
+ def test_iniconfig_section_first(tmpdir):
+- excinfo = py.test.raises(ParseError, """
++ with pytest.raises(ParseError) as excinfo:
+ IniConfig("x", data='name=1')
+- """)
+ assert excinfo.value.msg == "no section header defined"
+
+
+ def test_iniconig_section_duplicate_fails():
+- excinfo = py.test.raises(ParseError, r"""
++ with pytest.raises(ParseError) as excinfo:
+ IniConfig("x", data='[section]\n[section]')
+- """)
+ assert 'duplicate section' in str(excinfo.value)
+
+
+ def test_iniconfig_duplicate_key_fails():
+- excinfo = py.test.raises(ParseError, r"""
++ with pytest.raises(ParseError) as excinfo:
+ IniConfig("x", data='[section]\nname = Alice\nname = bob')
+- """)
+
+ assert 'duplicate name' in str(excinfo.value)
+
+--
+2.28.0
+
diff --git a/dev-python/iniconfig/iniconfig-1.0.0.ebuild b/dev-python/iniconfig/iniconfig-1.0.0.ebuild
new file mode 100644
index 00000000000..52b493fe771
--- /dev/null
+++ b/dev-python/iniconfig/iniconfig-1.0.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} pypy3 )
+inherit distutils-r1
+
+DESCRIPTION="Brain-dead simple config-ini parsing"
+HOMEPAGE="
+ https://github.com/RonnyPfannschmidt/iniconfig
+ "
+SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+BDEPEND="dev-python/setuptools_scm[${PYTHON_USEDEP}]"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/${P}-pytest-5.patch
+)
diff --git a/dev-python/iniconfig/metadata.xml b/dev-python/iniconfig/metadata.xml
new file mode 100644
index 00000000000..266e3f19ca5
--- /dev/null
+++ b/dev-python/iniconfig/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>