archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-isort / trunk / PKGBUILD
blobdd9d3439af5ab5b1afe4a1a3e320cf82cf484024
1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Contributor: Felix Yan <felixonmars@archlinux.org>
3 # Contributor: Yaron de Leeuw <me@jarondl.net>
5 _pyname=isort
6 pkgname=python-$_pyname
7 pkgver=5.12.0
8 pkgrel=2
9 pkgdesc='A Python utility / library to sort Python imports'
10 arch=(any)
11 url="https://github.com/PyCQA/$_pyname"
12 license=(MIT)
13 _pydeps=(toml
14          tomli)
15 depends=(python
16          "${_pydeps[@]/#/python-}")
17 makedepends=(python-{build,installer,wheel}
18              python-poetry-core)
19 _pycheckdeps=(black
20               hypothesis
21               hypothesis-auto
22               hypothesmith
23               libcst
24               natsort
25               ## deps that make it harder not easier to tell if things work
26               # pip
27               # pip-api
28               # pipreqs
29               pytest
30               pytest-mock
31               requirementslib)
32 # Besides the overflowing plethora of specific test problems as noted in the
33 # check() function --dselects, the switch from dephell to poetry broke a whole
34 # batch more tests related to output formatting. There are a bunch of lines where
35 # the expected output has whitespace and the actual output does not any more.
36 # checkdepends=(git
37 #               pylama
38 #               "${_pycheckdeps[@]/#/python-}")
39 _archive="$_pyname-$pkgver"
40 source=("$url/archive/$pkgver/$_archive.tar.gz")
41 sha256sums=('00eef77c312dc08606d72b6c38a5330632caca4f9bf8e86b7b373ed760ae29b8')
43 prepare() {
44         cd "$_archive"
46         # Devendor toml
47         rm -r isort/_vendored
48         sed -i 's/from ._vendored //' isort/settings.py
50         ## Skipping example integration tests
51         # for _plugin in example_*; do
52         #     pushd $_plugin
53         #     dephell deps convert --from pyproject.toml --to setup.py
54         #     popd
55         # done
58 build() {
59         cd "$_archive"
60         python -m build -wn
63 # check() {
64 #     cd "$_archive"
65 #     ## Skipping example integration tests
66 #     # python setup.py install --root="$PWD/tmp_install" --optimize=1
67 #     # for _plugin in example_*; do
68 #     #     pushd $_plugin
69 #     #     python setup.py install --root="$srcdir/isort-$pkgver/tmp_install" --optimize=1
70 #     #     popd
71 #     # done
72 #     # PYTHONPATH="$PWD/example_isort_formatting_plugin:$PWD/example_shared_isort_profile:$PWD/tmp_install/usr/lib/python3.11/site-packages" PATH="$PWD/tmp_install/usr/bin:$PATH" \
73 #     python -m pytest -p no:warnings \
74 #         --deselect tests/unit/test_deprecated_finders.py::TestRequirementsFinder::test_requirements_dir $(: having pip in ruins other tests ) \
75 #         --deselect tests/unit/test_deprecated_finders.py::test_requirements_finder $(: having pip in ruins other tests ) \
76 #         --deselect tests/unit/test_deprecated_finders.py::test_pipfile_finder $(: having pip in ruins other tests ) \
77 #         --deselect tests/unit/test_isort.py::test_settings_path_skip_issue_909 $(: example integrations ) \
78 #         --deselect tests/unit/test_isort.py::test_skip_paths_issue_938 $(: example integrations ) \
79 #         --deselect tests/unit/test_ticketed_features.py::test_isort_supports_shared_profiles_issue_970 $(: example integrations ) \
80 #         --deselect tests/unit/test_literal.py::test_value_assignment_list $(: unknown) \
81 #         --deselect tests/unit/test_ticketed_features.py::test_isort_supports_formatting_plugins_issue_1353 $(: unknown) \
82 #         --deselect tests/unit/test_ticketed_features.py::test_isort_literals_issue_1358 $(: unknown ) \
83 #         --deselect tests/unit/test_ticketed_features.py::test_sort_configurable_sort_issue_1732 $(: unknown ) \
84 #         --deselect tests/integration/test_setting_combinations.py $(: unknown ) \
85 #         --deselect tests/integration/test_projects_using_isort.py::test_typeshed $(: requires network ) \
86 #         --deselect tests/test_importable.py::test_importable $(: just weird ) \
87 #         --deselect tests/benchmark/test_api.py $(: no benchmarks thanks )
88 # }
90 package() {
91         cd "$_archive"
92         python -m installer -d "$pkgdir" dist/*.whl
93         rm -f "$pkgdir"/usr/lib/python*/site-packages/{LICENSE,CHANGELOG.md}
94         install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE