python3Packages.virtualenv-clone: migrate to pyproject (#524182)

This commit is contained in:
Yohann Boniface
2026-05-31 19:30:35 +00:00
committed by GitHub
@@ -4,27 +4,30 @@
fetchFromGitHub,
virtualenv,
pytestCheckHook,
setuptools,
}:
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "virtualenv-clone";
version = "0.5.7";
format = "setuptools";
pyproject = true;
src = fetchFromGitHub {
owner = "edwardgeorge";
repo = "virtualenv-clone";
rev = version;
tag = finalAttrs.version;
hash = "sha256-qrN74IwLRqiVPxU8gVhdiM34yBmiS/5ot07uroYPDVw=";
};
build-system = [ setuptools ];
postPatch = ''
substituteInPlace tests/__init__.py \
--replace-fail "'virtualenv'" "'${virtualenv}/bin/virtualenv'" \
--replace-fail "'virtualenv'" "'${lib.getExe virtualenv}'" \
--replace-fail "'3.9', '3.10']" "'3.9', '3.10', '3.11', '3.12', '3.13', '3.14']" # if the Python version used isn't in this list, tests fail
substituteInPlace tests/test_virtualenv_sys.py \
--replace-fail "'virtualenv'" "'${virtualenv}/bin/virtualenv'"
--replace-fail "'virtualenv'" "'${lib.getExe virtualenv}'"
# PermissionError: [Errno 13] Permission denied: '/tmp/test_fixup_pth_file.pth'
# Unable to reproduce.
@@ -35,7 +38,7 @@ buildPythonPackage rec {
"pth = '$(mktemp -d)/test_fixup_pth_file.pth'"
'';
propagatedBuildInputs = [ virtualenv ];
dependencies = [ virtualenv ];
nativeCheckInputs = [ pytestCheckHook ];
@@ -43,7 +46,8 @@ buildPythonPackage rec {
homepage = "https://github.com/edwardgeorge/virtualenv-clone";
description = "Script to clone virtualenvs";
mainProgram = "virtualenv-clone";
changelog = "https://github.com/edwardgeorge/virtualenv-clone/blob/${finalAttrs.src.tag}/changelog.md";
license = lib.licenses.mit;
maintainers = [ ];
maintainers = with lib.maintainers; [ skohtv ];
};
}
})