forked from pool/python-sphinx-autodoc-typehints
1b523451b8
- version update to 1.10.3 * Fixed ``TypeError`` (or wrong rendered class name) when an annotation is a generic class that has a ``name`` property * Fixed inner classes missing their parent class name(s) when rendered * Fixed ``KeyError`` when encountering mocked annotations (``autodoc_mock_imports``) * Rewrote the annotation formatting logic (fixes Python 3.5.2 compatibility regressions and an ``AttributeError`` regression introduced in v1.9.0) * Fixed decorator classes not being processed as classes * Added support for typing_extensions_ * Added the ``typehints_document_rtype`` option (PR by Simon-Martin Schröder) * Fixed metaclasses as annotations causing ``TypeError`` * Fixed rendering of ``typing.Literal`` * Fixed OSError when generating docs for SQLAlchemy mapped classes * Fixed unparametrized generic classes being rendered with their type parameters (e.g. ``Dict[~KT, ~VT]``) - added patches fix use object.inv which comes with python-doc + python-sphinx-autodoc-typehints-system-object.inv.patch OBS-URL: https://build.opensuse.org/request/show/782143 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=12
73 lines
2.5 KiB
RPMSpec
73 lines
2.5 KiB
RPMSpec
#
|
|
# spec file for package python-sphinx-autodoc-typehints
|
|
#
|
|
# Copyright (c) 2020 SUSE LLC
|
|
#
|
|
# 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 https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
%define skip_python2 1
|
|
Name: python-sphinx-autodoc-typehints
|
|
Version: 1.10.3
|
|
Release: 0
|
|
Summary: Type hints (PEP 484) support for the Sphinx autodoc extension
|
|
License: MIT
|
|
Group: Development/Languages/Python
|
|
URL: https://github.com/agronholm/sphinx-autodoc-typehints
|
|
Source: https://files.pythonhosted.org/packages/source/s/sphinx-autodoc-typehints/sphinx-autodoc-typehints-%{version}.tar.gz
|
|
# use object.inv which comes with python-doc; TODO more elegant solution
|
|
Patch0: python-sphinx-autodoc-typehints-system-object.inv.patch
|
|
BuildRequires: %{python_module setuptools >= 36.2.7}
|
|
BuildRequires: %{python_module setuptools_scm >= 1.7.0}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
Requires: python-Sphinx >= 1.7
|
|
Requires: python-typing_extensions
|
|
BuildArch: noarch
|
|
# SECTION tests
|
|
BuildRequires: %{python_module Sphinx >= 1.7}
|
|
BuildRequires: %{python_module doc}
|
|
BuildRequires: %{python_module pathlib}
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module sphobjinv}
|
|
BuildRequires: %{python_module typing_extensions}
|
|
# /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
|
|
%setup -q -n sphinx-autodoc-typehints-%{version}
|
|
%patch0 -p1
|
|
|
|
%build
|
|
%python_build
|
|
|
|
%install
|
|
%python_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
# test_sphinx_output -- too depenedent on sphinx version available
|
|
%pytest -k 'not test_sphinx_output'
|
|
|
|
%files %{python_files}
|
|
%{python_sitelib}/*
|
|
%license LICENSE
|
|
%doc README.rst CHANGELOG.rst
|
|
|
|
%changelog
|