bb4d82f
%bcond_without tests
e21f96d
bb4d82f
Name:           python-fasjson-client
a417c5c
Version:        1.0.8
1f15597
Release:        %autorelease
e21f96d
Summary:        An OpenAPI client for FASJSON
e21f96d
bb4d82f
License:        LGPL-3.0-or-later
e21f96d
URL:            https://github.com/fedora-infra/fasjson-client
bb4d82f
Source:         %{pypi_source fasjson-client}
e21f96d
BuildArch:      noarch
e21f96d
e21f96d
BuildRequires:  python3-devel
e21f96d
%if %{with tests}
bb4d82f
BuildRequires:  python3-pytest
bb4d82f
BuildRequires:  python3-pytest-mock
bb4d82f
BuildRequires:  python3-requests-mock
e21f96d
%endif
e21f96d
bb4d82f
%global _description %{expand:
bb4d82f
A python client library for the FASJSON API.}
d9a2404
bb4d82f
bb4d82f
%description %_description
bb4d82f
bb4d82f
bb4d82f
%package -n     python3-fasjson-client
d9a2404
Summary:        %{summary}
e21f96d
e21f96d
bb4d82f
%description -n python3-fasjson-client %_description
bb4d82f
bb4d82f
bb4d82f
%pyproject_extras_subpkg -n python3-fasjson-client cli
bb4d82f
353caa2
353caa2
%package -n     fasjson-client
353caa2
Summary:        %{summary} - CLI
bb4d82f
Requires:       python3-fasjson-client+cli = %{version}-%{release}
353caa2
319865f
353caa2
%description -n fasjson-client
353caa2
A command line interface for the FASJSON API.
e21f96d
bb4d82f
e21f96d
%prep
bb4d82f
%autosetup -n fasjson-client-%{version} -p 1
bb4d82f
bb4d82f
bb4d82f
%generate_buildrequires
bb4d82f
%pyproject_buildrequires -x cli
bb4d82f
e21f96d
e21f96d
%build
bb4d82f
%pyproject_wheel
bb4d82f
e21f96d
e21f96d
%install
bb4d82f
%pyproject_install
bb4d82f
%pyproject_save_files fasjson_client
bb4d82f
bb4d82f
# extra files we don't want to package
bb4d82f
rm %{buildroot}%{python3_sitelib}/{config.toml.example,tox.ini}
bb4d82f
e21f96d
e21f96d
%check
bb4d82f
%if %{with tests}
bb4d82f
# upstream runs pytest from within tox, but that includes lots of coverage
bb4d82f
# flags we don't want
bb4d82f
%pytest -v fasjson_client/tests/unit
bb4d82f
%else
bb4d82f
# even when tests are skipped, make sure the module imports correctly
bb4d82f
%pyproject_check_import -e 'fasjson_client.tests*'
e21f96d
%endif
e21f96d
bb4d82f
bb4d82f
%files -n python3-fasjson-client -f %{pyproject_files}
e21f96d
%license LICENSE
e21f96d
%doc README.md
bb4d82f
e21f96d
353caa2
%files -n fasjson-client
353caa2
%{_bindir}/fasjson-client
353caa2
e21f96d
e21f96d
%changelog
1f15597
%autochangelog