diff options
Diffstat (limited to 'dev-python/pipenv')
7 files changed, 344 insertions, 178 deletions
diff --git a/dev-python/pipenv/Manifest b/dev-python/pipenv/Manifest index dc09b089d5e2..e289cdae75f5 100644 --- a/dev-python/pipenv/Manifest +++ b/dev-python/pipenv/Manifest @@ -1,9 +1,10 @@ AUX pipenv-2021-11-9-remove-attr-vendor-import.patch 628 BLAKE2B 2f94b5d3a45cf4cf8eb01e8f73e920c21c6487357cfcab34d8ab13d4ff77f803c5b1da6ac737cf595a23c536bb07f4cd321ca38aa57bdb266a5c066c2227c7b6 SHA512 81be2f0a8eed43da73ee1dab43e7597702e6f01c539381a80ab1cf75aa9285a26d269cf3f36417184a4e2e2499ea2799bcfeb8bdb61bdfa145b2baf253405676 AUX pipenv-2021-11-9-remove-colorama-vendor-import.patch 2310 BLAKE2B 8cb032ab0d1018f0ce047ef5cfdb6ab729a227f569d6e513dd7a8c9ac0548fbc5f6db6b59e33c03095684d918a34879f8163f6e3a0213a0a4ef009bb423687ed SHA512 e692c0b544639fc820c647e3c267b58cf5669a16ec3a7ee89dbee93036a2add027b41c39edad6b62aa4273f332678dea302e35896868fee7fb28ad105a963790 -AUX pipenv-2021-5-29-r2-remove-attr-vendor-import.patch 3064 BLAKE2B a292df872da96e643545dc3c0b8c27d40466f6b4fb76d0c19316021e103ab6ee3b4e18861f286fee96a004e4f8c1fb3889bd7285f790d31b7f81e49579ab13f1 SHA512 4301b2302648dea77809c3afda896f0f38e4fcde503a9810f8c1706e35b553bee8fc3bc803ff958b0afb0cde0b764854647416efadccab3541f284f3efde15ab -AUX pipenv-2021-5-29-r2-remove-colorama-vendor-import.patch 506 BLAKE2B 30447546cbf87a99d7914340708ef7cb8c60247957f0ee41b2cead21a476e7b9a8238661376d39fc60569478571b365f19c27b489511f744f8387f24f51319fc SHA512 57eee158b006f44a8676bc870f940a1b98a95eee2c50c1ce127d99add129b8bc02a2e4cd98f49912629c376c9119b3234d8bf418b19452ae9c8c4080f4d53682 +AUX pipenv-2022-1-8-remove-first-vendor-import.patch 4988 BLAKE2B 4550cac73864b93b874be208f625fd3ecf825d7e5675cb61c1c151f0ac3af4790c0a797784296fceaef09c031d374c1a3c7e20a36c5f5ede5cbd634866fb7c13 SHA512 857de77a5a885c530f6a9f8b42aa65b38c5b703183cf4f4a6637c1e2afda2a560abf79364395baf60082e9f5622ce0131aef8600303030a26ea185aedd3653fc +DIST pipenv-2021.11.23.tar.gz 11378116 BLAKE2B aa30c86aa3b20333d0bffc8c49761869cc9e86b69920abe5e58a0aa7ccf35a8faf6b8b29ce408c85239624a999ca4e67f4a687e1e9aa15271bea31a135acdb7d SHA512 3873a3e7de33677b63bb133e397f46030ec28a24479b38009a4c409d93277327e8f53694fa56fdb8120f9cd632e849fde6f4205e29d9f5704c8844101e8e8298 DIST pipenv-2021.11.9.tar.gz 11652360 BLAKE2B ab7d733e0c44a8551d2b786680646f5efa9effdc6b6a74fc0b8286336c84b9795229036cc8b7179a4ee3d6c91701d82fdd2e8303c7c9a9da1e06eb78fb2a0214 SHA512 6ad44fe70d3e3f5bbdedb891c76ad1c37863e6f4215c34f2ef6aa1a35b89fb6262f8c55f7f2e71544e550d66d20567f12ce4698f9e3a899853aa49a0849c3189 -DIST pipenv-2021.5.29.tar.gz 11607230 BLAKE2B 8eef8e79fbdfaf85a949437d06d9f8b48f7eaa6e4769f6d4ed90b01c0ebf70c282fc90581cce5ffcab0aeb6bc9ad770a8b4425f355a06e0fc4cd56fb221386e2 SHA512 4fa018c13d4babe856bf5671cf5d18a95f4af4b6d4fc64c4919825fe04004ed3d8979ca335b851c6e24dad081475f6fb5b925eeff58c6fb5cffc450b967ed1cd +DIST pipenv-2022.1.8.tar.gz 11379235 BLAKE2B b73df14688ebe6d0c6153c64c2f3cd5106f184466061177cebfac120fc49af403a5d27919a8ff0e5a40e04a9950ab9949938c1d4c8d0c1a4df98440a3a2a2ae0 SHA512 9bad380548723172eddbbb9ebfc35a46effbd8eeeff47ad347d0ab5ae9f52e20de8dfc205dab6fb8ae8763edc488cf867a64ed443895242feb444d1bc0d9b8e0 +EBUILD pipenv-2021.11.23.ebuild 2551 BLAKE2B 3633bd637db21a8830b388f1438d9531ffa2cf99fd43a1664ea9bdf9a555c695e29c84701d7b2241bdeafeb0ae449d8f709f1fd2a40ec137a97af8a7739e7be8 SHA512 03e32c60df6889d5d710d96fd84dbef61723c938337c8cd5684402517e90160b75a4aa14462c2a1cff22c8e9af0ca783e5d5894aeb3966bac697f2c102300a4c EBUILD pipenv-2021.11.9.ebuild 1793 BLAKE2B e17672eacd26f09bd912adeb2fc5995cd28899a2e7f7e04b94d6af12a4468a1248897c1ce587a2f88c36d002de74d90447a0fcf9713398f36dc36d6965e077ba SHA512 e07d6ab4da4c1868cb412cf8987b23490c70665b3d71b4b603ff45fff812d66967cd91dac21333497eba9edc77a2516c2839eecb78707a6c7725ca6838fc1ba2 -EBUILD pipenv-2021.5.29-r2.ebuild 1680 BLAKE2B d510881c66e8b17e057b1cec72721f603e36c95ed63599ced8456db1aa9b425869aaec34f827b8db1573e00f0c4aca168010749883c7605e034af3a6f4ad70cc SHA512 e65004e4a88165179b4c48acd59c2f4870dbd79809b7d31d82e23e62d0c498e0cf51a9fcc770872a21b1521ce3c2345d7d8163de97e57ce096b3816444c61aab +EBUILD pipenv-2022.1.8.ebuild 3133 BLAKE2B bfa7572b1c005fba1982d69ce7728705c74b1afcdcb771fd61da5b1069774a6febf189b8b7e45355beed656092b8571465a54dc6f5fbd2951793bc22cc8ee73c SHA512 6f5c816b6c5f8ae6bc9be7bfa9f5c49a6ce773b9515b367a7f6cc9162b25e7c0af928e8931213a63a82696d7c19967faaeafe947489b921a27fb9916829cc7eb MISC metadata.xml 643 BLAKE2B ff3557d9ae32b553c85455436683e2ca94bc16c6ec7c6d2ceb1113a69dc841b9ac2f0e4b96eec4c6c84ca899ad6a99b0747d7bf3f9289110a8bbdfb80f2cb2eb SHA512 7a611950572c2d700fb1680e0aa307069d80d992528144da781eca9f1fee729defa6f8b28382ddd8f66e58c5f68de9a17815989a4a39473bbf830a7be42ea282 diff --git a/dev-python/pipenv/files/pipenv-2021-5-29-r2-remove-attr-vendor-import.patch b/dev-python/pipenv/files/pipenv-2021-5-29-r2-remove-attr-vendor-import.patch deleted file mode 100644 index 3437c2a2f33f..000000000000 --- a/dev-python/pipenv/files/pipenv-2021-5-29-r2-remove-attr-vendor-import.patch +++ /dev/null @@ -1,95 +0,0 @@ -diff --git a/pipenv/installers.py b/pipenv/installers.py -index 1e81047d..ccfd639c 100644 ---- a/pipenv/installers.py -+++ b/pipenv/installers.py -@@ -6,8 +6,11 @@ from abc import ABCMeta, abstractmethod - - - from .environments import PIPENV_INSTALL_TIMEOUT --from .vendor import attr, delegator - from .utils import find_windows_executable -+# future version of pipenv drops this -+# hence, this stays here for a while -+from .vendor import delegator -+import attr - - - @attr.s -diff --git a/pipenv/vendor/passa/models/projects.py b/pipenv/vendor/passa/models/projects.py -index c7807c05..f6e037d6 100644 ---- a/pipenv/vendor/passa/models/projects.py -+++ b/pipenv/vendor/passa/models/projects.py -@@ -6,7 +6,7 @@ import collections - import io - import os - --from pipenv.vendor import attr -+import attr - import packaging.markers - import packaging.utils - import plette -diff --git a/pipenv/vendor/pythonfinder/models/mixins.py b/pipenv/vendor/pythonfinder/models/mixins.py -index aeba0443..76327115 100644 ---- a/pipenv/vendor/pythonfinder/models/mixins.py -+++ b/pipenv/vendor/pythonfinder/models/mixins.py -@@ -5,7 +5,7 @@ import abc - import operator - from collections import defaultdict - --from pipenv.vendor import attr -+import attr - import six - - from ..compat import fs_str -diff --git a/pipenv/vendor/pythonfinder/models/path.py b/pipenv/vendor/pythonfinder/models/path.py -index e8c13429..7a197181 100644 ---- a/pipenv/vendor/pythonfinder/models/path.py -+++ b/pipenv/vendor/pythonfinder/models/path.py -@@ -7,7 +7,7 @@ import sys - from collections import defaultdict - from itertools import chain - --from pipenv.vendor import attr -+import attr - import six - from cached_property import cached_property - from ..compat import Path, fs_str -diff --git a/pipenv/vendor/pythonfinder/models/python.py b/pipenv/vendor/pythonfinder/models/python.py -index 4f7e5563..d001a1e5 100644 ---- a/pipenv/vendor/pythonfinder/models/python.py -+++ b/pipenv/vendor/pythonfinder/models/python.py -@@ -7,7 +7,7 @@ import platform - import sys - from collections import defaultdict - --from pipenv.vendor import attr -+import attr - import six - from packaging.version import Version - -diff --git a/pipenv/vendor/pythonfinder/models/windows.py b/pipenv/vendor/pythonfinder/models/windows.py -index c69b9484..fb36a272 100644 ---- a/pipenv/vendor/pythonfinder/models/windows.py -+++ b/pipenv/vendor/pythonfinder/models/windows.py -@@ -4,7 +4,7 @@ from __future__ import absolute_import, print_function - import operator - from collections import defaultdict - --from pipenv.vendor import attr -+import attr - - from ..environment import MYPY_RUNNING - from ..exceptions import InvalidPythonVersion -diff --git a/pipenv/vendor/pythonfinder/utils.py b/pipenv/vendor/pythonfinder/utils.py -index bcea7f3e..41d2d59a 100644 ---- a/pipenv/vendor/pythonfinder/utils.py -+++ b/pipenv/vendor/pythonfinder/utils.py -@@ -10,7 +10,7 @@ from collections import OrderedDict - from fnmatch import fnmatch - from threading import Timer - --from pipenv.vendor import attr -+import attr - import six - from packaging.version import LegacyVersion, Version - diff --git a/dev-python/pipenv/files/pipenv-2021-5-29-r2-remove-colorama-vendor-import.patch b/dev-python/pipenv/files/pipenv-2021-5-29-r2-remove-colorama-vendor-import.patch deleted file mode 100644 index 5c50788d0320..000000000000 --- a/dev-python/pipenv/files/pipenv-2021-5-29-r2-remove-colorama-vendor-import.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/pipenv/patched/crayons.py b/pipenv/patched/crayons.py -index d7644a21..19b0d695 100644 ---- a/pipenv/patched/crayons.py -+++ b/pipenv/patched/crayons.py -@@ -13,7 +13,7 @@ import re - import sys - - from pipenv.vendor import shellingham --from pipenv.vendor import colorama -+import colorama - - PY3 = sys.version_info[0] >= 3 - -Submodule tests/pypi f5530013..1881ecb4 (rewind): - < Update setuptools version - < Add sha256 checksum files - < Update url reference - < Add pep 508 subdirectory fixtures diff --git a/dev-python/pipenv/files/pipenv-2022-1-8-remove-first-vendor-import.patch b/dev-python/pipenv/files/pipenv-2022-1-8-remove-first-vendor-import.patch new file mode 100644 index 000000000000..a8ff7d107f9c --- /dev/null +++ b/dev-python/pipenv/files/pipenv-2022-1-8-remove-first-vendor-import.patch @@ -0,0 +1,162 @@ +From eefc2db1adcfdd9afc1955c81d73dc3d32c65a57 Mon Sep 17 00:00:00 2001 +From: Oz N Tiram <oz.tiram@gmail.com> +Date: Sun, 9 Jan 2022 23:52:06 +0100 +Subject: [PATCH] Remove vendored first + +While first is nice to have, it adds a lot of code in vendor. +This patch achieves the same with less code in vendor (~80 lines less). +--- + pipenv/core.py | 4 +- + pipenv/vendor/first.LICENSE | 19 --------- + pipenv/vendor/first.py | 78 ------------------------------------- + pipenv/vendor/vendor.txt | 1 - + 4 files changed, 2 insertions(+), 100 deletions(-) + delete mode 100644 pipenv/vendor/first.LICENSE + delete mode 100644 pipenv/vendor/first.py + +diff --git a/pipenv/core.py b/pipenv/core.py +index 92811f74..1c04047c 100644 +--- a/pipenv/core.py ++++ b/pipenv/core.py +@@ -2525,7 +2525,6 @@ def do_check( + args=None, + pypi_mirror=None + ): +- from first import first + from pipenv.vendor.vistir.compat import JSONDecodeError + + if not system: +@@ -2569,7 +2568,8 @@ def do_check( + if not system: + python = project._which("python") + else: +- python = first(system_which(p) for p in ("python", "python3", "python2")) ++ interpreters = [system_which(p) for p in ("python", "python3", "python2")] ++ python = interpreters[0] if interpreters else None + if not python: + click.echo(crayons.red("The Python interpreter can't be found."), err=True) + sys.exit(1) +diff --git a/pipenv/vendor/first.LICENSE b/pipenv/vendor/first.LICENSE +deleted file mode 100644 +index a9c8c9db..00000000 +--- a/pipenv/vendor/first.LICENSE ++++ /dev/null +@@ -1,19 +0,0 @@ +-Copyright (c) 2012 Hynek Schlawack +- +-Permission is hereby granted, free of charge, to any person obtaining a copy of +-this software and associated documentation files (the "Software"), to deal in +-the Software without restriction, including without limitation the rights to +-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +-of the Software, and to permit persons to whom the Software is furnished to do +-so, subject to the following conditions: +- +-The above copyright notice and this permission notice shall be included in all +-copies or substantial portions of the Software. +- +-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +-SOFTWARE. +diff --git a/pipenv/vendor/first.py b/pipenv/vendor/first.py +deleted file mode 100644 +index 8cf9d2d1..00000000 +--- a/pipenv/vendor/first.py ++++ /dev/null +@@ -1,78 +0,0 @@ +-## -*- coding: utf-8 -*- +- +-""" +-first +-===== +- +-first is the function you always missed in Python. +- +-In the simplest case, it returns the first true element from an iterable: +- +->>> from first import first +->>> first([0, False, None, [], (), 42]) +-42 +- +-Or None if there is none: +- +->>> from first import first +->>> first([]) is None +-True +->>> first([0, False, None, [], ()]) is None +-True +- +-It also supports the passing of a key argument to help selecting the first +-match in a more advanced way. +- +->>> from first import first +->>> first([1, 1, 3, 4, 5], key=lambda x: x % 2 == 0) +-4 +- +-:copyright: (c) 2012 by Hynek Schlawack. +-:license: MIT, see LICENSE for more details. +- +-""" +- +-__title__ = 'first' +-__version__ = '2.0.2' +-__author__ = 'Hynek Schlawack' +-__license__ = 'MIT' +-__copyright__ = 'Copyright 2012 Hynek Schlawack' +- +- +-def first(iterable, default=None, key=None): +- """ +- Return first element of `iterable` that evaluates true, else return None +- (or an optional default value). +- +- >>> first([0, False, None, [], (), 42]) +- 42 +- +- >>> first([0, False, None, [], ()]) is None +- True +- +- >>> first([0, False, None, [], ()], default='ohai') +- 'ohai' +- +- >>> import re +- >>> m = first(re.match(regex, 'abc') for regex in ['b.*', 'a(.*)']) +- >>> m.group(1) +- 'bc' +- +- The optional `key` argument specifies a one-argument predicate function +- like that used for `filter()`. The `key` argument, if supplied, must be +- in keyword form. For example: +- +- >>> first([1, 1, 3, 4, 5], key=lambda x: x % 2 == 0) +- 4 +- +- """ +- if key is None: +- for el in iterable: +- if el: +- return el +- else: +- for el in iterable: +- if key(el): +- return el +- +- return default +diff --git a/pipenv/vendor/vendor.txt b/pipenv/vendor/vendor.txt +index 0530062e..3d7b39ea 100644 +--- a/pipenv/vendor/vendor.txt ++++ b/pipenv/vendor/vendor.txt +@@ -10,7 +10,6 @@ colorama==0.4.4 + distlib==0.3.2 + docopt==0.6.2 + dparse==0.5.1 +-first==2.0.2 + funcsigs==1.0.2 + idna==3.2 + importlib-metadata==4.6.1 +-- +2.32.0 + diff --git a/dev-python/pipenv/pipenv-2021.11.23.ebuild b/dev-python/pipenv/pipenv-2021.11.23.ebuild new file mode 100644 index 000000000000..091b0495a4ac --- /dev/null +++ b/dev-python/pipenv/pipenv-2021.11.23.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_SETUPTOOLS=rdepend +PYTHON_COMPAT=( python3_{8..10} ) + +inherit distutils-r1 multiprocessing + +MY_PV=${PV/_beta/b} +DESCRIPTION="Python Development Workflow for Humans" +HOMEPAGE="https://github.com/pypa/pipenv https://pypi.org/project/pipenv/" +SRC_URI="https://github.com/pypa/pipenv/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}"/${PN}-${MY_PV} + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND=" + ${PYTHON_DEPS} + dev-python/attrs[${PYTHON_USEDEP}] + >=dev-python/colorama-0.4.4[${PYTHON_USEDEP}] + >=dev-python/idna-3.2[${PYTHON_USEDEP}] + >=dev-python/pexpect-4.8.0[${PYTHON_USEDEP}] + dev-python/pip[${PYTHON_USEDEP}] + >=dev-python/python-dateutil-2.8.2[${PYTHON_USEDEP}] + >=dev-python/virtualenv-20.0.35[${PYTHON_USEDEP}] + dev-python/virtualenv-clone[${PYTHON_USEDEP}] + >=dev-python/requests-2.26.0[${PYTHON_USEDEP}] + >=dev-python/urllib3-1.26.7[${PYTHON_USEDEP}] + >=dev-python/wheel-0.36.0[${PYTHON_USEDEP}] + >=dev-python/zipp-3.6.0[${PYTHON_USEDEP}] +" + +BDEPEND=" + ${RDEPEND} + test? ( + dev-python/flaky[${PYTHON_USEDEP}] + dev-python/mock[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/pytz[${PYTHON_USEDEP}] + ) +" + +# IMPORTANT: The following sed command patches the vendor direcotry +# in the pipenv source. Attempts to simply bump the version of the +# package without checking that it works is likely to fail +# The vendored packages should eventually all be removed +# see: https://bugs.gentoo.org/717666 +src_prepare() { + + local jobs=$(makeopts_jobs) + local packages=( attr colorama idna pexpect dateutil requests urllib3 zipp ) + for pkgName in ${packages[@]}; do + find ./ -type f -print0 | \ + xargs --max-procs="${jobs}" --null \ + sed --in-place \ + -e 's/from pipenv.vendor import '"${pkgName}"'/import '"${pkgName}"'/g' \ + -e 's/from pipenv.vendor.'"${pkgName}"'\(.*\) import \(\w*\)/from '"${pkgName}"'\1 import \2/g' \ + -e 's/import pipenv.vendor.'"${pkgName}"' as '"${pkgName}"'/import '"${pkgName}"'/g' + done + assert "Failed to sed sources" + + distutils-r1_src_prepare + + # remove vendored versions + for pkgName in ${packages[@]}; do + find ./pipenv/vendor/ -name "${pkgName}*" -prune -exec rm -rvf {} + || die + done + + # not actually used by pipenv, but included in pipenv + rm -vR "${S}/${PN}/vendor/wheel/" || die +} + +python_test() { + pytest -vvv -x -m "not cli and not needs_internet" tests/unit/ || die +} diff --git a/dev-python/pipenv/pipenv-2021.5.29-r2.ebuild b/dev-python/pipenv/pipenv-2021.5.29-r2.ebuild deleted file mode 100644 index 77de678dfaf3..000000000000 --- a/dev-python/pipenv/pipenv-2021.5.29-r2.ebuild +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DISTUTILS_USE_SETUPTOOLS=rdepend -PYTHON_COMPAT=( python3_{8..10} ) - -inherit distutils-r1 - -MY_PV=${PV/_beta/b} -DESCRIPTION="Python Development Workflow for Humans" -HOMEPAGE="https://github.com/pypa/pipenv https://pypi.org/project/pipenv/" -SRC_URI="https://github.com/pypa/pipenv/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" -S="${WORKDIR}"/${PN}-${MY_PV} - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" -IUSE="test" -RESTRICT="!test? ( test )" - -PATCHES=( - "${FILESDIR}/${PN}-${PV//./-}-${PR}-remove-attr-vendor-import.patch" - "${FILESDIR}/${PN}-${PV//./-}-${PR}-remove-colorama-vendor-import.patch" - ) - -RDEPEND=" - ${PYTHON_DEPS} - dev-python/attrs[${PYTHON_USEDEP}] - dev-python/certifi[${PYTHON_USEDEP}] - >=dev-python/colorama-0.4.4[${PYTHON_USEDEP}] - >=dev-python/jinja-3.0.1[${PYTHON_USEDEP}] - dev-python/pip[${PYTHON_USEDEP}] - >=dev-python/virtualenv-20.0.35[${PYTHON_USEDEP}] - dev-python/virtualenv-clone[${PYTHON_USEDEP}] -" -BDEPEND=" - ${RDEPEND} - test? ( - dev-python/flaky[${PYTHON_USEDEP}] - dev-python/mock[${PYTHON_USEDEP}] - dev-python/pytest[${PYTHON_USEDEP}] - dev-python/pytz[${PYTHON_USEDEP}] - ) -" - -src_prepare() { - # remove vendored version of PyYAML that is backported to Python2 - rm -vR "${S}/${PN}/patched/yaml2/" || die - # remove vendored versions - # see https://bugs.gentoo.org/717666 - rm -vR "${S}/${PN}/vendor/attr/" || die - rm -vR "${S}/${PN}/vendor/colorama/" || die - rm -vR "${S}/${PN}/vendor/jinja2/" || die - distutils-r1_src_prepare -} - -python_test() { - pytest -vvv -x -m "not cli and not needs_internet" tests/unit/ || die -} diff --git a/dev-python/pipenv/pipenv-2022.1.8.ebuild b/dev-python/pipenv/pipenv-2022.1.8.ebuild new file mode 100644 index 000000000000..ed11a603ff9d --- /dev/null +++ b/dev-python/pipenv/pipenv-2022.1.8.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_SETUPTOOLS=rdepend +PYTHON_COMPAT=( python3_{8..10} ) + +inherit distutils-r1 multiprocessing + +MY_PV=${PV/_beta/b} +DESCRIPTION="Python Development Workflow for Humans" +HOMEPAGE="https://github.com/pypa/pipenv https://pypi.org/project/pipenv/" +SRC_URI="https://github.com/pypa/pipenv/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}"/${PN}-${MY_PV} + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="test" +RESTRICT="!test? ( test )" + +PATCHES=( + "${FILESDIR}/${PN}-${PV//./-}-remove-first-vendor-import.patch" + ) + +RDEPEND=" + ${PYTHON_DEPS} + dev-python/attrs[${PYTHON_USEDEP}] + dev-python/cached-property[${PYTHON_USEDEP}] + >=dev-python/cerberus-1.3.2[${PYTHON_USEDEP}] + >=dev-python/colorama-0.4.4[${PYTHON_USEDEP}] + dev-python/docopt[${PYTHON_USEDEP}] + >=dev-python/idna-3.2[${PYTHON_USEDEP}] + >=dev-python/pexpect-4.8.0[${PYTHON_USEDEP}] + dev-python/pip[${PYTHON_USEDEP}] + >=dev-python/python-dateutil-2.8.2[${PYTHON_USEDEP}] + >=dev-python/virtualenv-20.0.35[${PYTHON_USEDEP}] + dev-python/virtualenv-clone[${PYTHON_USEDEP}] + >=dev-python/requests-2.26.0[${PYTHON_USEDEP}] + dev-python/toml[${PYTHON_USEDEP}] + >=dev-python/tomli-1.2.2[${PYTHON_USEDEP}] + <dev-python/tomli-2[${PYTHON_USEDEP}] + >=dev-python/urllib3-1.26.7[${PYTHON_USEDEP}] + >=dev-python/wheel-0.36.0[${PYTHON_USEDEP}] + >=dev-python/zipp-3.6.0[${PYTHON_USEDEP}] +" + +BDEPEND=" + ${RDEPEND} + test? ( + dev-python/flaky[${PYTHON_USEDEP}] + dev-python/mock[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/pytz[${PYTHON_USEDEP}] + ) +" + +# IMPORTANT: The following sed command patches the vendor direcotry +# in the pipenv source. Attempts to simply bump the version of the +# package without checking that it works is likely to fail +# The vendored packages should eventually all be removed +# see: https://bugs.gentoo.org/717666 +src_prepare() { + + local jobs=$(makeopts_jobs) + local packages=( attr cerberus cached_property colorama docopt first idna pexpect dateutil requests \ + toml tomli urllib3 zipp ) + for pkgName in ${packages[@]}; do + find ./ -type f -print0 | \ + xargs --max-procs="${jobs}" --null \ + sed --in-place \ + -e 's/from pipenv.vendor import '"${pkgName}"'/import '"${pkgName}"'/g' \ + -e 's/from pipenv.vendor.'"${pkgName}"'\(.*\) import \(\w*\)/from '"${pkgName}"'\1 import \2/g' \ + -e 's/import pipenv.vendor.'"${pkgName}"' as '"${pkgName}"'/import '"${pkgName}"'/g' \ + -e 's/from .vendor import '"${pkgName}"'/import '"${pkgName}"'/g' + done + assert "Failed to sed sources" + + distutils-r1_src_prepare + + # remove vendored versions + for pkgName in ${packages[@]}; do + find ./pipenv/vendor/ -name "${pkgName}*" -prune -exec rm -rvf {} + || die + # package names can be foo-bar, their module will be however foo_bar + find ./pipenv/vendor/ -name "${pkgName/_/-}*" -prune -exec rm -rvf {} + || die + + done + + # not actually used by pipenv, but included in pipenv + rm -vR "${S}/${PN}/vendor/wheel/" || die +} + +python_test() { + pytest -vvv -x -m "not cli and not needs_internet" tests/unit/ || die +} |