summaryrefslogtreecommitdiff
path: root/dev-python
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/clang-python/clang-python-11.0.0.9999.ebuild40
-rw-r--r--dev-python/lit/lit-11.0.0.9999.ebuild33
-rw-r--r--dev-python/phonenumbers/phonenumbers-8.11.2.ebuild26
-rw-r--r--dev-python/pytest/pytest-5.3.3.ebuild66
-rw-r--r--dev-python/stripe/stripe-2.42.0.ebuild70
5 files changed, 235 insertions, 0 deletions
diff --git a/dev-python/clang-python/clang-python-11.0.0.9999.ebuild b/dev-python/clang-python/clang-python-11.0.0.9999.ebuild
new file mode 100644
index 000000000000..dede9129a35c
--- /dev/null
+++ b/dev-python/clang-python/clang-python-11.0.0.9999.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7} )
+inherit llvm.org python-r1
+
+DESCRIPTION="Python bindings for sys-devel/clang"
+HOMEPAGE="https://llvm.org/"
+LLVM_COMPONENTS=( clang/bindings/python )
+llvm.org_set_globals
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+# The module is opening libclang.so directly, and doing some blasphemy
+# on top of it.
+RDEPEND="
+ >=sys-devel/clang-${PV}:*
+ !sys-devel/llvm:0[clang(-),python(-)]
+ !sys-devel/clang:0[python(-)]
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}"
+
+python_test() {
+ "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
+}
+
+src_test() {
+ python_foreach_impl python_test
+}
+
+src_install() {
+ python_foreach_impl python_domodule clang
+}
diff --git a/dev-python/lit/lit-11.0.0.9999.ebuild b/dev-python/lit/lit-11.0.0.9999.ebuild
new file mode 100644
index 000000000000..4996ccd73ba8
--- /dev/null
+++ b/dev-python/lit/lit-11.0.0.9999.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{6,7} )
+inherit distutils-r1 llvm.org multiprocessing
+
+DESCRIPTION="A stand-alone install of the LLVM suite testing tool"
+HOMEPAGE="https://llvm.org/"
+LLVM_COMPONENTS=( llvm/utils/lit )
+llvm.org_set_globals
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+# Tests require 'FileCheck' and 'not' utilities (from llvm)
+BDEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ dev-python/psutil[${PYTHON_USEDEP}]
+ sys-devel/llvm )"
+
+# TODO: move the manpage generation here (from sys-devel/llvm)
+
+python_test() {
+ local -x LIT_PRESERVES_TMP=1
+ ./lit.py -j "${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}" \
+ -vv tests || die
+}
diff --git a/dev-python/phonenumbers/phonenumbers-8.11.2.ebuild b/dev-python/phonenumbers/phonenumbers-8.11.2.ebuild
new file mode 100644
index 000000000000..1677ba0426a4
--- /dev/null
+++ b/dev-python/phonenumbers/phonenumbers-8.11.2.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python port of Google's libphonenumber"
+HOMEPAGE="https://github.com/daviddrysdale/python-phonenumbers"
+SRC_URI="mirror://pypi/p/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+DOCS="README.md"
+
+python_test() {
+ esetup.py test
+}
diff --git a/dev-python/pytest/pytest-5.3.3.ebuild b/dev-python/pytest/pytest-5.3.3.ebuild
new file mode 100644
index 000000000000..1be7d663ccd2
--- /dev/null
+++ b/dev-python/pytest/pytest-5.3.3.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_USE_SETUPTOOLS=rdepend
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit distutils-r1
+
+DESCRIPTION="Simple powerful testing with Python"
+HOMEPAGE="https://pytest.org/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+# When bumping, please check setup.py for the proper py version
+PY_VER="1.5.0"
+
+# pathlib2 has been added to stdlib before py3.6, but pytest needs __fspath__
+# support, which only came in py3.6.
+RDEPEND="
+ >=dev-python/attrs-17.4.0[${PYTHON_USEDEP}]
+ dev-python/importlib_metadata[${PYTHON_USEDEP}]
+ >=dev-python/more-itertools-4.0.0[${PYTHON_USEDEP}]
+ dev-python/packaging[${PYTHON_USEDEP}]
+ >=dev-python/pluggy-0.12[${PYTHON_USEDEP}]
+ <dev-python/pluggy-1
+ >=dev-python/py-${PY_VER}[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ dev-python/wcwidth[${PYTHON_USEDEP}]
+ virtual/python-funcsigs[${PYTHON_USEDEP}]"
+
+# flake cause a number of tests to fail
+DEPEND="${RDEPEND}
+ test? (
+ >=dev-python/hypothesis-3.56[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/xmlschema[${PYTHON_USEDEP}]
+ !!dev-python/flaky
+ )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}"-4.5.0-strip-setuptools_scm.patch
+)
+
+python_prepare_all() {
+ grep -qF "py>=${PY_VER}" setup.py || die "Incorrect dev-python/py dependency"
+
+ # Something in the ebuild environment causes this to hang/error.
+ # https://bugs.gentoo.org/598442
+ rm testing/test_pdb.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ "${EPYTHON}" -m pytest -vv --lsof -rfsxX \
+ || die "tests failed with ${EPYTHON}"
+}
diff --git a/dev-python/stripe/stripe-2.42.0.ebuild b/dev-python/stripe/stripe-2.42.0.ebuild
new file mode 100644
index 000000000000..57bfa6b7a472
--- /dev/null
+++ b/dev-python/stripe/stripe-2.42.0.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7} pypy{,3} )
+inherit distutils-r1
+
+DESCRIPTION="Stripe python bindings"
+HOMEPAGE="https://github.com/stripe/stripe-python"
+SRC_URI="mirror://pypi/s/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ $(python_gen_cond_dep '>=dev-python/requests-2.20[${PYTHON_USEDEP}]' 'python3*' pypy3)
+ $(python_gen_cond_dep '>=dev-python/requests-2.20[ssl,${PYTHON_USEDEP}]' 'python2*' pypy)
+"
+# See https://github.com/stripe/stripe-python/blob/v2.10.1/tests/conftest.py#L17
+# for minimum required version of stripe-mock
+# Running the tests against dev-util/stripe-mock-0.47.0 resulted in test errors
+DEPEND="${RDEPEND}
+ test? (
+ >=dev-util/stripe-mock-0.76.0
+ dev-python/pytest[${PYTHON_USEDEP}]
+ dev-python/pytest-mock[${PYTHON_USEDEP}]
+ net-misc/curl
+ )
+"
+
+DOCS=(LONG_DESCRIPTION.rst CHANGELOG.md README.md)
+
+src_test() {
+ local stripe_mock_port=12111
+ local stripe_mock_max_port=12121
+ local stripe_mock_logfile="${T}/stripe_mock_${EPYTHON}.log"
+ # Try to start stripe-mock until we find a free port
+ while [[ "${stripe_mock_port}" -le "${stripe_mock_max_port}" ]]; do
+ ebegin "Trying to start stripe-mock on port ${stripe_mock_port}"
+ stripe-mock --http-port ${stripe_mock_port} &> "${stripe_mock_logfile}" &
+ local stripe_mock_pid=$!
+ sleep 2
+ # Did stripe-mock start?
+ curl --fail -u "sk_test_123:" \
+ http://127.0.0.1:${stripe_mock_port}/v1/customers &> /dev/null
+ eend $? "Port ${stripe_mock_port} unavailable"
+ if [[ $? -eq 0 ]]; then
+ einfo "stripe-mock running on port ${stripe_mock_port}"
+ break
+ fi
+ (( stripe_mock_port++ ))
+ done
+ if [[ "${stripe_mock_port}" -gt "${stripe_mock_max_port}" ]]; then
+ eerror "Unable to start stripe-mock for tests"
+ die "Please see the logfile located at: ${stripe_mock_logfile}"
+ fi
+
+ distutils-r1_src_test
+
+ # Tear down stripe-mock
+ kill "${stripe_mock_pid}" || die "Unable to stop stripe-mock"
+}
+
+python_test() {
+ STRIPE_MOCK_PORT=${stripe_mock_port} pytest -vv || die "Tests failed with ${EPYTHON}"
+}