diff options
Diffstat (limited to 'dev-python/ini2toml')
-rw-r--r-- | dev-python/ini2toml/Manifest | 4 | ||||
-rw-r--r-- | dev-python/ini2toml/files/ini2toml-0.10-test.patch | 39 | ||||
-rw-r--r-- | dev-python/ini2toml/ini2toml-0.10.ebuild | 68 | ||||
-rw-r--r-- | dev-python/ini2toml/metadata.xml | 12 |
4 files changed, 123 insertions, 0 deletions
diff --git a/dev-python/ini2toml/Manifest b/dev-python/ini2toml/Manifest new file mode 100644 index 000000000000..dfc04af6a83d --- /dev/null +++ b/dev-python/ini2toml/Manifest @@ -0,0 +1,4 @@ +AUX ini2toml-0.10-test.patch 1883 BLAKE2B 88402feed5aa7e51587f7297b8c3afa058d04e0f878acf1a6af5dfab77cb50d0c5708cfe9e1a45d704f7fbaca068cf9f3d0838bdcb6e1aa3145129f6239180c9 SHA512 1df613aa1e793716e4b0e7a83b3f15bb69f7abd5c43831e0d09dd4ec42ee8ed617586188bfb9bfc6863f93f4cdeb0114226e9da44c8b3a73b04705f7c9139c87 +DIST ini2toml-0.10.gh.tar.gz 93535 BLAKE2B 8d8a5b31c53b9194e578b473dfd562b1b569d701b36b267ec4f59ea75ec03abd6e1df5541327b9414a2f1c04b1cb41ec57c6f900007f69a3c51a172143d2eacd SHA512 3d88f97c50a13fe3878e3fa35d70c9051874bec99d278411dcc7098d86898deb0e490be26f293e9a304d4c9a2842274e68126a2d20dac77b526161fde682dd75 +EBUILD ini2toml-0.10.ebuild 1694 BLAKE2B e2393f284853fb5577642854c77ec5f45224a40095e468b7c2d09893d4775d37473aa903e50dba701946897f97273c8a10dd96804e0702418e310ab31beb7f65 SHA512 9f08476fe9e7f5ed3cb22a2c2e4e4f4e46c1374fbb983f345e2030c7be18c737ac6e185dc995a46b429b93873c8f11dfb93926c93ef3253a9195e6d126078adb +MISC metadata.xml 373 BLAKE2B 589d20ff2e2db3152d2d107842ed6627f4fabfaaa0a5ee2981fd8cb23429caf40cf1b8894bbb720a9ed83e690623acd3d7f7bdb1be5e45328dfe0627b6125389 SHA512 6f99f7a92a6095308ed4c9817418c11b8f9017d15017908af7c42962b4a3591768415239df700fccd7a46d5c3b0e03538fef43f8858bbbbc5a87b2c1bfaffced diff --git a/dev-python/ini2toml/files/ini2toml-0.10-test.patch b/dev-python/ini2toml/files/ini2toml-0.10-test.patch new file mode 100644 index 000000000000..bd1d8b093a33 --- /dev/null +++ b/dev-python/ini2toml/files/ini2toml-0.10-test.patch @@ -0,0 +1,39 @@ +From 1a40d273d6671657ef10081123a675bd22e4bf06 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sat, 2 Apr 2022 18:21:39 +0200 +Subject: [PATCH] Support duplicate plugin instances in + test_list_from_entry_points +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Account for the possibility of the isort plugin occurring more than +once in the plugin list, in test_list_from_entry_points. This is needed +to avoid test failures on Gentoo where tests are run in a venv +with --system-site-packages. As a result, if ini2toml is installed +already, it grabs all plugins twice — once from the venv, and then again +from system site-packages directory. +--- + AUTHORS.rst | 1 + + tests/test_plugins.py | 3 ++- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/test_plugins.py b/tests/test_plugins.py +index a1e96eb..9b52432 100644 +--- a/tests/test_plugins.py ++++ b/tests/test_plugins.py +@@ -46,6 +46,7 @@ def test_list_from_entry_points(): + # Should return a list with all the plugins registered in the entrypoints + pluging_list = plugins.list_from_entry_points() + orig_len = len(pluging_list) ++ isort_count = len([e for e in pluging_list if "isort" in str(e.__module__)]) + assert all(callable(e) for e in pluging_list) + plugin_names = " ".join(str(e.__module__) for e in pluging_list) + for example in EXISTING: +@@ -54,5 +55,5 @@ def test_list_from_entry_points(): + # a filtering function can be passed to avoid loading plugins that are not needed + pluging_list = plugins.list_from_entry_points(filtering=lambda e: e.name != "isort") + plugin_names = " ".join(str(e.__module__) for e in pluging_list) +- assert len(pluging_list) == orig_len - 1 ++ assert len(pluging_list) == orig_len - isort_count + assert "isort" not in plugin_names diff --git a/dev-python/ini2toml/ini2toml-0.10.ebuild b/dev-python/ini2toml/ini2toml-0.10.ebuild new file mode 100644 index 000000000000..d855885d7eef --- /dev/null +++ b/dev-python/ini2toml/ini2toml-0.10.ebuild @@ -0,0 +1,68 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( pypy3 python3_{8..10} ) + +inherit distutils-r1 + +DESCRIPTION="Automatically conversion of .ini/.cfg files to TOML equivalents" +HOMEPAGE=" + https://pypi.org/project/ini2toml/ + https://github.com/abravalheri/ini2toml/ +" +SRC_URI=" + https://github.com/abravalheri/ini2toml/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="MPL-2.0" +SLOT="0" +KEYWORDS="~amd64 ~m68k ~riscv ~x86" + +RDEPEND=" + >=dev-python/packaging-20.7[${PYTHON_USEDEP}] + >=dev-python/tomli-w-0.4.0[${PYTHON_USEDEP}] +" +BDEPEND=" + dev-python/setuptools_scm[${PYTHON_USEDEP}] + test? ( + dev-python/tomli[${PYTHON_USEDEP}] + dev-python/tomlkit[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +export SETUPTOOLS_SCM_PRETEND_VERSION=${PV} + +PATCHES=( + "${FILESDIR}"/${P}-test.patch +) + +EPYTEST_DESELECT=( + # pyproject_fmt is not packaged + tests/test_cli.py::test_auto_formatting + + # fails on whitespace/comments/formatting + tests/test_translator.py::test_simple_example + tests/test_translator.py::test_parser_opts + tests/plugins/test_setuptools_pep621.py::test_move_entry_points_and_apply_value_processing + tests/plugins/test_setuptools_pep621.py::test_split_subtables + tests/plugins/test_setuptools_pep621.py::test_entrypoints_and_split_subtables + tests/plugins/test_setuptools_pep621.py::test_handle_dynamic +) + +EPYTEST_IGNORE=( + # configupdater is not packaged + tests/test_examples.py + tests/test_transformations.py + tests/drivers/test_configupdater.py +) + +src_prepare() { + sed -i -e 's:--cov ini2toml --cov-report term-missing::' setup.cfg || die + distutils-r1_src_prepare +} diff --git a/dev-python/ini2toml/metadata.xml b/dev-python/ini2toml/metadata.xml new file mode 100644 index 000000000000..23719e79daa5 --- /dev/null +++ b/dev-python/ini2toml/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>python@gentoo.org</email> + </maintainer> + <stabilize-allarches/> + <upstream> + <remote-id type="github">abravalheri/ini2toml</remote-id> + <remote-id type="pypi">ini2toml</remote-id> + </upstream> +</pkgmetadata> |