Date: Thursday, August 19, 2021 @ 12:36:07 Author: felixonmars Revision: 1003818
extra2community: Moving python-isort from extra to community Added: python-isort/ python-isort/repos/ python-isort/trunk/ python-isort/trunk/PKGBUILD ----------+ PKGBUILD | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) Added: python-isort/trunk/PKGBUILD =================================================================== --- python-isort/trunk/PKGBUILD (rev 0) +++ python-isort/trunk/PKGBUILD 2021-08-19 12:36:07 UTC (rev 1003818) @@ -0,0 +1,59 @@ +# Maintainer: Felix Yan <felixonm...@archlinux.org> +# Contributor: Yaron de Leeuw <m...@jarondl.net> + +pkgname=python-isort +pkgver=5.8.0 +pkgrel=1 +pkgdesc="A Python utility / library to sort Python imports." +arch=('any') +url="https://github.com/timothycrosley/isort" +license=('MIT') +depends=('python-toml') +makedepends=('python-dephell') +checkdepends=('git' 'pylama' 'python-black' 'python-hypothesis-auto' 'python-hypothesmith' + 'python-libcst' 'python-pip' 'python-pip-api' 'python-pipreqs' 'python-pytest' + 'python-pytest-mock' 'python-requirementslib') +source=("https://github.com/timothycrosley/isort/archive/$pkgver/$pkgname-$pkgver.tar.gz") +sha512sums=('a49597b2bf66499c4895cea2946805ecc02c191448af0b3fe1418571f4ea46ac52b13529ac65da1d119f47a49120aecef29ad32d2403f665d45475d49795412a') + +prepare() { + cd isort-$pkgver + + # Devendor toml + rm -r isort/_vendored + sed -i 's/from ._vendored //' isort/settings.py + + # poetry-generated setup.py are fatally broken, see: + # https://github.com/sdispater/poetry/issues/866 + dephell deps convert --from pyproject.toml --to setup.py + for _plugin in example_isort_formatting_plugin example_shared_isort_profile; do + pushd $_plugin + dephell deps convert --from pyproject.toml --to setup.py + popd + done +} + +build() { + cd isort-$pkgver + python setup.py build +} + +check() { + cd isort-$pkgver + python setup.py install --root="$PWD/tmp_install" --optimize=1 + for _plugin in example_isort_formatting_plugin example_shared_isort_profile; do + pushd $_plugin + python setup.py install --root="$srcdir/isort-$pkgver/tmp_install" --optimize=1 + popd + done + # tests/test_importable.py::test_importable: This is just weird + # tests/integration/test_projects_using_isort.py::test_airflow: https://github.com/PyCQA/isort/pull/1567#issuecomment-710787547 + PYTHONPATH="$PWD/example_isort_formatting_plugin:$PWD/example_shared_isort_profile:$PWD/tmp_install/usr/lib/python3.9/site-packages" PATH="$PWD/tmp_install/usr/bin:$PATH" \ + pytest --deselect tests/test_importable.py::test_importable --deselect tests/integration/test_projects_using_isort.py::test_airflow +} + +package() { + cd isort-$pkgver + python setup.py install --root="$pkgdir" --optimize=1 + install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/ +}