summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <patrick.mclean@sony.com>2020-06-02 15:15:19 -0700
committerPatrick McLean <chutzpah@gentoo.org>2020-06-02 15:15:27 -0700
commit17e0e5f755f73bbd8dfa1bc3a4b70b3f7dd03495 (patch)
tree3b7f39c13bc1b39bf7e15617294403d7bf720b0e /dev-python/black
parentprofiles/package.mask: mask net-news/rawdog (diff)
downloadgentoo-17e0e5f755f73bbd8dfa1bc3a4b70b3f7dd03495.tar.gz
gentoo-17e0e5f755f73bbd8dfa1bc3a4b70b3f7dd03495.tar.bz2
gentoo-17e0e5f755f73bbd8dfa1bc3a4b70b3f7dd03495.zip
dev-python/black: New package
Copyright: Sony Interactive Entertainment Inc. Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-python/black')
-rw-r--r--dev-python/black/Manifest1
-rw-r--r--dev-python/black/black-19.10_beta0.ebuild63
-rw-r--r--dev-python/black/files/black-19.10_beta0-setuptools_scm.patch24
-rw-r--r--dev-python/black/metadata.xml8
4 files changed, 96 insertions, 0 deletions
diff --git a/dev-python/black/Manifest b/dev-python/black/Manifest
new file mode 100644
index 000000000000..c2901bc64e19
--- /dev/null
+++ b/dev-python/black/Manifest
@@ -0,0 +1 @@
+DIST black-19.10b0.tar.gz 1008099 BLAKE2B e8a6e286e7a60f880f8b5d37a2b07278faeb4efffd15feb511764e449c36b4e54d5ac5b910f583a15948a2f92eb5e61ae210073be7a57251b2b01e69d2e5b373 SHA512 778909c26afa65548a77524451b50a2692a7b4e297fa52fc80567f7fea94dd5aae9e61cf0f1de718c28a733f1813c8e2c6974ab58e6b0e891de331bb4f245968
diff --git a/dev-python/black/black-19.10_beta0.ebuild b/dev-python/black/black-19.10_beta0.ebuild
new file mode 100644
index 000000000000..5db71277f7f9
--- /dev/null
+++ b/dev-python/black/black-19.10_beta0.ebuild
@@ -0,0 +1,63 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+inherit eutils distutils-r1
+
+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="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND="
+ dev-python/click[${PYTHON_USEDEP}]
+ dev-python/attrs[${PYTHON_USEDEP}]
+ dev-python/appdirs[${PYTHON_USEDEP}]
+ dev-python/toml[${PYTHON_USEDEP}]
+ dev-python/typed-ast[${PYTHON_USEDEP}]
+ dev-python/regex[${PYTHON_USEDEP}]
+ dev-python/pathspec[${PYTHON_USEDEP}]
+"
+BDEPEND="${RDEPEND}
+ test? (
+ dev-python/aiohttp[${PYTHON_USEDEP}]
+ dev-python/aiohttp-cors[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/black-19.10_beta0-setuptools_scm.patch"
+)
+
+distutils_enable_tests unittest
+
+python_prepare_all() {
+ local version_path
+ version_path="$(grep '"write_to"' setup.py | \
+ sed -r 's|[[:space:]]+"write_to": "([[:graph:]]+)",|\1|' \
+ || die "could not find path to write version to")"
+
+ [[ -e ${version_path} ]] && die "could not find path to write version to"
+ printf 'version = "%s"\n' "${MY_PV}" > "${version_path}" || die "error writing version"
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ "${EPYTHON}" tests/test_black.py -v || die "tests failed with ${EPYTHON}"
+}
+
+pkg_postinst() {
+ optfeature "blackd - HTTP API for black" dev-python/aiohttp dev-python/aiohttp-cors
+}
diff --git a/dev-python/black/files/black-19.10_beta0-setuptools_scm.patch b/dev-python/black/files/black-19.10_beta0-setuptools_scm.patch
new file mode 100644
index 000000000000..21f996480386
--- /dev/null
+++ b/dev-python/black/files/black-19.10_beta0-setuptools_scm.patch
@@ -0,0 +1,24 @@
+diff --git a/setup.py b/setup.py
+index 614a8d6..66946b2 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1,6 +1,7 @@
+ # Copyright (C) 2018 Łukasz Langa
+ from setuptools import setup
+ import sys
++import os
+
+ assert sys.version_info >= (3, 6, 0), "black requires Python 3.6+"
+ from pathlib import Path # noqa E402
+@@ -17,10 +18,7 @@ def get_long_description() -> str:
+
+ setup(
+ name="black",
+- use_scm_version={
+- "write_to": "_black_version.py",
+- "write_to_template": 'version = "{version}"\n',
+- },
++ version=os.getenv("MY_PV"),
+ description="The uncompromising code formatter.",
+ long_description=get_long_description(),
+ long_description_content_type="text/markdown",
diff --git a/dev-python/black/metadata.xml b/dev-python/black/metadata.xml
new file mode 100644
index 000000000000..56cae167d372
--- /dev/null
+++ b/dev-python/black/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>chutzpah@gentoo.org</email>
+ <name>Patrick McLean</name>
+ </maintainer>
+</pkgmetadata>