Blob Blame History Raw
%global pypi_name fasjson-client

%if ! 0%{?rhel} || 0%{?rhel} >= 9
%bcond_without tests
%else
%bcond_with tests
%endif

Name:           python-%{pypi_name}
Version:        0.1.0
Release:        1%{?dist}
Summary:        An OpenAPI client for FASJSON

License:        LGPLv3+
URL:            https://github.com/fedora-infra/fasjson-client
Source0:        %{pypi_source}
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3dist(setuptools)
# runtime
BuildRequires:  (python3dist(bravado) >= 10.6 with python3dist(bravado) < 12)
BuildRequires:  (python3dist(click) >= 6.7 with python3dist(click) < 8)
BuildRequires:  (python3dist(cryptography) >= 2.3.3 with python3dist(cryptography) < 4)
BuildRequires:  (python3dist(gssapi) >= 1.5.1 with python3dist(gssapi) < 2)
BuildRequires:  (python3dist(requests) >= 2.20.0 with python3dist(requests) < 3)
BuildRequires:  (python3dist(requests-gssapi) >= 1.2.1 with python3dist(requests-gssapi) < 2)
BuildRequires:  (python3dist(toml) >= 0.10.1 with python3dist(toml) < 0.11)
# unit tests
%if %{with tests}
BuildRequires:  (python3dist(coverage) >= 5.0.3 with python3dist(coverage) < 6)
BuildRequires:  (python3dist(pytest) >= 4.6.11 with python3dist(pytest) < 7)
BuildRequires:  (python3dist(pytest-cov) >= 2.8.1 with python3dist(pytest-cov) < 3)
BuildRequires:  (python3dist(pytest-mock) >= 1.10.4 with python3dist(pytest-mock) < 4)
BuildRequires:  (python3dist(requests-mock) >= 1.7 with python3dist(requests-mock) < 2)
%endif


%description
A python client library for the FASJSON API.

%package -n     python3-%{pypi_name}
Summary:        %{summary}
Provides:       %{pypi_name} = %{version}-%{release}
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
A python client library for the FASJSON API.


%prep
%autosetup -n %{pypi_name}-%{version}

%build
%py3_build

%install
%py3_install

%if %{with tests}
%check
%{__python3} -m pytest -v
%endif

%files -n python3-%{pypi_name}
%license LICENSE
%doc README.md
%{_bindir}/fasjson-client
%{python3_sitelib}/fasjson_client
%{python3_sitelib}/fasjson_client-%{version}-py%{python3_version}.egg-info


%changelog
* Mon Nov 23 2020 Nils Philippsen <nils@redhat.com> - 0.1.0-1
- version 0.1.0
- don't run tests on EPEL8 (too many missing deps)

* Fri Nov 20 2020 Nils Philippsen <nils@redhat.com>
- relax some dependency versions and run tests

* Tue Sep 08 2020 Aurelien Bompard <abompard@fedoraproject.org> - 0.0.3-1
- Initial package.