diff options
author | Hugo Osvaldo Barrera | 2019-09-24 14:19:21 +0200 |
---|---|---|
committer | Hugo Osvaldo Barrera | 2019-09-24 14:19:21 +0200 |
commit | 75104f28851e0dfa1943763f0c2a40e51ac031c1 (patch) | |
tree | 0a3eeb6e9e32fd4a3e569bab22148c159d39e28e | |
download | aur-75104f28851e0dfa1943763f0c2a40e51ac031c1.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | LICENSE | 19 | ||||
-rw-r--r-- | PKGBUILD | 102 | ||||
-rw-r--r-- | PKGBUILD_EXTRAS | 0 |
4 files changed, 141 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..959d432daa31 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = python-aspy-refactor-imports + pkgdesc = Utilities for refactoring imports in python-like syntax. + pkgver = 1.1.0 + pkgrel = 00 + url = https://github.com/asottile/aspy.refactor_imports + arch = any + license = MIT + makedepends = python-pip + makedepends = python-wheel + depends = python + depends = python-cached-property + source = PKGBUILD_EXTRAS + source = https://files.pythonhosted.org/packages/21/cb/c1b7faffb5b802b6408f0957b39401a5bc95c989a0bf7c1965475d9cfb5e/aspy.refactor_imports-1.1.0.tar.gz + source = LICENSE + md5sums = SKIP + md5sums = 98bea44fb46d7c3bba1ea52784c98307 + md5sums = ec6e4db5d90408877624a1ff7086f824 + +pkgname = python-aspy-refactor-imports + diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..d86d9ea06347 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Anthony Sottile + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..63eaf4cf5784 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,102 @@ +# Maintainer: Hugo Osvaldo Barrera <hugo@barrera.io> + +export PIP_CONFIG_FILE=/dev/null +export PIP_DISABLE_PIP_VERSION_CHECK=true + +pkgname=python-aspy-refactor-imports +epoch= +pkgver=1.1.0 +pkgrel=00 +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) +## EXTRA_DEPENDS ## +makedepends=(python-pip python-wheel) +checkdepends=() +provides=() +conflicts=(${provides%=*}) # No quotes, to avoid an empty entry. +source=(PKGBUILD_EXTRAS) +md5sums=(SKIP) +source+=(https://files.pythonhosted.org/packages/21/cb/c1b7faffb5b802b6408f0957b39401a5bc95c989a0bf7c1965475d9cfb5e/aspy.refactor_imports-1.1.0.tar.gz) +md5sums+=(98bea44fb46d7c3bba1ea52784c98307) +source+=(LICENSE) +md5sums+=(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 + +_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 +} + +build() { _build; } + +_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 +} + +_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 +} + +package() { _package; } + +. "$(dirname "$BASH_SOURCE")/PKGBUILD_EXTRAS" diff --git a/PKGBUILD_EXTRAS b/PKGBUILD_EXTRAS new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/PKGBUILD_EXTRAS |