summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hsuan Yen2022-10-23 16:01:59 +0000
committerChih-Hsuan Yen2022-10-23 16:01:59 +0000
commitd46dda720ac9fa3f79998c1ac54e670a398bda51 (patch)
tree972db981973236e9620c66fe31d1e764d8cc270a
downloadaur-d46dda720ac9fa3f79998c1ac54e670a398bda51.tar.gz
aws-cli-v2: new package imported from AUR
* Add check() * Update deps * Update conflicts and remove unofficial packages * Bring back auto-completion index (ac.index) in older AUR versions * List myself as a maintainer
-rw-r--r--PKGBUILD64
-rw-r--r--prompt-toolkit-3.0.29.diff16
2 files changed, 80 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..18e7a3efe98b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,64 @@
+# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
+# Contributor: Marcel Campello <marcel.campello@prafrentex.com.br>
+# Contributor: David Birks <david@birks.dev>
+
+pkgname=aws-cli-v2
+pkgver=2.8.5
+pkgrel=1
+pkgdesc='Unified command line interface for Amazon Web Services (version 2)'
+arch=(any)
+url='https://github.com/aws/aws-cli/tree/v2'
+license=(Apache)
+# wcwidth is not used; upstream pinned it due to pyinstaller issues
+# https://github.com/aws/aws-cli/pull/5254
+depends=(python python-awscrt python-certifi python-colorama python-cryptography python-dateutil
+ python-distro python-docutils python-jmespath python-prompt_toolkit python-ruamel-yaml
+ python-urllib3)
+makedepends=(python-build python-wheel python-flit-core python-installer)
+# Tests need the 'ps' binary
+checkdepends=(python-pytest python-pytest-xdist python-jsonschema python-mock procps-ng)
+provides=(aws-cli)
+conflicts=(aws-cli)
+source=("$pkgname-$pkgver.tar.gz::https://github.com/aws/aws-cli/archive/$pkgver.tar.gz"
+ prompt-toolkit-3.0.29.diff)
+sha256sums=('0ca266c345099fd7edea4befddf1bc571e84a21870c5ba0fc5fd7612c04ccc0c'
+ 'c4f0bfe21bef89934137c57ee4771db57e8dad0f995634ee4de0890dcf45a636')
+
+prepare() {
+ cd aws-cli-$pkgver
+
+ # Don't treat warnings as errors
+ sed -i '/"error::/d' pyproject.toml
+
+ # See: https://github.com/prompt-toolkit/python-prompt-toolkit/commit/97ac51413f8d412599233fc3da44d4c7fc456f8c
+ patch -Np1 -i ../prompt-toolkit-3.0.29.diff
+}
+
+build() {
+ cd aws-cli-$pkgver
+
+ echo "Generating auto-complete index. Takes a few minutes..."
+ PYTHONPATH="$PWD" ./scripts/gen-ac-index --index-location=./awscli/data/ac.index
+
+ python -m build --wheel --no-isolation --skip-dependency-check
+}
+
+check() {
+ cd aws-cli-$pkgver
+
+ export AWS_SECRET_ACCESS_KEY=fake_key
+ export AWS_ACCESS_KEY_ID=fake_id
+
+ export PYTHONPATH="$PWD"
+
+ # --basetemp is for tests/backends
+ # Use --dist=loadfile following upstream. The default --dist=load may cause test failures and is not faster
+ pytest tests -n auto --dist loadfile --basetemp="$PWD/tmp" --ignore=tests/integration
+}
+
+package() {
+ cd aws-cli-$pkgver
+ python -m installer --destdir="$pkgdir" dist/*.whl
+ install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm 644 bin/aws_bash_completer "$pkgdir/usr/share/bash-completion/completions/aws"
+}
diff --git a/prompt-toolkit-3.0.29.diff b/prompt-toolkit-3.0.29.diff
new file mode 100644
index 000000000000..75de9b9e0347
--- /dev/null
+++ b/prompt-toolkit-3.0.29.diff
@@ -0,0 +1,16 @@
+diff --git a/tests/conftest.py b/tests/conftest.py
+index 4bd573144..8a9e1530b 100644
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -40,10 +40,7 @@ def clear_loggers():
+
+ @pytest.fixture
+ def ptk_app_session():
+- pipe_input = create_pipe_input()
+ output = DummyOutput()
+- try:
++ with create_pipe_input() as pipe_input:
+ with create_app_session(input=pipe_input, output=output) as session:
+ yield session
+- finally:
+- pipe_input.close()