File python-drf-spectacular.spec of Package python-drf-spectacular

#
# spec file for package python-drf-spectacular
#
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/

%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}
Name:           python-drf-spectacular
Version:        0.26.4
Release:        0
License:        BSD-3-Clause
Summary:        OpenAPI 3 schema generation for Django REST framework
Url:            https://github.com/tfranzel/drf-spectacular
Group:          Development/Languages/Python
Source:         https://github.com/tfranzel/drf-spectacular/archive/%{version}.tar.gz#/drf-spectacular-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
# SECTION test requirements
BuildRequires:  %{python_module Django >= 2.2}
BuildRequires:  %{python_module djangorestframework >= 3.10}
BuildRequires:  %{python_module drf-jwt >= 0.13.0}
BuildRequires:  %{python_module djangorestframework-simplejwt}
#>= 4.4.0}
BuildRequires:  %{python_module django-polymorphic >= 2.1.2}
BuildRequires:  %{python_module django-rest-polymorphic >= 0.1.8}
BuildRequires:  %{python_module django-oauth-toolkit >= 1.3.0}
#BuildRequires:  %{python_module djangorestframework-camel-case >= 1.1.2}
BuildRequires:  %{python_module inflection >= 0.4.0}
BuildRequires:  %{python_module jsonschema >= 3.2.0}
%if %{with test}
BuildRequires:  %{python_module pytest-django >= 3.8.0}
%endif
BuildRequires:  %{python_module PyYAML >= 5.1}
BuildRequires:  %{python_module uritemplate >= 3.0.0}
# /SECTION
BuildRequires:  fdupes
Requires:       python-Django >= 2.2
Requires:       python-djangorestframework >= 3.10
Requires:       python-inflection >= 0.4.0
Requires:       python-jsonschema >= 3.2.0
Requires:       python-PyYAML >= 5.1
Requires:       python-uritemplate >= 3.0.0
BuildArch:      noarch

%python_subpackages

%description
Sane and flexible OpenAPI 3 schema generation for Django REST framework.

%prep
%setup -q -n drf-spectacular-%{version}
# Deleting this avoids the need to also package djangorestframework-camel-case
rm tests/contrib/test_djangorestframework_camel_case.py

%if %{with test}
%check
%pytest

%else  # without test

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}


%files %{python_files}
%doc CHANGELOG.rst README.rst
%license LICENSE
%{python_sitelib}/*
%endif

%changelog
openSUSE Build Service is sponsored by