Accepting request 823224 from home:bnavigator:branches:devel:languages:python
- use poetry to install example projects. fixes the two remaining test issues needs SR 823222 and SR 823223 OBS-URL: https://build.opensuse.org/request/show/823224 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-isort?expand=0&rev=49
This commit is contained in:
parent
b1a682d120
commit
5fdf9d6ac0
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 28 20:09:25 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
|
||||
|
||||
- use poetry to install example projects. fixes the two remaining
|
||||
test issues
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 28 19:01:37 UTC 2020 - Sebastian Wagner <sebix+novell.com@sebix.at>
|
||||
|
||||
|
@ -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,6 +95,19 @@ chmod -x LICENSE
|
||||
|
||||
%if %{with test}
|
||||
%check
|
||||
%{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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user