diff --git a/isort-5.0.9-gh.tar.gz b/isort-5.0.9-gh.tar.gz new file mode 100644 index 0000000..b7d16bd --- /dev/null +++ b/isort-5.0.9-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da05b6cfa4107d71c0fddee8e58a55cbd02d0dd1e2145ad2ccae6c4faf92da34 +size 570386 diff --git a/python-isort.changes b/python-isort.changes index 0e7c89e..03cbb22 100644 --- a/python-isort.changes +++ b/python-isort.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Jul 13 17:03:27 UTC 2020 - Benjamin Greiner + +- 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 diff --git a/python-isort.spec b/python-isort.spec index 3c25a2a..64a8bfa 100644 --- a/python-isort.spec +++ b/python-isort.spec @@ -25,73 +25,76 @@ %define psuffix %{nil} %bcond_with test %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} Version: 5.0.9 Release: 0 Summary: A Python utility / library to sort Python imports 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 +# 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: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools Requires(post): update-alternatives Requires(postun): update-alternatives -Recommends: python-appdirs >= 1.4.0 -Recommends: python-pip +Recommends: python-pip-api Recommends: python-pipreqs Recommends: python-requirementslib -Recommends: python-toml +Recommends: python-tomlkit BuildArch: noarch -%if %{with python2} -BuildRequires: python-backports.functools_lru_cache -BuildRequires: python-futures -%endif %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 pip-api} BuildRequires: %{python_module pipreqs} -BuildRequires: %{python_module pip} BuildRequires: %{python_module pylama} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requirementslib} -BuildRequires: %{python_module toml} -%endif -%ifpython2 -Requires: python-backports.functools_lru_cache -Requires: python-futures +BuildRequires: %{python_module tomlkit} %endif %python_subpackages %description isort your python imports for you so you don’t have to. -isort is a Python utility / library to sort imports alphabetically, -and automatically separated into sections. It provides a command line -utility, Python library and plugins for various editors to quickly -sort all your imports. It currently cleanly supports Python 2.7 - 3.6 without -any dependencies. +isort is a Python utility / library to sort imports alphabetically, and +automatically separated into sections and by type. It provides a command line +utility, Python library and plugins for various editors to quickly sort all your +imports. It requires Python 3.6+ to run but supports formatting Python 2 code +too. %prep +%if !%{with test} %setup -q -n isort-%{version} chmod -x LICENSE +%else +%setup -q -n isort-%{gitref} -b 1 +%endif +%if !%{with test} %build %python_build %install -%if !%{with test} %python_install %python_clone -a %{buildroot}%{_bindir}/isort %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif -%check -# test_pipfile_finder - broken upstrem in tomlkit %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 %if !%{with test} @@ -102,9 +105,10 @@ chmod -x LICENSE %python_uninstall_alternative isort %files %{python_files} -%{python_sitelib}/isort* -%python_alternative %{_bindir}/isort %license LICENSE +%python_alternative %{_bindir}/isort +%{python_sitelib}/isort +%{python_sitelib}/isort-%{version}-py*.egg-info %endif %changelog