SHA256
1
0
forked from pool/python-isort

Accepting request 820730 from home:bnavigator:branches:devel:languages:python

- the tests are not packaged on PyPI. Use github sources. (Need to
  reference commit directly (gh#timothycrosley/isort#1316)
- update test requirements
- reenable most passing tests except one (gh#timothycrosley/isort#1317)
- update package description
- new version does not build/test on Python 2 (define skip for older distros)

OBS-URL: https://build.opensuse.org/request/show/820730
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-isort?expand=0&rev=41
This commit is contained in:
Sebastian Wagner 2020-07-13 19:54:31 +00:00 committed by Git OBS Bridge
parent 56f1a4bec7
commit be652da2d9
3 changed files with 44 additions and 27 deletions

3
isort-5.0.9-gh.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:da05b6cfa4107d71c0fddee8e58a55cbd02d0dd1e2145ad2ccae6c4faf92da34
size 570386

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Jul 13 17:03:27 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- the tests are not packaged on PyPI. Use github sources. (Need to
reference commit directly (gh#timothycrosley/isort#1316)
- update test requirements
- reenable most passing tests except one (gh#timothycrosley/isort#1317)
- update package description
- new version does not build/test on Python 2 (define skip for older distros)
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Jul 12 15:01:26 UTC 2020 - Sebastian Wagner <sebix+novell.com@sebix.at> Sun Jul 12 15:01:26 UTC 2020 - Sebastian Wagner <sebix+novell.com@sebix.at>

View File

@ -25,73 +25,76 @@
%define psuffix %{nil} %define psuffix %{nil}
%bcond_with test %bcond_with test
%endif %endif
%bcond_without python2 %define skip_python2 1
# commit for release 5.0.9, tag is invalid. gh#timothycrosley/isort#1316
%define gitref b49aba99b919473b66f05b663588cfac2472c601
Name: python-isort%{psuffix} Name: python-isort%{psuffix}
Version: 5.0.9 Version: 5.0.9
Release: 0 Release: 0
Summary: A Python utility / library to sort Python imports Summary: A Python utility / library to sort Python imports
License: MIT License: MIT
URL: https://github.com/timothycrosley/isort URL: https://timothycrosley.github.io/isort/
Source: https://files.pythonhosted.org/packages/source/i/isort/isort-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/i/isort/isort-%{version}.tar.gz
# tests are not packaged for PyPI, get them from git sources
Source1: https://github.com/timothycrosley/isort/archive/%{gitref}.tar.gz#/isort-%{version}-gh.tar.gz
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-setuptools Requires: python-setuptools
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
Recommends: python-appdirs >= 1.4.0 Recommends: python-pip-api
Recommends: python-pip
Recommends: python-pipreqs Recommends: python-pipreqs
Recommends: python-requirementslib Recommends: python-requirementslib
Recommends: python-toml Recommends: python-tomlkit
BuildArch: noarch BuildArch: noarch
%if %{with python2}
BuildRequires: python-backports.functools_lru_cache
BuildRequires: python-futures
%endif
%if %{with test} %if %{with test}
BuildRequires: %{python_module appdirs >= 1.4.0} BuildRequires: %{python_module hypothesis-auto}
BuildRequires: %{python_module isort = %{version}}
BuildRequires: %{python_module mock} BuildRequires: %{python_module mock}
BuildRequires: %{python_module pip-api}
BuildRequires: %{python_module pipreqs} BuildRequires: %{python_module pipreqs}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pylama} BuildRequires: %{python_module pylama}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requirementslib} BuildRequires: %{python_module requirementslib}
BuildRequires: %{python_module toml} BuildRequires: %{python_module tomlkit}
%endif
%ifpython2
Requires: python-backports.functools_lru_cache
Requires: python-futures
%endif %endif
%python_subpackages %python_subpackages
%description %description
isort your python imports for you so you dont have to. isort your python imports for you so you dont have to.
isort is a Python utility / library to sort imports alphabetically, isort is a Python utility / library to sort imports alphabetically, and
and automatically separated into sections. It provides a command line automatically separated into sections and by type. It provides a command line
utility, Python library and plugins for various editors to quickly utility, Python library and plugins for various editors to quickly sort all your
sort all your imports. It currently cleanly supports Python 2.7 - 3.6 without imports. It requires Python 3.6+ to run but supports formatting Python 2 code
any dependencies. too.
%prep %prep
%if !%{with test}
%setup -q -n isort-%{version} %setup -q -n isort-%{version}
chmod -x LICENSE chmod -x LICENSE
%else
%setup -q -n isort-%{gitref} -b 1
%endif
%if !%{with test}
%build %build
%python_build %python_build
%install %install
%if !%{with test}
%python_install %python_install
%python_clone -a %{buildroot}%{_bindir}/isort %python_clone -a %{buildroot}%{_bindir}/isort
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif %endif
%check
# test_pipfile_finder - broken upstrem in tomlkit
%if %{with test} %if %{with test}
%pytest -k 'not (test_settings_path_skip_issue_909 or test_standard_library_deprecates_user_issue_778 or test_skip_paths_issue_938 or test_requirements_finder or test_pipfile_finder)' %check
# test_pipfile_finder: gh#timothycrosley/isort#1317
%{pytest -v -W "ignore::UserWarning" \
-W "ignore::DeprecationWarning" \
-k "not test_pipfile_finder"
}
%endif %endif
%if !%{with test} %if !%{with test}
@ -102,9 +105,10 @@ chmod -x LICENSE
%python_uninstall_alternative isort %python_uninstall_alternative isort
%files %{python_files} %files %{python_files}
%{python_sitelib}/isort*
%python_alternative %{_bindir}/isort
%license LICENSE %license LICENSE
%python_alternative %{_bindir}/isort
%{python_sitelib}/isort
%{python_sitelib}/isort-%{version}-py*.egg-info
%endif %endif
%changelog %changelog