1 # Maintainer: Dan McGee <dan@archlinux.org>
2 # Maintainer: Felix Yan <felixonmars@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/"
12 depends=('python-distlib' 'python-filelock' 'python-platformdirs')
13 makedepends=('python-setuptools' 'python-setuptools-scm' 'python-sphinx' 'python-sphinx_rtd_theme'
14 'python-sphinx-argparse' 'towncrier' 'python-importlib-metadata')
15 checkdepends=('python-pytest-freezegun' 'python-pytest-mock' 'python-pip' 'python-coverage' 'fish'
16 'xonsh' 'python-flaky') # 'tcsh' removed: randomly hangs tests
17 replaces=('virtualenv')
18 conflicts=('virtualenv')
19 options=('!makeflags')
20 source=(https://github.com/pypa/virtualenv/archive/$pkgver/$pkgname-$pkgver.tar.gz)
21 sha512sums=('336d597b51c7aa4161f4cf6161e07368a7f5071a4e8c84385149f37545825bd724da9cd69c211abf43b86c4edd4b119fb49397ba02a73d8a42f2b13b46b1d41b')
23 export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
26 # workaround pip vendorod certifi
27 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
31 (cd virtualenv-$pkgver
32 python setup.py build egg_info
33 export PYTHONPATH="$PWD/build/lib:$PWD/src"
34 sphinx-build -b man docs docs/_build/man
40 # tests/unit/create/test_creator.py::test_py_pyc_missing: asking for Python 2.x
41 PYTHONPATH="$PWD/build/lib:$PWD/src" python -m pytest --deselect tests/unit/create/test_creator.py::test_py_pyc_missing
46 python setup.py install --prefix=/usr --root="$pkgdir" --skip-build
47 install -Dm 644 docs/_build/man/virtualenv.1 "${pkgdir}/usr/share/man/man1/virtualenv.1"
48 ln -s virtualenv.1.gz "${pkgdir}/usr/share/man/man1/virtualenv3.1.gz"
50 # link to a version with 3 suffix as well
51 ln "$pkgdir/usr/bin/virtualenv" "$pkgdir/usr/bin/virtualenv3"
53 install -D -m644 LICENSE -t \
54 "$pkgdir"/usr/share/licenses/$pkgname/