archrelease: copy trunk to extra-x86_64
[arch-packages.git] / python-virtualenv / trunk / PKGBUILD
blob74f2000b9db7e3b19b432205678c3ffe882444c0
1 # Maintainer: Dan McGee <dan@archlinux.org>
2 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 # Contributor: Daniele Paolella <dp@mcrservice.it>
5 pkgbase=python-virtualenv
6 pkgname=python-virtualenv
7 pkgver=20.11.0
8 pkgrel=1
9 pkgdesc="Virtual Python Environment builder"
10 url="https://virtualenv.pypa.io/"
11 arch=('any')
12 license=('MIT')
13 depends=('python-platformdirs' 'python-distlib' 'python-filelock' 'python-six'
14          'python-importlib-metadata')
15 makedepends=('python-setuptools' 'python-platformdirs' 'python-distlib' 'python-filelock'
16              'python-six' 'python-setuptools-scm' 'python-sphinx' 'python-sphinx_rtd_theme'
17              'python-sphinx-argparse' 'towncrier' 'python-importlib-metadata')
18 checkdepends=('python-pytest-freezegun' 'python-pytest-mock' 'python-pip' 'python-coverage' 'fish'
19               'xonsh' 'python-flaky')  # 'tcsh' removed: randomly hangs tests
20 replaces=('virtualenv')
21 conflicts=('virtualenv')
22 options=('!makeflags')
23 source=(https://github.com/pypa/virtualenv/archive/$pkgver/$pkgbase-$pkgver.tar.gz)
24 sha512sums=('aef26e29192b0308a2324a230a2964c8776ecfd265bb12a587cb05b7e07576092e0b621625d7007541fdf7bc5c0b2b0b1c2c0b73d6332a0164bc60109b50b852')
26 export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
28 prepare() {
29   # TODO: figure out why
30   sed -i '/test_py_info_to_system_raises/i @pytest.mark.skip' virtualenv-$pkgver/tests/unit/discovery/py_info/test_py_info.py
32   # workaround pip vendorod certifi
33   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
35   # Use importlib-metadata directly for Python 3.9
36   sed -i 's/from backports.entry_points_selectable import entry_points/from importlib_metadata import entry_points/' virtualenv-$pkgver/src/virtualenv/run/plugin/base.py
37   sed -i '/backports.entry_points_selectable/d' virtualenv-$pkgver/setup.cfg
40 build() {
41   (cd virtualenv-$pkgver
42     python setup.py build egg_info
43     export PYTHONPATH="$PWD/build/lib:$PWD/src"
44     sphinx-build -b man docs docs/_build/man
45   )
48 check() {
49   cd virtualenv-$pkgver
50   PYTHONPATH="$PWD/build/lib:$PWD/src" python -m pytest
53 package() {
54   cd virtualenv-$pkgver
55   python setup.py install --prefix=/usr --root="$pkgdir" --skip-build
56   install -Dm 644 docs/_build/man/virtualenv.1 "${pkgdir}/usr/share/man/man1/virtualenv.1"
57   ln -s virtualenv.1.gz "${pkgdir}/usr/share/man/man1/virtualenv3.1.gz"
59   # link to a version with 3 suffix as well
60   ln "$pkgdir/usr/bin/virtualenv" "$pkgdir/usr/bin/virtualenv3"
62   install -D -m644 LICENSE -t \
63     "$pkgdir"/usr/share/licenses/$pkgname/