- Apply spec-cleaner and improve overall spec file quality

- Test in multibuild in order to avoid illegal build dependency
  cycle.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycognito?expand=0&rev=2
This commit is contained in:
Markéta Machová 2024-10-07 14:37:10 +00:00 committed by Git OBS Bridge
parent 9bbe89fa8b
commit e3b0c10559
4 changed files with 44 additions and 23 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Oct 7 13:43:57 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Apply spec-cleaner and improve overall spec file quality
- Test in multibuild in order to avoid illegal build dependency
cycle.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 4 07:40:37 UTC 2024 - ecsos <ecsos@opensuse.org> Fri Oct 4 07:40:37 UTC 2024 - ecsos <ecsos@opensuse.org>

View File

@ -0,0 +1,2 @@
# cryptography requirement comes from pyjwt[crypto]
addFilter("python-leftover-require python3.*-cryptography")

View File

@ -16,8 +16,16 @@
# #
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?sle15_python_module_pythons} %{?sle15_python_module_pythons}
Name: python-pycognito Name: python-pycognito%{psuffix}
Version: 2024.5.1 Version: 2024.5.1
Release: 0 Release: 0
Summary: Python class to integrate Boto3's Cognito client Summary: Python class to integrate Boto3's Cognito client
@ -25,57 +33,58 @@ License: Apache-2.0
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/pvizeli/pycognito URL: https://github.com/pvizeli/pycognito
Source: https://files.pythonhosted.org/packages/source/p/pycognito/pycognito-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/p/pycognito/pycognito-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/NabuCasa/pycognito/refs/heads/master/tests.py Source1: https://github.com/NabuCasa/pycognito/raw/refs/tags/%{version}/tests.py
BuildRequires: python-rpm-macros Source99: python-pycognito.rpmlintrc
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
# SECTION test requirements
BuildRequires: %{python_module boto3 >= 1.10.49}
BuildRequires: %{python_module envs >= 1.3}
BuildRequires: %{python_module PyJWT >= 2.8.0}
BuildRequires: %{python_module requests >= 2.22.0}
BuildRequires: %{python_module pytest >= 8.2.1}
BuildRequires: %{python_module freezegun >= 1.5.1}
BuildRequires: %{python_module moto}
BuildRequires: %{python_module joserfc}
BuildRequires: %{python_module requests-mock >= 1.12.1}
# /SECTION
BuildRequires: fdupes BuildRequires: fdupes
Requires: python-boto3 >= 1.10.49 BuildRequires: python-rpm-macros
Requires: python-envs >= 1.3
Requires: python-PyJWT >= 2.8.0 Requires: python-PyJWT >= 2.8.0
Requires: python-boto3 >= 1.10.49
# cryptography requirement comes from pyjwt[crypto]
Requires: python-cryptography >= 3.4.0
Requires: python-envs >= 1.3
Requires: python-requests >= 2.22.0 Requires: python-requests >= 2.22.0
BuildArch: noarch BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module freezegun >= 1.5.1}
BuildRequires: %{python_module joserfc}
BuildRequires: %{python_module moto}
BuildRequires: %{python_module pycognito = %{version}}
BuildRequires: %{python_module pytest >= 8.2.1}
BuildRequires: %{python_module requests-mock >= 1.12.1}
%endif
%python_subpackages %python_subpackages
%description %description
Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support. Python class to integrate Boto3's Cognito client so it is easy to login users. With SRP support.
%prep %prep
%autosetup -p1 -n pycognito-%{version} %autosetup -p1 -n pycognito-%{version}
install %{SOURCE1} . cp %{SOURCE1} ./
%if !%{with test}
%build %build
%pyproject_wheel %pyproject_wheel
%install %install
%pyproject_install %pyproject_install
# Fix python-bytecode-inconsistent-mtime
pushd %{buildroot}%{python_sitelib}
find . -name '*.pyc' -exec rm -f '{}' ';'
python%python_bin_suffix -m compileall *.py ';'
popd
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check %check
donttest="test_srp_requests_http_auth" donttest="test_srp_requests_http_auth"
%pytest -k "not ($donttest)" tests.py %pytest -k "not ($donttest)" tests.py
%endif
%if !%{with test}
%files %{python_files} %files %{python_files}
%doc README.md %doc README.md
%license LICENSE %license LICENSE
%{python_sitelib}/pycognito %{python_sitelib}/pycognito
%{python_sitelib}/pycognito-%{version}.dist-info %{python_sitelib}/pycognito-%{version}.dist-info
%endif
%changelog %changelog