summaryrefslogtreecommitdiff
path: root/dev-python/black
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/black')
-rw-r--r--dev-python/black/Manifest4
-rw-r--r--dev-python/black/black-21.12_beta0-r1.ebuild68
-rw-r--r--dev-python/black/black-22.1.0.ebuild49
-rw-r--r--dev-python/black/files/black-21.12_beta0-support-tomli-2.patch40
4 files changed, 161 insertions, 0 deletions
diff --git a/dev-python/black/Manifest b/dev-python/black/Manifest
index 18bb23aa99d7..59da0acd1c73 100644
--- a/dev-python/black/Manifest
+++ b/dev-python/black/Manifest
@@ -1,3 +1,7 @@
+AUX black-21.12_beta0-support-tomli-2.patch 1530 BLAKE2B 2b378a2da1e067b6e2a562556423f1359122934bf946468bda1eeb556064eff9de59837d5375df5bea846175ff32e6ed3a98e86ffd485f07c2e947c2d9b1d069 SHA512 d8302a9febff804e9ee81820c00c6caa3c975349244f22136a086428dc47c259b969caafd83983cfaa1d26b13c0d42bd38c2df477b9c574e545ef36915668c0c
DIST black-21.12b0.tar.gz 1200305 BLAKE2B cd019b230d2ba1fab88075a5e14cb5de88a4ee283b53d869564f071a104d2810ca31c04db09310b99a1610bdace7d5b9b360b2a3a4810822322a4eacc8998ad8 SHA512 1f6e4eeafd653fa9db608585110f5c5067942031b2d67e630befa899d7fca3c35f52cbde8fc91c2697fb294fb16525254756ebce16e556fc139b621f738bfa22
+DIST black-22.1.0.tar.gz 1161720 BLAKE2B d74cbdd39dc1576583cee57089cb6d75a338f2d6640697adda79d38d02eeb51664049dca934d5014761d0fd4080ca2f40a3ea10c30e40bde9fe6af6c178b202c SHA512 9b97a3b32ecebebeb61ea581784a9b2215540c20533097fe87d5ef3c046dbe7c2ab8f2f21d1884cbe0ddd458434f17eb9b540764f955385873e6fdef86c3014c
+EBUILD black-21.12_beta0-r1.ebuild 1894 BLAKE2B 6278e056192e31f7d33dd36376a99d27b784f24cade88ff1d2541119b41a5c24bf319dca23e8715c9c7832d06a5508312db21d161f5f9ad4cd65a3844c25dc6e SHA512 0559b0af6326b87e1a92a584bc9f5fb04b4e6d89e16e4ac414c067cba6de1659752acd6bac52b93f8893fb217d15274e4b03da1cb1c276c9ac828247ceebf181
EBUILD black-21.12_beta0.ebuild 1777 BLAKE2B 6f64f48c7d337f39a790be15b04c46f2a1ba45af539d6f232a5c0d48418c0252109a835b751789b5cdfae0afc5d70773a447617788e2457fbf1d2e256718f853 SHA512 1f5153e4261789c001956d1a6e87840471223ba04ab5d92c2e578b1eadf31db97b3ccde64b4b6a6f635d39dd07e83d2bac7f96441451e17eb592c148a08ebec6
+EBUILD black-22.1.0.ebuild 1405 BLAKE2B 5cbf25ec2dbc4086e9e9e2c6d6424fba5a1f49d02bb5d17dadbe445c7f4704662b086fd699ae1751f70892fcdd2f967f5a1f8c038071323e98dde9d00ba70695 SHA512 c8f6099d124775c4cdb16a477bbac82c6f6d3a784155908a761ee6defb393e60ba2e955484e4f1a884ff452d781a9ac8970e031139b17f3392158bfff6cd192b
MISC metadata.xml 397 BLAKE2B 505ed4127741ef8d2fd77c36e6ad2d6168dca8ae5570cf7606a557fad29393c0dd78fe2eb1fe990d9d69abec19fb65d563481160b0bf0a914997b114e73f7c66 SHA512 357189214d3cc2a026b8c29ee5c695a62d73db229ca1f71372bfc5a1120317a4c4ffac942f5a196f20e84ae8988a4e707d4194ebde12ef7c96eb713b398f587c
diff --git a/dev-python/black/black-21.12_beta0-r1.ebuild b/dev-python/black/black-21.12_beta0-r1.ebuild
new file mode 100644
index 000000000000..240e64169926
--- /dev/null
+++ b/dev-python/black/black-21.12_beta0-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_USE_PEP517=setuptools
+inherit distutils-r1 optfeature
+
+MY_PV="${PV//_beta/b}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="The uncompromising Python code formatter"
+HOMEPAGE="https://black.readthedocs.io/en/stable/ https://github.com/psf/black"
+SRC_URI="https://github.com/psf/${PN}/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
+
+RDEPEND="
+ >=dev-python/click-8.0.0[${PYTHON_USEDEP}]
+ >=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
+ >=dev-python/platformdirs-2[${PYTHON_USEDEP}]
+ <dev-python/pathspec-1[${PYTHON_USEDEP}]
+ <dev-python/tomli-3[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/typing-extensions[${PYTHON_USEDEP}]
+ ' python3_{8,9})
+"
+BDEPEND="
+ dev-python/setuptools_scm[${PYTHON_USEDEP}]
+ dev-python/toml[${PYTHON_USEDEP}]
+ test? (
+ >=dev-python/aiohttp-3.7.4[${PYTHON_USEDEP}]
+ dev-python/aiohttp-cors[${PYTHON_USEDEP}]
+ dev-python/colorama[${PYTHON_USEDEP}]
+ dev-python/parameterized[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ # Merged in master
+ "${FILESDIR}/${P}-support-tomli-2.patch"
+)
+
+distutils_enable_tests pytest
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${MY_PV}
+
+src_prepare() {
+ # remove unnecessary bind that worked around broken 6.1.0/6.2.0 releases
+ sed -i -e '/setuptools_scm/s:~=:>=:' \
+ -e 's/setuptools_scm\[toml\]>=[0-9.]*/setuptools_scm[toml]/' setup.cfg || die
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ cp "${S}"/src/black_primer/primer.json \
+ "${BUILD_DIR}"/lib/black_primer/primer.json || die
+ distutils_install_for_testing
+ epytest -m "not python2"
+}
+
+pkg_postinst() {
+ optfeature "blackd - HTTP API for black" "dev-python/aiohttp dev-python/aiohttp-cors"
+}
diff --git a/dev-python/black/black-22.1.0.ebuild b/dev-python/black/black-22.1.0.ebuild
new file mode 100644
index 000000000000..40f9911a807b
--- /dev/null
+++ b/dev-python/black/black-22.1.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit distutils-r1 optfeature
+
+MY_PV="${PV//_beta/b}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="The uncompromising Python code formatter"
+HOMEPAGE="https://black.readthedocs.io/en/stable/ https://github.com/psf/black"
+SRC_URI="https://github.com/psf/${PN}/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
+
+RDEPEND="
+ >=dev-python/click-8.0.0[${PYTHON_USEDEP}]
+ >=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
+ >=dev-python/platformdirs-2[${PYTHON_USEDEP}]
+ >=dev-python/pathspec-0.9.0[${PYTHON_USEDEP}]
+ >=dev-python/tomli-1.1.0[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ >=dev-python/typing-extensions-3.10.0.0[${PYTHON_USEDEP}]
+ ' python3_{8..9})
+"
+BDEPEND="
+ >=dev-python/setuptools_scm-6.3.1[${PYTHON_USEDEP}]
+ test? (
+ >=dev-python/aiohttp-3.7.4[${PYTHON_USEDEP}]
+ dev-python/aiohttp-cors[${PYTHON_USEDEP}]
+ dev-python/colorama[${PYTHON_USEDEP}]
+ dev-python/parameterized[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${MY_PV}
+
+pkg_postinst() {
+ optfeature "blackd - HTTP API for black" "dev-python/aiohttp dev-python/aiohttp-cors"
+}
diff --git a/dev-python/black/files/black-21.12_beta0-support-tomli-2.patch b/dev-python/black/files/black-21.12_beta0-support-tomli-2.patch
new file mode 100644
index 000000000000..5374dc6e82a9
--- /dev/null
+++ b/dev-python/black/files/black-21.12_beta0-support-tomli-2.patch
@@ -0,0 +1,40 @@
+From 389e9c23a9e622ee6090d902cc5f56c5f76cdee9 Mon Sep 17 00:00:00 2001
+From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com>
+Date: Tue, 21 Dec 2021 18:03:07 +0200
+Subject: [PATCH] Disable universal newlines when reading TOML (#2408)
+
+--- a/Pipfile
++++ b/Pipfile
+@@ -42,7 +42,7 @@ platformdirs= ">=2"
+ click = ">=8.0.0"
+ mypy_extensions = ">=0.4.3"
+ pathspec = ">=0.8.1"
+-tomli = ">=0.2.6, <2.0.0"
++tomli = ">=1.1.0, <3.0.0"
+ typed-ast = "==1.4.3"
+ typing_extensions = {markers = "python_version < '3.10'", version = ">=3.10.0.0"}
+ black = {editable = true,extras = ["d"],path = "."}
+--- a/setup.py
++++ b/setup.py
+@@ -99,7 +99,7 @@ def find_python_files(base: Path) -> List[Path]:
+ install_requires=[
+ "click>=7.1.2",
+ "platformdirs>=2",
+- "tomli>=0.2.6,<2.0.0",
++ "tomli>=1.1.0,<3.0.0",
+ "typed-ast>=1.4.2; python_version < '3.8' and implementation_name == 'cpython'",
+ "pathspec>=0.9.0, <1",
+ "dataclasses>=0.6; python_version < '3.7'",
+--- a/src/black/files.py
++++ b/src/black/files.py
+@@ -95,8 +95,8 @@ def parse_pyproject_toml(path_config: str) -> Dict[str, Any]:
+
+ If parsing fails, will raise a tomli.TOMLDecodeError
+ """
+- with open(path_config, encoding="utf8") as f:
+- pyproject_toml = tomli.loads(f.read())
++ with open(path_config, "rb") as f:
++ pyproject_toml = tomli.load(f)
+ config = pyproject_toml.get("tool", {}).get("black", {})
+ return {k.replace("--", "").replace("-", "_"): v for k, v in config.items()}
+