2019-03-22 11:14:22 +01:00
|
|
|
#
|
2024-02-01 21:56:11 +01:00
|
|
|
# spec file for package python-sphinx-autodoc-typehints
|
2019-03-22 11:14:22 +01:00
|
|
|
#
|
2024-01-14 11:22:38 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-03-22 11:14:22 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-03-23 16:56:31 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2019-03-22 11:14:22 +01:00
|
|
|
|
|
|
|
|
2022-05-09 16:09:48 +02:00
|
|
|
%define modname sphinx_autodoc_typehints
|
2022-05-11 12:08:49 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2023-07-21 18:10:02 +02:00
|
|
|
|
|
|
|
%{?sle15_python_module_pythons}
|
2022-05-11 12:08:49 +02:00
|
|
|
Name: python-sphinx-autodoc-typehints%{psuffix}
|
2024-02-01 21:56:11 +01:00
|
|
|
Version: 1.25.3
|
2019-03-22 11:14:22 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Type hints (PEP 484) support for the Sphinx autodoc extension
|
2019-03-23 16:56:31 +01:00
|
|
|
License: MIT
|
2019-03-22 11:14:22 +01:00
|
|
|
Group: Development/Languages/Python
|
2019-07-03 11:14:31 +02:00
|
|
|
URL: https://github.com/agronholm/sphinx-autodoc-typehints
|
2022-06-07 01:04:59 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/s/sphinx_autodoc_typehints/sphinx_autodoc_typehints-%{version}.tar.gz
|
2022-05-05 12:40:05 +02:00
|
|
|
# PATCH-FIX-OPENSUSE python-sphinx-autodoc-typehints-system-object.inv.patch gh#agronholm/sphinx-autodoc-typehints#174 mcepl@suse.com
|
|
|
|
# Don't download inventory from the Internet, but use the local one.
|
2021-04-23 18:21:14 +02:00
|
|
|
Patch0: python-sphinx-autodoc-typehints-system-object.inv.patch
|
2024-01-14 11:22:38 +01:00
|
|
|
BuildRequires: %{python_module hatch_vcs}
|
2022-06-07 01:04:29 +02:00
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
BuildRequires: %{python_module wheel}
|
2019-03-22 11:14:22 +01:00
|
|
|
BuildRequires: fdupes
|
2019-03-23 16:56:31 +01:00
|
|
|
BuildRequires: python-rpm-macros
|
2019-07-03 11:14:31 +02:00
|
|
|
Requires: python-Sphinx >= 1.7
|
|
|
|
BuildArch: noarch
|
2022-05-11 12:08:49 +02:00
|
|
|
%if %{with test}
|
2019-03-22 11:14:22 +01:00
|
|
|
# SECTION tests
|
|
|
|
BuildRequires: %{python_module Sphinx >= 1.7}
|
2020-03-09 09:51:39 +01:00
|
|
|
BuildRequires: %{python_module doc}
|
2022-05-09 16:05:14 +02:00
|
|
|
BuildRequires: %{python_module nptyping}
|
2019-03-23 16:56:31 +01:00
|
|
|
BuildRequires: %{python_module pytest}
|
2020-03-09 09:51:39 +01:00
|
|
|
BuildRequires: %{python_module sphobjinv}
|
2019-03-22 11:14:22 +01:00
|
|
|
BuildRequires: %{python_module typing_extensions}
|
2022-05-11 12:08:49 +02:00
|
|
|
%endif
|
2019-03-22 11:14:22 +01:00
|
|
|
# /SECTION
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
This is a Sphinx extension which allows to use Python 3 annotations for documenting acceptable argument types
|
|
|
|
and return value types of functions.
|
|
|
|
|
|
|
|
%prep
|
2022-05-05 12:40:05 +02:00
|
|
|
%autosetup -p1 -n sphinx_autodoc_typehints-%{version}
|
2019-03-22 11:14:22 +01:00
|
|
|
|
|
|
|
%build
|
2022-06-07 01:04:29 +02:00
|
|
|
%pyproject_wheel
|
2021-04-23 18:21:14 +02:00
|
|
|
%python_expand sed -i -e 's/@PYTHON_VERSION@/%{$python_version}/' tests/conftest.py
|
2019-03-22 11:14:22 +01:00
|
|
|
|
|
|
|
%install
|
2022-05-11 12:08:49 +02:00
|
|
|
%if %{without test}
|
2022-06-07 01:04:29 +02:00
|
|
|
%pyproject_install
|
2019-03-22 11:14:22 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2022-05-11 12:08:49 +02:00
|
|
|
%endif
|
2019-03-22 11:14:22 +01:00
|
|
|
|
|
|
|
%check
|
2022-05-11 12:08:49 +02:00
|
|
|
export PYTHONPATH=./src
|
|
|
|
%if %{with test}
|
2019-09-10 12:06:41 +02:00
|
|
|
# test_sphinx_output -- too depenedent on sphinx version available
|
2022-05-09 16:05:14 +02:00
|
|
|
# gh#tox-dev/sphinx-autodoc-typehints#229
|
|
|
|
%pytest -k 'not (test_sphinx_output or test_format_annotation)'
|
2022-05-11 12:08:49 +02:00
|
|
|
%endif
|
2019-03-22 11:14:22 +01:00
|
|
|
|
2022-05-11 12:08:49 +02:00
|
|
|
%if %{without test}
|
2019-03-22 11:14:22 +01:00
|
|
|
%files %{python_files}
|
|
|
|
%license LICENSE
|
2022-05-09 16:05:14 +02:00
|
|
|
%doc README.md CHANGELOG.md
|
2022-05-09 16:09:48 +02:00
|
|
|
%{python_sitelib}/%{modname}-%{version}*-info
|
|
|
|
%{python_sitelib}/%{modname}
|
2022-05-11 12:08:49 +02:00
|
|
|
%endif
|
2019-03-22 11:14:22 +01:00
|
|
|
|
|
|
|
%changelog
|