python-docutils/python-docutils.spec

137 lines
4.6 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package python-docutils
#
# Copyright (c) 2024 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/
#
%{?sle15_python_module_pythons}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name: python-docutils%{psuffix}
- Update to 0.20.1: * Include tox.ini and docutils.conf in the source package * Docutils 0.20 is the last version supporting Python 3.7 and 3.8. * Support Python 3.11 (patch #198 by Hugo van Kemenade). * New functions `rst2…()` for use as "console_scripts" `entry points`_. * Fix `previous_sibling()` method that led to invalid HTML in some cases * Fix bug #463. Spurious comma in deprecation warning. * Improved mock Sphinx module. * `Transformer.populate_from_components()` now silently ignores components that are not instances of `docutils.TransformSpec`. * Accept author names with initials like ``A. Einstein`` in the "author" `bibliographic field`_ instead of rising an error * `DanglingReferences` ignores `citation_reference` nodes if the "use_bibex" setting is active. * New utility function `xml_declaration()`. * `DependencyList.add()` accepts `pathlib.Path` instances. * Support "mod" notation for modulo operation / modulus arithmetic. * Wrap definition lists with "details" class argument in a <div> with the "id" and "class" values of the list node. * Use dpub-ARIA role "doc-footnote__" (instead of ARIA role "note") for footnotes. * Do not load the `inputenc` package in UTF-8 encoded LaTeX sources. (UTF-8 is the default encoding for LaTeX2e since 2018). * Fix behaviour of the use_bibtex_ setting. * Outsource parts of `depart_document()` to new auxiliary methods `make_title()` and `append_bibliography()`. * Drop ``\usepackage{fixltx2e}`` from template. * Fix SetuptoolsDeprecationWarning: ``Installing '' as data is deprecated`` by adding data directories to package_data.packages list. * Refactored tests to use common `unittest` idioms. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=88
2023-11-10 03:32:59 +01:00
Version: 0.20.1
Release: 0
Summary: Python Documentation Utilities
- update to 0.17.1: * Fix bug #406 (MathML translation of ``\mathbf``). * Open "docutils.sty" with encoding set to "utf8". * Provide fallbacks for parser config settings to facilitate programmatic use. * Installing with ``setup.py`` now requires ``setuptools``. Alternatively, install with `pip`_ (or "manually"). * Use importlib.import_module() to programmatically import modules. * Fix bug #385: Import of language modules. * Arabic mappings by Shahin. * Fixes in Korean translation by Shinjo Park. * Fix error when copying `system_message` node * Make the sidebar's "title" argument optional * Make "meta" elements available for "latex" and "odt". * Prevent infinite inclusion loops. * Move non-essential styling to ``plain.css``. * Support "captionbelow" class value for tables. * Display code line numbers as pseudo-elements which are skipped when copying text from code blocks. Solves feature request #32. * Support numbered figures. * New optional style that adapts to different screen sizes. * Fix #394 fix missing new line after rubric. * Patch #168 fix crashing on empty citation (by Takeshi KOMIYA). * Fix #126 manpage title with spaces. * Fix #380 commandline option problem in sphinx. * Fix/improve metadata handling: fix "keyword" splitting, allow generic fields (stored as "Custom Properties"). __ docs/user/config.html#detailled * Run python3 test like python2 against source not the build/-directory OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=69
2021-10-16 23:14:28 +02:00
License: BSD-2-Clause AND Python-2.0 AND GPL-2.0-or-later AND GPL-3.0-or-later AND SUSE-Public-Domain
URL: https://pypi.python.org/pypi/docutils/
Source: https://files.pythonhosted.org/packages/source/d/docutils/docutils-%{version}.tar.gz
Source99: python-docutils-rpmlintrc
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(pre): update-alternatives
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-Pillow
Recommends: python-Pygments
Recommends: python-roman
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module Pillow}
BuildRequires: %{python_module Pygments}
BuildRequires: %{python_module packaging}
# BuildRequires: %%{python_module roman}
%endif
%if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3"
Provides: docutils = %{version}
Obsoletes: docutils < %{version}
%endif
%python_subpackages
%description
Docutils is a modular system for processing documentation into useful formats,
such as HTML, XML, and LaTeX. For input Docutils supports reStructuredText, an
easy-to-read, what-you-see-is-what-you-get plaintext markup syntax.
%prep
%autosetup -p1 -n docutils-%{version}
# Remove useless ".py" ending from executables:
for i in tools/rst*; do mv "$i" "${i/.py}"; done
sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py
find . -name \*.mp4 -print -exec chmod -x '{}' \;
# Actually seems to work with Python 3.6
sed -i -e '/python_requires/ s/7/6/' setup.py
# Remove shebang from non-executable files
sed -i '1{/^#!/d}' \
docutils/__main__.py \
docutils/parsers/commonmark_wrapper.py \
docutils/parsers/recommonmark_wrapper.py \
docutils/utils/error_reporting.py \
docutils/utils/math/math2html.py \
docutils/utils/math/tex2unichar.py \
docutils/utils/smartquotes.py \
docutils/writers/_html_base.py \
docutils/writers/odf_odt/prepstyles.py \
docutils/writers/xetex/__init__.py
%build
%pyproject_wheel
%install
%if !%{with test}
%pyproject_install
for binary in docutils rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html rst2html4 rst2html5 ; do
%python_clone -a %{buildroot}%{_bindir}/$binary
done
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
%python_exec test/alltests.py -v
%endif
%if !%{with test}
# sometime ago rst2html was the master which would let fail the upgrade with master docutils in post below
%pre
update-alternatives --query rst2html >/dev/null 2>&1 && update-alternatives --quiet --remove-all rst2html ||:
%post
%python_install_alternative docutils rst2html rst2latex rst2man rst2odt rst2odt_prepstyles rst2pseudoxml rst2s5 rst2xetex rst2xml rstpep2html rst2html4 rst2html5
%postun
%python_uninstall_alternative docutils
%files %{python_files}
%license COPYING.txt licenses/*.txt
%doc FAQ.txt HISTORY.txt README.txt THANKS.txt BUGS.txt docs/*
%python_alternative %{_bindir}/docutils
%python_alternative %{_bindir}/rst2html
%python_alternative %{_bindir}/rst2latex
%python_alternative %{_bindir}/rst2man
%python_alternative %{_bindir}/rst2odt
%python_alternative %{_bindir}/rst2odt_prepstyles
%python_alternative %{_bindir}/rst2pseudoxml
%python_alternative %{_bindir}/rst2s5
%python_alternative %{_bindir}/rst2xetex
%python_alternative %{_bindir}/rst2xml
%python_alternative %{_bindir}/rstpep2html
%python_alternative %{_bindir}/rst2html4
%python_alternative %{_bindir}/rst2html5
%{python_sitelib}/docutils/
- Update to 0.20.1: * Include tox.ini and docutils.conf in the source package * Docutils 0.20 is the last version supporting Python 3.7 and 3.8. * Support Python 3.11 (patch #198 by Hugo van Kemenade). * New functions `rst2…()` for use as "console_scripts" `entry points`_. * Fix `previous_sibling()` method that led to invalid HTML in some cases * Fix bug #463. Spurious comma in deprecation warning. * Improved mock Sphinx module. * `Transformer.populate_from_components()` now silently ignores components that are not instances of `docutils.TransformSpec`. * Accept author names with initials like ``A. Einstein`` in the "author" `bibliographic field`_ instead of rising an error * `DanglingReferences` ignores `citation_reference` nodes if the "use_bibex" setting is active. * New utility function `xml_declaration()`. * `DependencyList.add()` accepts `pathlib.Path` instances. * Support "mod" notation for modulo operation / modulus arithmetic. * Wrap definition lists with "details" class argument in a <div> with the "id" and "class" values of the list node. * Use dpub-ARIA role "doc-footnote__" (instead of ARIA role "note") for footnotes. * Do not load the `inputenc` package in UTF-8 encoded LaTeX sources. (UTF-8 is the default encoding for LaTeX2e since 2018). * Fix behaviour of the use_bibtex_ setting. * Outsource parts of `depart_document()` to new auxiliary methods `make_title()` and `append_bibliography()`. * Drop ``\usepackage{fixltx2e}`` from template. * Fix SetuptoolsDeprecationWarning: ``Installing '' as data is deprecated`` by adding data directories to package_data.packages list. * Refactored tests to use common `unittest` idioms. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=88
2023-11-10 03:32:59 +01:00
%{python_sitelib}/docutils-%{version}.dist-info
%endif
%changelog