diff options
author | Andrej Radovic | 2022-03-02 19:50:26 +0100 |
---|---|---|
committer | Andrej Radovic | 2022-03-02 19:51:08 +0100 |
commit | e653741f9507f7dc955f525c33eade2f6fa21a86 (patch) | |
tree | 55938d21d5b0f54fed325783025a972f2578bb11 | |
parent | 0efc97d1a915de49c6290a4ad077ac7cec578958 (diff) | |
download | aur-python-aspy-refactor-imports.tar.gz |
First version since I took up maintainership.
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | PKGBUILD | 98 |
2 files changed, 19 insertions, 90 deletions
@@ -1,17 +1,14 @@ pkgbase = python-aspy-refactor-imports pkgdesc = Utilities for refactoring imports in python-like syntax. - pkgver = 2.2.0 + pkgver = 2.2.1 pkgrel = 1 url = https://github.com/asottile/aspy.refactor_imports arch = any license = MIT - makedepends = python-pip - makedepends = python-wheel + makedepends = python-setuptools depends = python depends = python-cached-property - source = https://files.pythonhosted.org/packages/source/a/aspy.refactor_imports/aspy.refactor_imports-2.2.0.tar.gz - source = LICENSE - md5sums = 36c10522fb5ccf6a43ec603d8eff496e - md5sums = ec6e4db5d90408877624a1ff7086f824 + source = https://files.pythonhosted.org/packages/source/a/aspy.refactor_imports/aspy.refactor_imports-2.2.1.tar.gz + sha256sums = f5b2fcbf9fd68361168588f14eda64d502d029eefe632d15094cd0683ae12984 pkgname = python-aspy-refactor-imports @@ -1,91 +1,23 @@ -# Maintainer: Hugo Osvaldo Barrera <hugo@barrera.io> - -export PIP_CONFIG_FILE=/dev/null -export PIP_DISABLE_PIP_VERSION_CHECK=true - -_name=aspy.refactor_imports +# Maintainer: Andrej Radović <r.andrej@gmail.com> pkgname=python-aspy-refactor-imports -pkgver=2.2.0 +_name=aspy.refactor_imports +pkgver=2.2.1 pkgrel=1 -pkgdesc='Utilities for refactoring imports in python-like syntax.' -arch=(any) -url=https://github.com/asottile/aspy.refactor_imports -license=(MIT) -depends=(python python-cached-property) -makedepends=(python-pip python-wheel) -source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz" - LICENSE) -md5sums=('36c10522fb5ccf6a43ec603d8eff496e' - 'ec6e4db5d90408877624a1ff7086f824') - -_first_source() { - echo " ${source_i686[@]} ${source_x86_64[@]} ${source[@]}" | - tr ' ' '\n' | grep -Pv '^(PKGBUILD_EXTRAS)?$' | head -1 -} - -if [[ $(_first_source) =~ ^git+ ]]; then - provides+=("${pkgname%-git}") - conflicts+=("${pkgname%-git}") -fi - -_is_wheel() { - [[ $(_first_source) =~ \.whl$ ]] -} - -_dist_name() { - basename "$(_first_source)" | - sed 's/\(\.tar\.gz\|\.tgz\|\.tar\.bz2\|\.zip\|\.git\)$//' -} - -if [[ $(_first_source) =~ ^git+ ]]; then - _pkgver() { - ( set -o pipefail - cd "$srcdir/$(_dist_name)" - git describe --long --tags 2>/dev/null | - sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || - printf "r%s.%s" \ - "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" - ) - } - - pkgver() { _pkgver; } -fi +pkgdesc="Utilities for refactoring imports in python-like syntax." +url="https://github.com/asottile/aspy.refactor_imports" +depends=('python' 'python-cached-property') +makedepends=('python-setuptools') +license=('MIT') +arch=('any') +source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz") +sha256sums=('f5b2fcbf9fd68361168588f14eda64d502d029eefe632d15094cd0683ae12984') build() { - if _is_wheel; then return; fi - cd "$srcdir/$(_dist_name)" - # See Arch Wiki/PKGBUILD/license. - # Get the first filename that matches. - local test_name - if [[ ${license[0]} =~ ^(BSD|MIT|ZLIB|Python)$ ]]; then - for test_name in LICENSE LICENSE.txt license.txt COPYING COPYING.md COPYING.rst COPYING.txt COPYRIGHT; do - if cp "$srcdir/$(_dist_name)/$test_name" "$srcdir/LICENSE" 2>/dev/null; then - break - fi - done - fi - # Build the wheel (which we allow to fail) only after fetching the license. - /usr/bin/pip wheel -v --no-deps --wheel-dir="$srcdir" \ - --global-option=--no-user-cfg \ - --global-option=build --global-option=-j"$(nproc)" . || - true -} - -_check() { - # Define check(), possibly using _check as a helper, to run the tests. - # You may need to call `python setup.py build_ext -i` first. - if _is_wheel; then return; fi - cd "$srcdir/$(_dist_name)" - /usr/bin/python setup.py -q test + cd "$srcdir/$_name-$pkgver" + python setup.py build } package() { - cd "$srcdir" - # pypa/pip#3063: pip always checks for a globally installed version. - /usr/bin/pip --quiet install --root="$pkgdir" \ - --no-deps --ignore-installed --no-warn-script-location \ - "$(ls ./*.whl 2>/dev/null || echo ./"$(_dist_name)")" - if [[ -f LICENSE ]]; then - install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - fi + cd "$srcdir/$_name-$pkgver" + python setup.py install --root="$pkgdir" --optimize=1 } |