From 43bf3f8636a4f9739179a375a0e8225436681742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 14 Jul 2020 13:00:32 +0200 Subject: [PATCH] Initial import (#1856421) --- .gitignore | 4 +++ 41076a67.patch | 54 ++++++++++++++++++++++++++++++++++ python-iniconfig.spec | 68 +++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 127 insertions(+) create mode 100644 .gitignore create mode 100644 41076a67.patch create mode 100644 python-iniconfig.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0031ab4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/iniconfig-*.tar.gz +/iniconfig-*/ +/results_python-iniconfig/ +*.rpm diff --git a/41076a67.patch b/41076a67.patch new file mode 100644 index 0000000..71bd164 --- /dev/null +++ b/41076a67.patch @@ -0,0 +1,54 @@ +From 41076a67c333d96be14557ecbb29995f98744bd7 Mon Sep 17 00:00:00 2001 +From: Stanislav Levin +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 +--- + 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) + diff --git a/python-iniconfig.spec b/python-iniconfig.spec new file mode 100644 index 0000000..e5f4343 --- /dev/null +++ b/python-iniconfig.spec @@ -0,0 +1,68 @@ +Name: python-iniconfig +Version: 1.0.0 +Release: 1%{?dist} +Summary: Brain-dead simple parsing of ini files +License: MIT +URL: http://github.com/RonnyPfannschmidt/iniconfig +BuildArch: noarch +BuildRequires: python3-devel +BuildRequires: pyproject-rpm-macros + +Source0: %{pypi_source iniconfig} + +# Backport: Fix pytest 5+ compatibility +Patch1: %{url}/commit/41076a67.patch + +# pytest 6+ needs this and this uses pytest for tests +%bcond_without tests + +%global _description %{expand: +iniconfig is a small and simple INI-file parser module +having a unique set of features: + +* tested against Python2.4 across to Python3.2, Jython, PyPy +* maintains order of sections and entries +* supports multi-line values with or without line-continuations +* supports "#" comments everywhere +* raises errors with proper line-numbers +* no bells and whistles like automatic substitutions +* iniconfig raises an Error if two sections have the same name.} +%description %_description + + +%package -n python3-iniconfig +Summary: %{summary} +%description -n python3-iniconfig %_description + + +%prep +%autosetup -n iniconfig-%{version} + + +%generate_buildrequires +%pyproject_buildrequires %{?with_tests:-t} + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files iniconfig + + +%if %{with tests} +%check +%tox +%endif + + +%files -n python3-iniconfig -f %{pyproject_files} +%doc README.txt +%license LICENSE + + +%changelog +* Mon Jul 13 2020 Miro HronĨok - 1.0.0-1 +- Initial package (#1856421) diff --git a/sources b/sources new file mode 100644 index 0000000..4fb7ba1 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (iniconfig-1.0.0.tar.gz) = 639a4e765637110f69627fb18a5e719b6d648e5549fd857168183d97da7880434d447c9af1e254dd2aa5d0e36cbd3f5c4ffabf8a949ed3d6294002e7e1b2f6e1