1
0
python-sphinx-autodoc-typeh.../python-sphinx-autodoc-typehints.spec

74 lines
2.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-sphinx-autodoc-typehints
#
Accepting request 975167 from home:mcepl:branches:devel:languages:python - Upgrade to 1.18.1: - Fix mocked module import not working when used as guarded import - Support and require nptyping>=2 - Handle UnionType - Mark it as requiring nptyping<2 - Add typehints_use_rtype option - Handles TypeError when getting source code via inspect - Add support for type subscriptions with multiple elements, where one or more elements are tuples; e.g., nptyping.NDArray[(Any, ...), nptyping.Float] - Fix bug for arbitrary types accepting singleton subscriptions; e.g., nptyping.Float[64] - Resolve forward references - Expand and better handle TypeVar - Add intershpinx reference link for ... to Ellipsis (as is just an alias) - Prevents reaching inner blocks that contains if TYPE_CHECKING - Log a warning instead of crashing when a type guard import fails to resolve - When resolving type guard imports if the target module does not have source code (such is the case for C-extension modules) do nothing instead of crashing - Fix fully_qualified should be typehints_fully_qualified - Resolve type guard imports before evaluating annotations for objects - Remove set_type_checking_flag flag as this is now done by default - Fix crash when the inspect module returns an invalid python syntax source - Made formatting function configurable using the option typehints_formatter - Fixed normalize_source_lines() messing with the indentation of methods with decorators that have parameters starting with def. - Handle ValueError or TypeError being raised when signature of an object cannot be determined - Fix KeyError being thrown when argument is not documented (e.g. cls argument for class methods, and self for methods) - Added typehints_defaults config option allowing to automatically annotate parameter defaults. - Fixed NewType inserts a reference as first argument instead of a string - Dropped Python 3.6 support - Python 3.10 support - Normalize async functions properly - Allow py310 style annotations (PEP-563) OBS-URL: https://build.opensuse.org/request/show/975167 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=25
2022-05-05 12:40:05 +02:00
# Copyright (c) 2022 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
Accepting request 975167 from home:mcepl:branches:devel:languages:python - Upgrade to 1.18.1: - Fix mocked module import not working when used as guarded import - Support and require nptyping>=2 - Handle UnionType - Mark it as requiring nptyping<2 - Add typehints_use_rtype option - Handles TypeError when getting source code via inspect - Add support for type subscriptions with multiple elements, where one or more elements are tuples; e.g., nptyping.NDArray[(Any, ...), nptyping.Float] - Fix bug for arbitrary types accepting singleton subscriptions; e.g., nptyping.Float[64] - Resolve forward references - Expand and better handle TypeVar - Add intershpinx reference link for ... to Ellipsis (as is just an alias) - Prevents reaching inner blocks that contains if TYPE_CHECKING - Log a warning instead of crashing when a type guard import fails to resolve - When resolving type guard imports if the target module does not have source code (such is the case for C-extension modules) do nothing instead of crashing - Fix fully_qualified should be typehints_fully_qualified - Resolve type guard imports before evaluating annotations for objects - Remove set_type_checking_flag flag as this is now done by default - Fix crash when the inspect module returns an invalid python syntax source - Made formatting function configurable using the option typehints_formatter - Fixed normalize_source_lines() messing with the indentation of methods with decorators that have parameters starting with def. - Handle ValueError or TypeError being raised when signature of an object cannot be determined - Fix KeyError being thrown when argument is not documented (e.g. cls argument for class methods, and self for methods) - Added typehints_defaults config option allowing to automatically annotate parameter defaults. - Fixed NewType inserts a reference as first argument instead of a string - Dropped Python 3.6 support - Python 3.10 support - Normalize async functions properly - Allow py310 style annotations (PEP-563) OBS-URL: https://build.opensuse.org/request/show/975167 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=25
2022-05-05 12:40:05 +02:00
Version: 1.18.1
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
Accepting request 975167 from home:mcepl:branches:devel:languages:python - Upgrade to 1.18.1: - Fix mocked module import not working when used as guarded import - Support and require nptyping>=2 - Handle UnionType - Mark it as requiring nptyping<2 - Add typehints_use_rtype option - Handles TypeError when getting source code via inspect - Add support for type subscriptions with multiple elements, where one or more elements are tuples; e.g., nptyping.NDArray[(Any, ...), nptyping.Float] - Fix bug for arbitrary types accepting singleton subscriptions; e.g., nptyping.Float[64] - Resolve forward references - Expand and better handle TypeVar - Add intershpinx reference link for ... to Ellipsis (as is just an alias) - Prevents reaching inner blocks that contains if TYPE_CHECKING - Log a warning instead of crashing when a type guard import fails to resolve - When resolving type guard imports if the target module does not have source code (such is the case for C-extension modules) do nothing instead of crashing - Fix fully_qualified should be typehints_fully_qualified - Resolve type guard imports before evaluating annotations for objects - Remove set_type_checking_flag flag as this is now done by default - Fix crash when the inspect module returns an invalid python syntax source - Made formatting function configurable using the option typehints_formatter - Fixed normalize_source_lines() messing with the indentation of methods with decorators that have parameters starting with def. - Handle ValueError or TypeError being raised when signature of an object cannot be determined - Fix KeyError being thrown when argument is not documented (e.g. cls argument for class methods, and self for methods) - Added typehints_defaults config option allowing to automatically annotate parameter defaults. - Fixed NewType inserts a reference as first argument instead of a string - Dropped Python 3.6 support - Python 3.10 support - Normalize async functions properly - Allow py310 style annotations (PEP-563) OBS-URL: https://build.opensuse.org/request/show/975167 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=25
2022-05-05 12:40:05 +02:00
Source: https://files.pythonhosted.org/packages/source/s/sphinx-autodoc-typehints/sphinx_autodoc_typehints-%{version}.tar.gz
# 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.
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
Accepting request 975167 from home:mcepl:branches:devel:languages:python - Upgrade to 1.18.1: - Fix mocked module import not working when used as guarded import - Support and require nptyping>=2 - Handle UnionType - Mark it as requiring nptyping<2 - Add typehints_use_rtype option - Handles TypeError when getting source code via inspect - Add support for type subscriptions with multiple elements, where one or more elements are tuples; e.g., nptyping.NDArray[(Any, ...), nptyping.Float] - Fix bug for arbitrary types accepting singleton subscriptions; e.g., nptyping.Float[64] - Resolve forward references - Expand and better handle TypeVar - Add intershpinx reference link for ... to Ellipsis (as is just an alias) - Prevents reaching inner blocks that contains if TYPE_CHECKING - Log a warning instead of crashing when a type guard import fails to resolve - When resolving type guard imports if the target module does not have source code (such is the case for C-extension modules) do nothing instead of crashing - Fix fully_qualified should be typehints_fully_qualified - Resolve type guard imports before evaluating annotations for objects - Remove set_type_checking_flag flag as this is now done by default - Fix crash when the inspect module returns an invalid python syntax source - Made formatting function configurable using the option typehints_formatter - Fixed normalize_source_lines() messing with the indentation of methods with decorators that have parameters starting with def. - Handle ValueError or TypeError being raised when signature of an object cannot be determined - Fix KeyError being thrown when argument is not documented (e.g. cls argument for class methods, and self for methods) - Added typehints_defaults config option allowing to automatically annotate parameter defaults. - Fixed NewType inserts a reference as first argument instead of a string - Dropped Python 3.6 support - Python 3.10 support - Normalize async functions properly - Allow py310 style annotations (PEP-563) OBS-URL: https://build.opensuse.org/request/show/975167 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-autodoc-typehints?expand=0&rev=25
2022-05-05 12:40:05 +02:00
%autosetup -p1 -n sphinx_autodoc_typehints-%{version}
%build
%python_build
%python_expand sed -i -e 's/@PYTHON_VERSION@/%{$python_version}/' tests/conftest.py
%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