summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOz Tiram <oz.tiram@gmail.com>2023-05-04 11:01:13 +0200
committerSam James <sam@gentoo.org>2023-05-05 23:37:20 +0100
commitb49ac8b31d3d99cad724b7ca4d756de8373d3740 (patch)
treed9fb38c7fbd5a0ac46191a83f49638858da5a8f0 /dev-python/pipenv
parentdev-ml/textutils_kernel: Stabilize 0.15.0 arm64, #901715 (diff)
downloadgentoo-b49ac8b31d3d99cad724b7ca4d756de8373d3740.tar.gz
gentoo-b49ac8b31d3d99cad724b7ca4d756de8373d3740.tar.bz2
gentoo-b49ac8b31d3d99cad724b7ca4d756de8373d3740.zip
dev-python/pipenv: add 2023.4.29
Signed-off-by: Oz Tiram <oz.tiram@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/pipenv')
-rw-r--r--dev-python/pipenv/Manifest1
-rw-r--r--dev-python/pipenv/files/pipenv-2023.4.29-append-always-install.patch19
-rw-r--r--dev-python/pipenv/files/pipenv-2023.4.29-fix-imports.patch31
-rw-r--r--dev-python/pipenv/pipenv-2023.4.29.ebuild114
4 files changed, 165 insertions, 0 deletions
diff --git a/dev-python/pipenv/Manifest b/dev-python/pipenv/Manifest
index 3fefbc1c596d..49abe2e62372 100644
--- a/dev-python/pipenv/Manifest
+++ b/dev-python/pipenv/Manifest
@@ -1 +1,2 @@
DIST pipenv-2022.12.19.gh.tar.gz 11118843 BLAKE2B 812aa7eacd2b1eaa42a586e64b73e7a13d2ac3ed4c2abf834e190ed5a8a4398d3d17999c1e196de6b01eb755f6771493967b8497710ac3fe20d73408f6251f80 SHA512 edd1e43cb3e91ed0001aff0a590f72e510f9b4c5f436a1c81d1e8a815d22f5bcf199254e5faf78dbdfec3ee0d4b51709b6de28163cf01e58d6f0de044ae99fdc
+DIST pipenv-2023.4.29.gh.tar.gz 10808706 BLAKE2B 31432b80f82b041969e75d0ec0a28ca90068395be25dac94a7f34526f0b638adfae59e9396b147fa61592ee78af2d9cfb4a1b65dedea9bbb299b2624a6d6e9a1 SHA512 870b33ced4ed909b23b9d345ec788f4b5fffde4b253755e8a41b0629e885ef49ca14e9a68b5919b70074829002603fe427e8b77f41028a7de33d269a910354ff
diff --git a/dev-python/pipenv/files/pipenv-2023.4.29-append-always-install.patch b/dev-python/pipenv/files/pipenv-2023.4.29-append-always-install.patch
new file mode 100644
index 000000000000..25a9c604e5b4
--- /dev/null
+++ b/dev-python/pipenv/files/pipenv-2023.4.29-append-always-install.patch
@@ -0,0 +1,19 @@
+diff --git a/pipenv/routines/install.py b/pipenv/routines/install.py
+index 4b8b2bf8c..a3e1fbcf7 100644
+--- a/pipenv/routines/install.py
++++ b/pipenv/routines/install.py
+@@ -580,6 +580,14 @@ def batch_install_iteration(
+ strip_extras_markers_from_requirement,
+ )
+
++ # Gentoo patch:
++ # Install dependencies into the venv even if they exist
++ # in the system.
++ # This is needed because pipenv imports the system packages to run.
++ # It does not change your system's packages.
++ if (extra_pip_args is not None) and ("-I" not in extra_pip_args):
++ extra_pip_args.append("-I")
++
+ is_artifact = False
+ for dep in deps_to_install:
+ if dep.req.req:
diff --git a/dev-python/pipenv/files/pipenv-2023.4.29-fix-imports.patch b/dev-python/pipenv/files/pipenv-2023.4.29-fix-imports.patch
new file mode 100644
index 000000000000..eeae85039e12
--- /dev/null
+++ b/dev-python/pipenv/files/pipenv-2023.4.29-fix-imports.patch
@@ -0,0 +1,31 @@
+diff --git a/pipenv/project.py b/pipenv/project.py
+index 75ee7d401..ed43cf2bc 100644
+--- a/pipenv/project.py
++++ b/pipenv/project.py
+@@ -40,9 +40,11 @@ from pipenv.utils.shell import (
+ system_which,
+ )
+ from pipenv.utils.toml import cleanup_toml, convert_toml_outline_tables
+-from pipenv.vendor import click, plette, toml, tomlkit
++from pipenv.vendor import plette
+ from pipenv.vendor.requirementslib.models.utils import get_default_pyproject_backend
+
++import click, toml, tomlkit
++
+ try:
+ # this is only in Python3.8 and later
+ from functools import cached_property
+diff --git a/pipenv/utils/environment.py b/pipenv/utils/environment.py
+index 2e066eef2..9385689bf 100644
+--- a/pipenv/utils/environment.py
++++ b/pipenv/utils/environment.py
+@@ -1,7 +1,8 @@
+ import os
++import dotenv
++import click
+
+ from pipenv import environments
+-from pipenv.vendor import click, dotenv
+
+
+ def load_dot_env(project, as_dict=False, quiet=False):
diff --git a/dev-python/pipenv/pipenv-2023.4.29.ebuild b/dev-python/pipenv/pipenv-2023.4.29.ebuild
new file mode 100644
index 000000000000..1ae17db21361
--- /dev/null
+++ b/dev-python/pipenv/pipenv-2023.4.29.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..11} )
+
+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}.gh.tar.gz"
+S="${WORKDIR}"/${PN}-${MY_PV}
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~riscv ~x86"
+
+PATCHES=(
+ "${FILESDIR}/pipenv-2022.9.24-inject-site-packages.patch"
+ "${FILESDIR}/pipenv-2023.4.29-append-always-install.patch"
+ "${FILESDIR}/pipenv-2023.4.29-fix-imports.patch"
+)
+
+RDEPEND="
+ dev-python/attrs[${PYTHON_USEDEP}]
+ >=dev-python/cerberus-1.3.2[${PYTHON_USEDEP}]
+ dev-python/click[${PYTHON_USEDEP}]
+ >=dev-python/colorama-0.4.4[${PYTHON_USEDEP}]
+ >=dev-python/markupsafe-2.0.1[${PYTHON_USEDEP}]
+ >=dev-python/pexpect-4.8.0[${PYTHON_USEDEP}]
+ >=dev-python/ptyprocess-0.7.0[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ dev-python/toml[${PYTHON_USEDEP}]
+ >=dev-python/python-dateutil-2.8.2[${PYTHON_USEDEP}]
+ >=dev-python/python-dotenv-0.21.0[${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/ruamel-yaml[${PYTHON_USEDEP}]
+ dev-python/tomlkit[${PYTHON_USEDEP}]
+"
+
+BDEPEND="
+ ${RDEPEND}
+ test? (
+ dev-python/flaky[${PYTHON_USEDEP}]
+ dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/pytz[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+# 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 pkgName
+ local jobs=$(makeopts_jobs)
+ local packages=( attr attrs cerberus colorama dotenv markupsafe \
+ pexpect ptyprocess pyparsing requests urllib3 tomlkit )
+ 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" || die "Failed to sed for ${pkgName}"
+ done
+
+ distutils-r1_src_prepare
+
+ # remove vendored versions
+ for pkgName in ${packages[@]}; do
+ find ./pipenv/vendor -regextype posix-extended -regex ".*${pkgName}$" -prune -exec rm -rvf {} + || die
+ # package names can be foo-bar, their module will be however foo_bar
+ find ./pipenv/vendor -regextype posix-extended -regex ".*${pkgName/_/-}" -prune -exec rm -rvf {} + || die
+ done
+
+ find ./pipenv/vendor -regextype posix-extended -regex '.*cached[_-]property.*' -prune -exec rm -rvf {} + || die
+
+ find ./ -type f -print0 | \
+ xargs --max-procs="${jobs}" --null \
+ sed --in-place \
+ -e "s/from pipenv\.vendor import plette, toml, tomlkit, vistir/from pipenv\.vendor import plette, toml, vistir\\nimport tomlkit/g"
+
+ # remove tomlkit from vendoring
+ for fname in pipenv/utils/toml.py tests/integration/conftest.py; do
+ sed --in-place -e "s/from pipenv\.vendor import toml, tomlkit/from pipenv\.vendor import toml\\nimport tomlkit/g" $fname || die "Failed sed in $fname"
+ done
+ #for fname in "tests/unit/test_vendor.py "; do
+ # sed --in-place -e "s/from pipenv\.vendor import tomlkit/import tomlkit/g" $fname || die "Failed sed in tomlkit"
+ #done
+ # remove python ruaml yaml
+ sed --in-place -e "s/from pipenv\.vendor\.ruamel\.yaml import YAML/from ruamel\.yaml import YAML/g" pipenv/patched/safety/util.py || die "Failed sed in ruaml-yaml"
+ sed --in-place -e "s/from pipenv\.vendor\.ruamel\.yaml\.error import MarkedYAMLError/from ruamel\.yaml\.error import MarkedYAMLError/g" pipenv/patched/safety/util.py || die "Failed sed in ruamel-yaml"
+
+ rm -vR pipenv/vendor/ruamel || die "Failed removing ruamel-yaml from vendor"
+
+ for fname in Makefile README.md README.rst ruamel.*.LICENSE vendor.txt; do
+ rm -v pipenv/vendor/$fname || die "Failed removing pipenv/vendor/$fname"
+ done
+
+}
+
+python_test() {
+ epytest -m "not cli and not needs_internet" tests/unit/
+}