From 2dc5ba161e2185912dcd0d6683ab5d58ae9a74b832308eee3704d249e295bc95 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 25 Oct 2022 05:17:54 +0000 Subject: [PATCH 1/3] Accepting request 1030588 from home:jayvdb:branches:devel:languages:python - Re-activate test suite OBS-URL: https://build.opensuse.org/request/show/1030588 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flasgger?expand=0&rev=9 --- python-flasgger.changes | 5 +++++ python-flasgger.spec | 27 +++++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/python-flasgger.changes b/python-flasgger.changes index 73c05a0..105ea63 100644 --- a/python-flasgger.changes +++ b/python-flasgger.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Oct 23 10:03:15 UTC 2022 - John Vandenberg + +- Re-activate test suite + ------------------------------------------------------------------- Thu Apr 28 07:23:15 UTC 2022 - Markéta Machová diff --git a/python-flasgger.spec b/python-flasgger.spec index 8324997..08d2d5c 100644 --- a/python-flasgger.spec +++ b/python-flasgger.spec @@ -25,14 +25,6 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/rochacbruno/flasgger/ Source: https://files.pythonhosted.org/packages/source/f/flasgger/flasgger-%{version}.tar.gz -#BuildRequires: %{python_module Flask >= 0.10} -#BuildRequires: %{python_module PyYAML >= 3.0} -#BuildRequires: %{python_module flex} -#BuildRequires: %{python_module jsonschema >= 3.0.1} -#BuildRequires: %{python_module marshmallow} -#BuildRequires: %{python_module mistune} -#BuildRequires: %{python_module pytest >= 3.0.7} -#BuildRequires: %{python_module six >= 1.10} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -42,6 +34,16 @@ Requires: python-jsonschema >= 3.0.1 Requires: python-mistune Requires: python-six >= 1.10 BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module Flask >= 0.10} +BuildRequires: %{python_module PyYAML >= 3.0} +BuildRequires: %{python_module flex} +BuildRequires: %{python_module jsonschema >= 3.0.1} +BuildRequires: %{python_module marshmallow} +BuildRequires: %{python_module mistune} +BuildRequires: %{python_module pytest >= 3.0.7} +BuildRequires: %{python_module six >= 1.10} +# /SECTION %python_subpackages %description @@ -49,6 +51,8 @@ Flasgger is a Flask extension to extract OpenAPI=Specification from all Flask vi %prep %setup -q -n flasgger-%{version} +# Examples directory is not included in PyPI release +rm tests/test_examples.py %build %python_build @@ -57,13 +61,12 @@ Flasgger is a Flask extension to extract OpenAPI=Specification from all Flask vi %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} -# upstream testsuite is very fragile and needs packages we don't have -#%check -#%%pytest +%check +%pytest tests/ %files %{python_files} %license LICENSE %doc README.md -%{python_sitelib}/* +%{python_sitelib}/flasgger*/ %changelog From bd80881954485350c84f591fecf1ebc6b807a7852797dc518a48d7e70c652969 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 25 Oct 2022 05:24:51 +0000 Subject: [PATCH 2/3] - Also remove the conditional definition of python_module. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flasgger?expand=0&rev=10 --- python-flasgger.changes | 1 + python-flasgger.spec | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python-flasgger.changes b/python-flasgger.changes index 105ea63..2eb65f5 100644 --- a/python-flasgger.changes +++ b/python-flasgger.changes @@ -2,6 +2,7 @@ Sun Oct 23 10:03:15 UTC 2022 - John Vandenberg - Re-activate test suite +- Also remove the conditional definition of python_module. ------------------------------------------------------------------- Thu Apr 28 07:23:15 UTC 2022 - Markéta Machová diff --git a/python-flasgger.spec b/python-flasgger.spec index 08d2d5c..019381c 100644 --- a/python-flasgger.spec +++ b/python-flasgger.spec @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-flasgger Version: 0.9.5 Release: 0 @@ -51,15 +50,20 @@ Flasgger is a Flask extension to extract OpenAPI=Specification from all Flask vi %prep %setup -q -n flasgger-%{version} + # Examples directory is not included in PyPI release rm tests/test_examples.py +find . -name .DS_Store -print -delete + %build %python_build %install %python_install -%python_expand %fdupes %{buildroot}%{$python_sitelib} +%{python_expand chmod -x %{buildroot}%{$python_sitelib}/flasgger/ui2/static/lang/*.js +%fdupes %{buildroot}%{$python_sitelib} +} %check %pytest tests/ From 4570c3694c0c020d6f987b582a2bab4589ba1997c7ddeadd3c352be8c664a369 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 22 Dec 2022 08:54:14 +0000 Subject: [PATCH 3/3] - Add multibuild for tests to avoid package build cycle. flasgger -> flex (testing) -> httpbin -> flasgger OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flasgger?expand=0&rev=11 --- _multibuild | 3 +++ python-flasgger.changes | 6 ++++++ python-flasgger.spec | 24 ++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-flasgger.changes b/python-flasgger.changes index 2eb65f5..c747ce7 100644 --- a/python-flasgger.changes +++ b/python-flasgger.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Dec 22 08:47:43 UTC 2022 - Daniel Garcia + +- Add multibuild for tests to avoid package build cycle. + flasgger -> flex (testing) -> httpbin -> flasgger + ------------------------------------------------------------------- Sun Oct 23 10:03:15 UTC 2022 - John Vandenberg diff --git a/python-flasgger.spec b/python-flasgger.spec index 019381c..2e7edc2 100644 --- a/python-flasgger.spec +++ b/python-flasgger.spec @@ -1,5 +1,5 @@ # -# spec file for package python-flasgger +# spec file # # Copyright (c) 2022 SUSE LLC # @@ -16,7 +16,16 @@ # -Name: python-flasgger +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif + +Name: python-flasgger%{psuffix} Version: 0.9.5 Release: 0 Summary: Tool to extract swagger specs from Flask projects @@ -33,7 +42,10 @@ Requires: python-jsonschema >= 3.0.1 Requires: python-mistune Requires: python-six >= 1.10 BuildArch: noarch + +%if %{with test} # SECTION test requirements +BuildRequires: %{python_module flasgger = %{version}} BuildRequires: %{python_module Flask >= 0.10} BuildRequires: %{python_module PyYAML >= 3.0} BuildRequires: %{python_module flex} @@ -43,6 +55,8 @@ BuildRequires: %{python_module mistune} BuildRequires: %{python_module pytest >= 3.0.7} BuildRequires: %{python_module six >= 1.10} # /SECTION +%endif + %python_subpackages %description @@ -56,6 +70,7 @@ rm tests/test_examples.py find . -name .DS_Store -print -delete +%if !%{with test} %build %python_build @@ -64,13 +79,18 @@ find . -name .DS_Store -print -delete %{python_expand chmod -x %{buildroot}%{$python_sitelib}/flasgger/ui2/static/lang/*.js %fdupes %{buildroot}%{$python_sitelib} } +%endif +%if %{with test} %check %pytest tests/ +%endif +%if !%{with test} %files %{python_files} %license LICENSE %doc README.md %{python_sitelib}/flasgger*/ +%endif %changelog