Date: Thursday, April 13, 2023 @ 23:46:23
  Author: dvzrv
Revision: 1445964

upgpkg: python-poetry 1.4.2-2: Rebuild against Python 3.11.

Remove tab poisoning (choosing spaces instead of using both).
Add all required direct and check dependencies.
Install to temporary location to generate shell completions and run tests.
Run test suite in check().
Remove use of custom (now unneeded) script to generate shell completions.

Modified:
  python-poetry/trunk/PKGBUILD
Deleted:
  python-poetry/trunk/poetry-completions-generator

------------------------------+
 PKGBUILD                     |   89 +++++++++++++++++++++++------------------
 poetry-completions-generator |   15 ------
 2 files changed, 50 insertions(+), 54 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-04-13 23:06:38 UTC (rev 1445963)
+++ PKGBUILD    2023-04-13 23:46:23 UTC (rev 1445964)
@@ -1,14 +1,13 @@
 # Maintainer: Caleb Maclennan <[email protected]>
+# Contributor: David Runge <[email protected]>
 # Contributor: David JoaquĆ­n Shourabi Porcel <[email protected]>
 # Contributor: Sven-Hendrik Haase <[email protected]>
 # Contributor: Eli Schwartz <[email protected]>
 
-BUILDENV+=(!check)
-
 _pkgname=poetry
 pkgname=python-poetry
 pkgver=1.4.2
-pkgrel=1
+pkgrel=2
 pkgdesc='Python dependency management and packaging made easy'
 arch=(any)
 url=https://python-poetry.org
@@ -19,6 +18,7 @@
        cleo
        crashtest
        dulwich
+       filelock
        html5lib
        installer
        jsonschema
@@ -30,59 +30,70 @@
        platformdirs
        poetry-core
        poetry-plugin-export
+       pyproject-hooks
        requests
        requests-toolbelt
        shellingham
-       tomli
        tomlkit
+       trove-classifiers
        urllib3
        virtualenv)
-depends=("${_deps[@]/#/python-}")
-makedepends=(python)
-checkdepends=(git
-              python-httpretty
-              python-pytest
-              python-pytest-mock)
+depends=(
+  python
+  "${_deps[@]/#/python-}"
+)
+checkdepends=(
+  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
+)
+optdepends=(
+  'python-pip: to use pip with virtual environments'
+)
 provides=(poetry)
 _archive="$_pkgname-$pkgver"
-source=("https://github.com/$pkgname/$_pkgname/archive/$pkgver/$_archive.tar.gz";
-        poetry-completions-generator)
-sha256sums=('8cdbad22dfd11ca9c7e37bcafe18ae931b80e0776adbe6df8d24091bd2b23eff'
-            'e44c71a3b804b5c2bf07573ed465aee275a5844f10e37ee63c7395c9213a2b6d')
+source=("https://github.com/$pkgname/$_pkgname/archive/$pkgver/$_archive.tar.gz";)
+sha256sums=('8cdbad22dfd11ca9c7e37bcafe18ae931b80e0776adbe6df8d24091bd2b23eff')
 
 prepare() {
-       cd "$_archive"
-       install -m0755 -t ./ ../poetry-completions-generator
-       # Unpin crashtest which we have packaged at 0.4.0
-       # https://bugs.archlinux.org/task/75733
-       sed -i -e '/^crashtest/s/\^/>=/' pyproject.toml
+  cd "$_archive"
+  # Unpin crashtest which we have packaged at 0.4.0
+  # https://bugs.archlinux.org/task/75733
+  sed -i -e '/^crashtest/s/\^/>=/' pyproject.toml
 }
 
 build() {
-       cd "$_archive"
-       python -m build -wn
+  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() {
-       cd "$_archive/src"
-       export PYTHONPATH="$PWD"
-       pytest
+  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 completions, which for some crazy reason hardcode the filename
-       # used to invoke which is __main__.py if we use python -m poetry, and 
also
-       # adds the full directory path???
-       set -o pipefail
-       ./poetry-completions-generator completions bash |
-               sed "#$srcdir#d" |
-               install -Dm644 /dev/stdin 
"$pkgdir/usr/share/bash-completion/completions/poetry"
-       ./poetry-completions-generator completions zsh |
-               sed "#$srcdir#d" |
-               install -Dm644 /dev/stdin 
"$pkgdir/usr/share/zsh/site-functions/_poetry"
-       ./poetry-completions-generator completions fish |
-               install -Dm644 /dev/stdin 
"$pkgdir/usr/share/fish/vendor_completions.d/poetry.fish"
+  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/"
 }

Deleted: poetry-completions-generator
===================================================================
--- poetry-completions-generator        2023-04-13 23:06:38 UTC (rev 1445963)
+++ poetry-completions-generator        2023-04-13 23:46:23 UTC (rev 1445964)
@@ -1,15 +0,0 @@
-#!/usr/bin/python3
-
-# This is a dummy script that fakes its own sys.argv[0] to make the completions
-# subcommand do the correct thing when run from the build directory. cleo's
-# completion generator uses this to generate completions for sys.argv[0] as 
well
-# as (???) os.path.join(os.getcwd(), sys.argv[0]) for mysterious reasons.
-#
-# We don't want to complete 'poetry/__main__.py'....
-
-import sys
-from poetry.console.application import main
-
-sys.argv = ['poetry', 'completions', sys.argv.pop()]
-
-main()

Reply via email to