1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Dan McGee <dan@archlinux.org>
3 # Contributor: Daniele Paolella <dp@mcrservice.it>
5 pkgname=python-virtualenv
8 pkgdesc="Virtual Python Environment builder"
9 url="https://virtualenv.pypa.io/"
23 'python-importlib-metadata'
25 'python-sphinx-argparse'
26 'python-sphinxcontrib-towncrier'
35 'python-pytest-freezegun'
37 # 'tcsh' # NOTE: randomly hangs tests (e.g. tests/unit/test_util.py::test_reentrant_file_lock_is_thread_safe)
40 replaces=('virtualenv')
41 conflicts=('virtualenv')
42 options=('!makeflags')
43 source=(https://github.com/pypa/virtualenv/archive/$pkgver/$pkgname-$pkgver.tar.gz)
44 sha512sums=('c02ba29677c3b6405d2849bba7243b7a61a49f83b0d309a288876754762f81a1d111ae5176e4c20623e263ceef73c4c0c76fd7a84043ee8a220b5620b31fc2e7')
45 b2sums=('5e8ac9e29af0251a247b7f80465e975c13fcaa722ad4859cba046783819a2540307f31a3799146316a07490e4c55fca0a77ee84238865412517832766e2ee200')
47 export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
50 # workaround pip vendorod certifi
51 sed -i "s|pkgutil.get_data(\"pip._vendor.certifi\", \"cacert.pem\")|open(os.path.join('/etc/ssl/certs/ca-certificates.crt'), 'rb').read()|" virtualenv-$pkgver/tests/conftest.py
55 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
58 python -m build --wheel --no-isolation
59 # NOTE: install to tmp dir for documentation and tests
60 python -m installer --destdir=test_dir dist/*.whl
61 export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
62 sphinx-build -b man docs docs/_build/man
66 local pytest_options=(
68 # tests try to find python2
69 --deselect tests/unit/create/test_creator.py::test_py_pyc_missing[True-False]
70 --deselect tests/unit/create/test_creator.py::test_py_pyc_missing[False-False]
71 --deselect tests/unit/discovery/py_info/test_py_info.py::test_fallback_existent_system_executable
73 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
76 export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
77 pytest "${pytest_options[@]}"
82 python -m installer --destdir="$pkgdir" dist/*.whl
83 install -Dm 644 docs/_build/man/virtualenv.1 -t "${pkgdir}/usr/share/man/man1/"
84 ln -s virtualenv.1.gz "${pkgdir}/usr/share/man/man1/virtualenv3.1.gz"
86 # link to a version with 3 suffix as well
87 ln "$pkgdir/usr/bin/virtualenv" "$pkgdir/usr/bin/virtualenv3"
89 install -D -m644 LICENSE -t \
90 "$pkgdir"/usr/share/licenses/$pkgname/