From 7858a000488a87713566eb7e29d410b83f1e6196 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Thu, 20 May 2021 20:27:00 +0300 Subject: [PATCH] dev-python/pytest-black: add in preparation for new pytest-isort Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Alfred Wingate --- dev-python/pytest-black/Manifest | 1 + .../fix-pytest.tmpdir.makefile-call.patch | 49 +++++++++++++++++++ dev-python/pytest-black/metadata.xml | 11 +++++ .../pytest-black/pytest-black-0.3.12.ebuild | 32 ++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 dev-python/pytest-black/Manifest create mode 100644 dev-python/pytest-black/files/fix-pytest.tmpdir.makefile-call.patch create mode 100644 dev-python/pytest-black/metadata.xml create mode 100644 dev-python/pytest-black/pytest-black-0.3.12.ebuild diff --git a/dev-python/pytest-black/Manifest b/dev-python/pytest-black/Manifest new file mode 100644 index 0000000..3603865 --- /dev/null +++ b/dev-python/pytest-black/Manifest @@ -0,0 +1 @@ +DIST pytest-black-0.3.12.tar.gz 6898 BLAKE2B d37326527e9b3c4f755a99c71f254150b9eadc48e0dc4863af518ccf40dc97a60354402442dd979ead546a72a25398ae4d380fde5ca96afda76ae07415de95f0 SHA512 3bf6cc27a872f351ad1b49650d5b4758d14fea65627008204d2f45557c61e597def6aa6eb6f61fb439ebf783b4df997a3c4320ccbb65ee99d0dd9eaa6fde05bd diff --git a/dev-python/pytest-black/files/fix-pytest.tmpdir.makefile-call.patch b/dev-python/pytest-black/files/fix-pytest.tmpdir.makefile-call.patch new file mode 100644 index 0000000..3b59f09 --- /dev/null +++ b/dev-python/pytest-black/files/fix-pytest.tmpdir.makefile-call.patch @@ -0,0 +1,49 @@ +From 475cf71aa9de3ededa972ffb36fb47ad79278531 Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Mon, 15 Mar 2021 11:42:27 +0100 +Subject: [PATCH] fix pytest.tmpdir.makefile call + +--- + tests/test_black.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tests/test_black.py b/tests/test_black.py +index 0405169..a7a6026 100644 +--- a/tests/test_black.py ++++ b/tests/test_black.py +@@ -72,8 +72,8 @@ def test_exclude(testdir): + """Assert test is skipped if path is excluded even if also included + """ + testdir.makefile( +- "pyproject.toml", +- """ ++ ".toml", ++ pyproject = """ + [tool.black] + include = 'test_exclude.py' + exclude = '.*' +@@ -100,8 +100,8 @@ def test_exclude_folder(testdir): + """Assert test is skipped for files in a folder + """ + testdir.makefile( +- "pyproject.toml", +- """ ++ ".toml", ++ pyproject = """ + [tool.black] + exclude = ''' + ( +@@ -137,8 +137,8 @@ def test_include(testdir): + """Assert test is not skipped if path is included but not excluded + """ + testdir.makefile( +- "pyproject.toml", +- """ ++ ".toml", ++ pyproject = """ + [tool.black] + include = 'test_include' + """, +-- +2.26.3 + diff --git a/dev-python/pytest-black/metadata.xml b/dev-python/pytest-black/metadata.xml new file mode 100644 index 0000000..7a963b7 --- /dev/null +++ b/dev-python/pytest-black/metadata.xml @@ -0,0 +1,11 @@ + + + + + parona@protonmail.com + Alfred Wingate + + + shopkeep/pytest-black + + diff --git a/dev-python/pytest-black/pytest-black-0.3.12.ebuild b/dev-python/pytest-black/pytest-black-0.3.12.ebuild new file mode 100644 index 0000000..e585f84 --- /dev/null +++ b/dev-python/pytest-black/pytest-black-0.3.12.ebuild @@ -0,0 +1,32 @@ +# Copyright 2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..9} ) +inherit distutils-r1 + +DESCRIPTION="pytest plugin to enable formatting checks with black " +HOMEPAGE="https://github.com/shopkeep/pytest-black" +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/black[${PYTHON_USEDEP}] + dev-python/toml[${PYTHON_USEDEP}] +" +DEPEND="test? ( ${RDEPEND} )" + +distutils_enable_tests pytest + +DOCS=( "README.md" ) + +# Fix tests for pytest6 +# https://github.com/shopkeep/pytest-black/pull/53 +PATCHES=( "${FILESDIR}/fix-pytest.tmpdir.makefile-call.patch" )