[AUTOPATCHER-CORE] Upgrade python-sphinx_rtd_theme to 2.0.0 3.0 - Upgrade (#7948)

Co-authored-by: Karim Eldegwy <kimoantiqe@hotmail.com>
This commit is contained in:
CBL-Mariner-Bot 2024-02-27 16:01:31 -08:00 коммит произвёл GitHub
Родитель 63de917783
Коммит 17476b0fad
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 81 добавлений и 107 удалений

Просмотреть файл

@ -10,14 +10,14 @@
"lato-font": "^3.0.0", "lato-font": "^3.0.0",
--- a/package-lock.json --- a/package-lock.json
+++ b/package-lock.json +++ b/package-lock.json
@@ -3246,12 +3246,6 @@ @@ -3314,12 +3314,6 @@
"integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==", "integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==",
"dev": true "dev": true
}, },
- "html5shiv": { - "html5shiv": {
- "version": "3.7.3", - "version": "3.7.3",
- "resolved": "https://registry.npmjs.org/html5shiv/-/html5shiv-3.7.3.tgz", - "resolved": "https://registry.npmjs.org/html5shiv/-/html5shiv-3.7.3.tgz",
- "integrity": "sha1-14qEo2e8uacQEA1XgCw4ewhGMdI=", - "integrity": "sha512-SZwGvLGNtgp8GbgFX7oXEp8OR1aBt5LliX6dG0kdD1kl3KhMonN0QcSa/A3TsTgFewaGCbIryQunjayWDXzxmw==",
- "dev": true - "dev": true
- }, - },
"http-deceiver": { "http-deceiver": {
@ -44,7 +44,7 @@
module.exports = { module.exports = {
entry: { entry: {
@@ -66,11 +65,5 @@ module.exports = { @@ -66,11 +65,5 @@
filename: "css/[name].css?[hash]", filename: "css/[name].css?[hash]",
chunkFilename: "css/[name].css?[hash]" chunkFilename: "css/[name].css?[hash]"
}), }),

Просмотреть файл

@ -1,39 +0,0 @@
Remove deprecated use of script_files
Fixes sphinx-doc/sphinx#6088
* Add script block
* Fix build error
--- sphinx_rtd_theme/layout.html.orig 2019-02-12 12:37:47.000000000 -0700
+++ sphinx_rtd_theme/layout.html 2019-08-06 09:02:26.103136905 -0600
@@ -29,6 +29,7 @@
{% endif %}
{# JAVASCRIPTS #}
+ {%- block scripts %}
<script type="text/javascript" src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
{%- if not embedded %}
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
@@ -62,6 +63,7 @@
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %}
{%- endif %}
+ {%- endblock %}
{# CSS #}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
--- sphinx_rtd_theme/search.html.orig 2019-02-12 12:37:47.000000000 -0700
+++ sphinx_rtd_theme/search.html 2019-08-06 09:03:25.597117851 -0600
@@ -9,7 +9,10 @@
#}
{%- extends "layout.html" %}
{% set title = _('Search') %}
-{% set script_files = script_files + ['_static/searchtools.js'] %}
+{%- block scripts %}
+ {{ super() }}
+ <script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script>
+{%- endblock %}
{% block footer %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1,6 +1,6 @@
{ {
"Signatures": { "Signatures": {
"python-sphinx_rtd_theme-1.0.0.tar.gz": "1439585dba976109eee61b71e5f6176c69cf105dfcd0f5c24fa4fecc348b3afb", "python-sphinx_rtd_theme-objects.inv": "3739235c900e717788e3d83a3ff80caea1142e95fe5f3a92182b263ab5f6f1c9",
"python-sphinx_rtd_theme-objects.inv": "3739235c900e717788e3d83a3ff80caea1142e95fe5f3a92182b263ab5f6f1c9" "python-sphinx_rtd_theme-2.0.0.tar.gz": "40446e6789dd34deb4e9814e379bae0aa74057b6fb43de4b343a48c84fc0f8db"
} }
} }

Просмотреть файл

@ -1,8 +1,8 @@
%global srcname sphinx_rtd_theme %global srcname sphinx_rtd_theme
Summary: Sphinx theme for readthedocs.org Summary: Sphinx theme for readthedocs.org
Name: python-%{srcname} Name: python-%{srcname}
Version: 1.0.0 Version: 2.0.0
Release: 3%{?dist} Release: 1%{?dist}
License: MIT AND OFL License: MIT AND OFL
Vendor: Microsoft Corporation Vendor: Microsoft Corporation
Distribution: Azure Linux Distribution: Azure Linux
@ -14,20 +14,20 @@ Source1: https://docs.readthedocs.io/en/latest/objects.inv#/%{name}-objec
# Remove all traces of html5shiv. We have no interest in supporting ancient # Remove all traces of html5shiv. We have no interest in supporting ancient
# versions of Internet Explorer. # versions of Internet Explorer.
Patch0: %{name}-html5shiv.patch Patch0: %{name}-html5shiv.patch
# Unbundle fonts. Refer to local fonts instead.
Patch1: %{name}-unbundle-fonts.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel BuildRequires: font(fontawesome)
BuildRequires: python3dist(docutils) BuildRequires: font(lato)
BuildRequires: python3dist(setuptools) BuildRequires: font(robotoslab)
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-packaging
BuildRequires: %{py3_dist sphinx}
BuildRequires: %{py3_dist pip}
BuildRequires: %{py3_dist wheel}
%if 0%{?with_check} %if 0%{?with_check}
BuildRequires: python3-atomicwrites BuildRequires: %{py3_dist pytest}
BuildRequires: python3-attrs
BuildRequires: python3-pip
BuildRequires: python3-six
BuildRequires: python3dist(pytest)
%endif %endif
%description %description
@ -36,17 +36,16 @@ It's currently in development and includes some rtd variable checks that
can be ignored if you're just trying to use it on your project outside can be ignored if you're just trying to use it on your project outside
of that site. of that site.
%package -n python3-%{srcname} %package -n python%{python3_pkgversion}-%{srcname}
%{?python_provide:%python_provide python3-%{srcname}} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
Summary: Sphinx theme for readthedocs.org Summary: Sphinx theme for readthedocs.org
Requires: font(fontawesome) Requires: font(fontawesome)
Requires: font(lato) Requires: font(lato)
Requires: font(robotoslab) Requires: font(robotoslab)
Requires: fontawesome-fonts-web
Provides: python3dist(sphinx-rtd-theme) Provides: python3dist(sphinx-rtd-theme)
%description -n python3-%{srcname} %description -n python%{python3_pkgversion}-%{srcname}
This is a prototype mobile-friendly sphinx theme for readthedocs.org. This is a prototype mobile-friendly sphinx theme for readthedocs.org.
It's currently in development and includes some rtd variable checks that It's currently in development and includes some rtd variable checks that
can be ignored if you're just trying to use it on your project outside can be ignored if you're just trying to use it on your project outside
@ -56,39 +55,86 @@ of that site.
%autosetup -p1 -n %{srcname}-%{version} %autosetup -p1 -n %{srcname}-%{version}
# Use local objects.inv for intersphinx # Use local objects.inv for intersphinx
sed -e "s|\('https://docs\.readthedocs\.io/en/latest/', \)None|\1'%{SOURCE1}'|" \ sed -e "s|\('https://docs\.readthedocs\.io/en/stable/', \)None|\1'%{SOURCE1}'|" \
-e "s|\('http://www\.sphinx-doc\.org/en/stable/', \)None|\1'%{_docdir}/python-sphinx-doc/html/objects.inv'|" \ -e "s|\('https://www\.sphinx-doc\.org/en/master/', \)None|\1'%{_docdir}/python-sphinx-doc/html/objects.inv'|" \
-i docs/conf.py -i docs/conf.py
# We modify the tests to avoid dependency on readthedocs-sphinx-ext.
# According to upstream, the test dependency is only used to test integration with that dependency.
# See https://github.com/readthedocs/readthedocs-sphinx-ext/pull/105#pullrequestreview-928253285
sed -Ei -e "/extensions\.append\('readthedocs_ext\.readthedocs'\)/d" \
-e "s/'readthedocs[^']*'(, ?)?//g" \
tests/util.py
# We patch the theme css files to unbundle fonts (they are required from Fedora)
# Using Web Assets shall support the use case when documentation is
# exported via web server
# See: https://docs.fedoraproject.org/en-US/packaging-guidelines/Web_Assets/
pushd sphinx_rtd_theme/static/css
rm -r fonts
# Edit the fonts references in theme.css and badge.css
for FONT in lato-normal=lato/Lato-Regular.ttf \
lato-bold=lato/Lato-Bold.ttf \
lato-normal-italic=lato/Lato-Italic.ttf \
lato-bold-italic=lato/Lato-BoldItalic.ttf \
Roboto-Slab-Regular=google-roboto-slab-fonts/RobotoSlab-Regular.ttf \
Roboto-Slab-Bold=google-roboto-slab-fonts/RobotoSlab-Bold.ttf;
do
L="${FONT%=*}"
R="${FONT#*=}"
# Get the font basename from the path
F="${R#*/}"
F_BASENAME="${F/.ttf}"
sed \
-e "s|src:\(url(fonts/$L\.[^)]*) format([^)]*),\?\)\+|src:local('$F_BASENAME'),url('/.sysassets/fonts/$R') format(\"truetype\")|g" \
-i theme.css
done
sed -e "s|src:url(fonts/fontawesome-webfont\.[^)]*);||" \
-e "s|src:\(url(fonts/fontawesome-webfont\.[^)]*) format([^)]*),\?\)\+|src:local(\"FontAwesome\"),url('/.sysassets/fonts/fontawesome/fontawesome-webfont.ttf') format(\"truetype\")|" \
-i badge_only.css theme.css
popd
# We cannot build the Javascript from source at this time, due to many missing # We cannot build the Javascript from source at this time, due to many missing
# dependencies. Convince the build script to skip building the Javascript and # dependencies. Convince the build script to skip building the Javascript and
# go on to the python. # go on to the python.
mkdir -p build/lib/%{srcname}/static/js mkdir -p build/lib/%{srcname}/static/js
cp -p sphinx_rtd_theme/static/js/badge_only.js build/lib/%{srcname}/static/js cp -p sphinx_rtd_theme/static/js/badge_only.js build/lib/%{srcname}/static/js
cp -p sphinx_rtd_theme/static/js/theme.js build/lib/%{srcname}/static/js cp -p sphinx_rtd_theme/static/js/theme.js build/lib/%{srcname}/static/js
sed -i "/'build_py'/d" setup.py
%generate_buildrequires
%pyproject_buildrequires
%build %build
%py3_build %pyproject_wheel
rst2html3 --no-datestamp README.rst README.html rst2html3 --no-datestamp README.rst README.html
%install %install
%py3_install %pyproject_install
# Unbundle fonts
rm -fr %{buildroot}%{python3_sitelib}/%{srcname}/static/css/fonts
%check %check
pip3 install pluggy more-itertools Sphinx readthedocs-sphinx-ext
%pytest %pytest
# Test that the forbidden fonts were successfully removed from the css files
grep 'format("woff2\?")' \
%{buildroot}%{python3_sitelib}/%{srcname}/static/css/badge_only.css \
%{buildroot}%{python3_sitelib}/%{srcname}/static/css/theme.css \
&& exit 1 || true
%files -n python3-%{srcname} %files -n python3-%{srcname}
%license LICENSE OFL-License.txt %license LICENSE OFL-License.txt
%doc README.html %doc README.html
%{python3_sitelib}/%{srcname}* %{python3_sitelib}/%{srcname}*
%changelog %changelog
* Mon Feb 19 2024 Karim Eldegwy <karimeldegwy@microsoft.com> - 2.0.0-1
- Auto-upgrade to 2.0.0 - 3.0
- Remove outdated patches & Update with Fedora upstream
* Fri Feb 16 2024 Andrew Phelps <anphel@microsoft.com> - 1.0.0-3 * Fri Feb 16 2024 Andrew Phelps <anphel@microsoft.com> - 1.0.0-3
- Add Provides python3dist(sphinx-rtd-theme) - Add Provides python3dist(sphinx-rtd-theme)

Просмотреть файл

@ -24223,8 +24223,8 @@
"type": "other", "type": "other",
"other": { "other": {
"name": "python-sphinx_rtd_theme", "name": "python-sphinx_rtd_theme",
"version": "1.0.0", "version": "2.0.0",
"downloadUrl": "https://github.com/rtfd/sphinx_rtd_theme/archive/1.0.0/sphinx_rtd_theme-1.0.0.tar.gz" "downloadUrl": "https://github.com/rtfd/sphinx_rtd_theme/archive/2.0.0/sphinx_rtd_theme-2.0.0.tar.gz"
} }
} }
}, },