diff --git a/python-isort.changes b/python-isort.changes index 61499ca..8e1ca9a 100644 --- a/python-isort.changes +++ b/python-isort.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 28 20:09:25 UTC 2020 - Benjamin Greiner + +- use poetry to install example projects. fixes the two remaining + test issues + ------------------------------------------------------------------- Tue Jul 28 19:01:37 UTC 2020 - Sebastian Wagner diff --git a/python-isort.spec b/python-isort.spec index 44dd74a..4d16f45 100644 --- a/python-isort.spec +++ b/python-isort.spec @@ -33,7 +33,7 @@ Summary: A Python utility / library to sort Python imports License: MIT 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 +# tests and test data are not packaged for PyPI, get them from git sources Source1: https://github.com/timothycrosley/isort/archive/%{version}.tar.gz#/isort-%{version}-gh.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -45,13 +45,16 @@ Recommends: python-pip-api Recommends: python-pipreqs Recommends: python-requirementslib >= 1.5.4 Recommends: python-tomlkit +Suggests: git BuildArch: noarch %if %{with test} +BuildRequires: %{python_module black} 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 poetry} BuildRequires: %{python_module pylama} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requirementslib >= 1.5.4} @@ -74,13 +77,15 @@ too. %setup -q -n isort-%{version} chmod -x LICENSE %else -%setup -q -n isort-%{version} -b 1 +%setup -q -n isort-%{version} -T -b 1 %endif %if !%{with test} %build %python_build +%endif +%if !%{with test} %install %python_install %python_expand rm -r %{buildroot}%{$python_sitelib}/tests/ @@ -90,7 +95,20 @@ chmod -x LICENSE %if %{with test} %check -%pytest -v -W "ignore::UserWarning" -W "ignore::DeprecationWarning" +%{python_expand # create egg-info for example projects +for exampledir in example_shared_isort_profile example_isort_formatting_plugin; do + pushd $exampledir + # no exact environment as upstreams devel project + rm poetry.lock + # no dependency download, we have it by BuildRequires + sed -i '/tool.poetry.dependencies/,/^$/ d' pyproject.toml + poetry-%{$python_bin_suffix} install + # append current dir, only use colon if not empty + export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}$(pwd)" + popd +done +} +%pytest -v -W "ignore::UserWarning" -W "ignore::DeprecationWarning" %endif %if !%{with test}