mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-09 23:23:00 -04:00
dev-python/pipenv: new package, add 2026.5.2
Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
This commit is contained in:
1
dev-python/pipenv/Manifest
Normal file
1
dev-python/pipenv/Manifest
Normal file
@@ -0,0 +1 @@
|
||||
DIST pipenv-2026.5.2.gh.tar.gz 10508957 BLAKE2B 76a31783f4653701b6ae5491df55954f567051b495cfc7fdc19a2f441618d90e0198fb2dd6c9f103d97027b17fd45e82d50e3db136ce5eeb764c9ac896cbd0e9 SHA512 4241a25af0c9aa581026e55f40f53b76411f6a264a2ef8d37298b4def19ae334d098d970c550b24e1da29003215ea34d4aa1f070de4d599d79ad7e114a5a1325
|
||||
@@ -0,0 +1,36 @@
|
||||
From 33dadedbe186b15b9acb38d88c2fe86743305aa2 Mon Sep 17 00:00:00 2001
|
||||
From: Oz Tiram <oz.tiram@gmail.com>
|
||||
Date: Tue, 30 Dec 2025 16:25:59 +0100
|
||||
Subject: [PATCH 1/2] Append always install to pip extra args
|
||||
|
||||
Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
|
||||
---
|
||||
pipenv/routines/install.py | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/pipenv/routines/install.py b/pipenv/routines/install.py
|
||||
index 71655eb3..f5cdae95 100644
|
||||
--- a/pipenv/routines/install.py
|
||||
+++ b/pipenv/routines/install.py
|
||||
@@ -563,6 +563,18 @@ def batch_install_iteration(
|
||||
allow_global=False,
|
||||
extra_pip_args=None,
|
||||
):
|
||||
+
|
||||
+ # 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")
|
||||
+
|
||||
+ # End of Gentoo patch
|
||||
+
|
||||
with temp_environ():
|
||||
if not allow_global:
|
||||
os.environ["PIP_USER"] = "0"
|
||||
--
|
||||
2.51.2
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From 13eca720efeb7b3288aa3ff7436732da90f602f1 Mon Sep 17 00:00:00 2001
|
||||
From: Oz Tiram <oz.tiram@gmail.com>
|
||||
Date: Tue, 30 Dec 2025 16:28:32 +0100
|
||||
Subject: [PATCH 2/2] Inject system packages
|
||||
|
||||
Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
|
||||
---
|
||||
pipenv/patched/pip/__main__.py | 6 ++++++
|
||||
pipenv/resolver.py | 5 +++++
|
||||
2 files changed, 11 insertions(+)
|
||||
|
||||
diff --git a/pipenv/patched/pip/__main__.py b/pipenv/patched/pip/__main__.py
|
||||
index e76aed6e..5e62c70b 100644
|
||||
--- a/pipenv/patched/pip/__main__.py
|
||||
+++ b/pipenv/patched/pip/__main__.py
|
||||
@@ -21,6 +21,12 @@ if __package__ == "":
|
||||
if __name__ == "__main__":
|
||||
import importlib.util
|
||||
import sys
|
||||
+
|
||||
+ SITE_PACKAGES_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
||||
+
|
||||
+ # Inject site directory into system path.
|
||||
+ sys.path.insert(-1, SITE_PACKAGES_ROOT)
|
||||
+
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"pipenv",
|
||||
location=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "__init__.py"))
|
||||
diff --git a/pipenv/resolver.py b/pipenv/resolver.py
|
||||
index b050d842..746a17d6 100644
|
||||
--- a/pipenv/resolver.py
|
||||
+++ b/pipenv/resolver.py
|
||||
@@ -7,6 +7,11 @@ from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Set
|
||||
|
||||
+SITE_PACKAGES_ROOT = os.path.dirname(os.path.dirname(__file__))
|
||||
+
|
||||
+# Inject site directory into system path.
|
||||
+sys.path.insert(-1, SITE_PACKAGES_ROOT)
|
||||
+
|
||||
|
||||
def _ensure_modules():
|
||||
# Try to ensure typing_extensions is available in sys.modules
|
||||
--
|
||||
2.51.2
|
||||
|
||||
21
dev-python/pipenv/metadata.xml
Normal file
21
dev-python/pipenv/metadata.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person" proxied="yes">
|
||||
<email>oz.tiram@gmail.com</email>
|
||||
<name>Oz Tiram</name>
|
||||
</maintainer>
|
||||
<maintainer type="project" proxied="proxy">
|
||||
<email>proxy-maint@gentoo.org</email>
|
||||
<name>Proxy Maintainers</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<maintainer status="active">
|
||||
<email>distutils-sig@python.org</email>
|
||||
<name>Python Packaging Authority</name>
|
||||
</maintainer>
|
||||
<remote-id type="pypi">pipenv</remote-id>
|
||||
<remote-id type="github">pypa/pipenv</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
||||
112
dev-python/pipenv/pipenv-2026.5.2.ebuild
Normal file
112
dev-python/pipenv/pipenv-2026.5.2.ebuild
Normal file
@@ -0,0 +1,112 @@
|
||||
# Copyright 1999-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{11..14} pypy3_11 )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
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${PV}.tar.gz -> ${P}.gh.tar.gz"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~arm64 ~riscv"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/pipenv-${PV}-inject-system-packages.patch"
|
||||
"${FILESDIR}/pipenv-${PV}-append-always-install-to-pip-extra-args.patch"
|
||||
)
|
||||
|
||||
RDEPEND="
|
||||
>=dev-python/importlib-metadata-8.4.0[${PYTHON_USEDEP}]
|
||||
<dev-python/importlib-metadata-9.0.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pexpect-4.8.0[${PYTHON_USEDEP}]
|
||||
~dev-python/pipdeptree-2.30.0[${PYTHON_USEDEP}]
|
||||
~dev-python/plette-2.1.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/ptyprocess-0.7.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/python-dotenv-0.21.0[${PYTHON_USEDEP}]
|
||||
>=dev-python/pythonfinder-3.0.0[${PYTHON_USEDEP}]
|
||||
dev-python/shellingham[${PYTHON_USEDEP}]
|
||||
dev-python/tomlkit[${PYTHON_USEDEP}]
|
||||
>=dev-python/virtualenv-20.0.35[${PYTHON_USEDEP}]
|
||||
"
|
||||
|
||||
BDEPEND="
|
||||
${RDEPEND}
|
||||
test? (
|
||||
dev-python/flaky[${PYTHON_USEDEP}]
|
||||
dev-python/mock[${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() {
|
||||
sed --in-place -e \
|
||||
"s/import click, plette, tomlkit/import click\n\import tomlkit\nfrom pipenv.vendor import plette/g" \
|
||||
pipenv/project.py || die "Failed patching pipenv/project.py"
|
||||
|
||||
local pkgName
|
||||
local packages=(
|
||||
colorama
|
||||
click
|
||||
click_didyoumean
|
||||
dotenv
|
||||
pexpect
|
||||
pipdeptree
|
||||
plette
|
||||
pythonfinder
|
||||
shellingham
|
||||
tomli
|
||||
tomlkit
|
||||
importlib_metadata
|
||||
packaging
|
||||
)
|
||||
|
||||
for pkgName in "${packages[@]}"; do
|
||||
find ./ -type f -exec 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" \
|
||||
-e "s/from .vendor.${pkgName}/from ${pkgName}/g" {} + || die "Failed to sed for ${pkgName}"
|
||||
done
|
||||
|
||||
# disable coverage in tests
|
||||
sed -i -e '/\[tool\.pytest\.ini_options\]/,/\[/ { /addopts/d; /plugins/d; }' pyproject.toml || die
|
||||
|
||||
distutils-r1_src_prepare
|
||||
|
||||
# remove vendored versions
|
||||
for pkgName in "${packages[@]}"; do
|
||||
# Match the name directly (works for directories and files)
|
||||
# We use -o (OR) to handle both the original name and the hyphenated version
|
||||
find ./pipenv/vendor \( -name "${pkgName}" -o -name "${pkgName/_/-}" \) \
|
||||
-prune -exec rm -rvf {} + || die "Failed to remove vendored ${pkgName}"
|
||||
done
|
||||
|
||||
find tests/ -type f -name "*.py" -exec sed -i \
|
||||
-e "s/pipenv\.vendor\.pythonfinder\.utils\.get_python_version/pythonfinder.utils.get_python_version/g" \
|
||||
-e "s/from pipenv\.vendor /from /g" \
|
||||
-e "s/import pipenv\.vendor\./import /g" \
|
||||
{} + || die "Failed to devendor tests"
|
||||
|
||||
rm -rv examples docs benchmarks || die "Failed to remove dirs"
|
||||
|
||||
}
|
||||
|
||||
EPYTEST_PLUGINS=()
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_test() {
|
||||
local -x PYTHONPATH="${S}:${PYTHONPATH}"
|
||||
epytest -m "not cli and not needs_internet" tests/unit/
|
||||
}
|
||||
Reference in New Issue
Block a user