1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 virtualenv,
6 pytestCheckHook,
7}:
8
9buildPythonPackage rec {
10 pname = "virtualenv-clone";
11 version = "0.5.7";
12 format = "setuptools";
13
14 src = fetchFromGitHub {
15 owner = "edwardgeorge";
16 repo = "virtualenv-clone";
17 rev = version;
18 hash = "sha256-qrN74IwLRqiVPxU8gVhdiM34yBmiS/5ot07uroYPDVw=";
19 };
20
21 postPatch = ''
22 substituteInPlace tests/__init__.py \
23 --replace-fail "'virtualenv'" "'${virtualenv}/bin/virtualenv'" \
24 --replace-fail "'3.9', '3.10']" "'3.9', '3.10', '3.11', '3.12', '3.13']" # if the Python version used isn't in this list, tests fail
25
26 substituteInPlace tests/test_virtualenv_sys.py \
27 --replace-fail "'virtualenv'" "'${virtualenv}/bin/virtualenv'"
28
29 # PermissionError: [Errno 13] Permission denied: '/tmp/test_fixup_pth_file.pth'
30 # Unable to reproduce.
31 # Theory: this fixed path may collide with itself on darwin if this package is built for multiple python versions simultaneously
32 substituteInPlace tests/test_fixup_scripts.py \
33 --replace-fail \
34 "pth = '/tmp/test_fixup_pth_file.pth'" \
35 "pth = '$(mktemp -d)/test_fixup_pth_file.pth'"
36 '';
37
38 propagatedBuildInputs = [ virtualenv ];
39
40 nativeCheckInputs = [ pytestCheckHook ];
41
42 meta = with lib; {
43 homepage = "https://github.com/edwardgeorge/virtualenv-clone";
44 description = "Script to clone virtualenvs";
45 mainProgram = "virtualenv-clone";
46 license = licenses.mit;
47 maintainers = [ ];
48 };
49}