_pkgname="poetry" name='python-poetry' version='1.8.3' release='1' desc='Python dependency management and packaging made easy' homepage='https://python-poetry.org' maintainer="Евгений Храмов " architectures=('all') license=('MIT') provides=('poetry') conflicts=('poetry') _deps=(build cachecontrol cachy cleo crashtest dulwich filelock html5lib installer jsonschema keyring lockfile packaging pexpect pkginfo platformdirs poetry-core poetry-plugin-export pyproject-hooks requests requests-toolbelt shellingham tomlkit trove-classifiers urllib3 virtualenv) deps=(python "${_deps[@]/#/python-}") build_deps=(python-deepdiff # not mentioned but required python-psutil # for python-pytest-xdist python-httpretty python-pip # not mentioned but required python-pytest python-pytest-mock python-pytest-randomly python-pytest-xdist) opt_deps=('python-pip: to use pip with virtual environments') _archive="$_pkgname-$pkgver" source=("https://github.com/$pkgname/$_pkgname/archive/$pkgver/$_archive.tar.gz") sha256sums=('4da8d1b19cfb50536c6b54e984b88cec3bc1203f9749d5f4958db5cbb0c7b7bc') prepare() { cd "$_archive" # Unpin crashtest which we have packaged at 0.4.0 # https://bugs.archlinux.org/task/75733 # Also unpin requests-toolbelt # https://github.com/python-poetry/poetry/pull/7893 sed -i -e '/^crashtest/s/\^/>=/' -e '/^requests-toolbelt/s/,<0.11.0//' pyproject.toml } build() { local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") cd "$_archive" python -m build -wn # install to tmp dir for tests and generate completions python -m installer --destdir=test_dir dist/*.whl export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH" export PATH="$PWD/test_dir/usr/bin:$PATH" poetry completions bash > poetry.bash poetry completions zsh > poetry.zsh poetry completions fish > poetry.fish } check() { local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") cd "$_archive" export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH" pytest -vv tests } package() { cd "$_archive" python -m installer -d "$pkgdir" dist/*.whl install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE install -vDm 644 $_pkgname.bash "$pkgdir/usr/share/bash-completion/completions/$_pkgname" install -vDm 644 $_pkgname.zsh "$pkgdir/usr/share/zsh/site-functions/_$_pkgname" install -vDm 644 $_pkgname.fish -t "$pkgdir/usr/share/fish/vendor_completions.d/" }