Init package for version 0.6

This commit is contained in:
wangdi 2021-07-07 10:35:52 +08:00
parent a938942820
commit 019a33e5dd
3 changed files with 111 additions and 0 deletions

BIN
0.6.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,65 @@
%global pypi_name sphinx-notfound-page
%global srcname sphinx_notfound_page
%global importname notfound
%global project_owner readthedocs
%global github_name sphinx-notfound-page
%global desc Create a custom 404 page with absolute URLs hardcoded
Name: python-%{pypi_name}
Version: 0.6
Release: 1
Summary: Create a custom 404 page with absolute URLs hardcoded
License: MIT
URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://github.com/%{project_owner}/%{github_name}/archive/%{version}.tar.gz
# Fix compatibility with Sphinx 3.4
# Resolved upstream: https://github.com/readthedocs/sphinx-notfound-page/pull/127
Patch0: sphinx-3.4-compatibility.patch
BuildArch: noarch
%description
%desc
%package -n python%{python3_pkgversion}-%{pypi_name}
Summary: %{summary}
BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python3-pytest
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
Requires: python%{python3_pkgversion}-setuptools
Requires: python%{python3_pkgversion}-sphinx
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
%description -n python%{python3_pkgversion}-%{pypi_name}
%desc
%prep
%autosetup -n %{pypi_name}-%{version} -p1
%build
%py3_build
%install
%py3_install
%check
PYTHONPATH="$(pwd)" py.test-%{python3_version} -v .
%files -n python%{python3_pkgversion}-%{pypi_name}
%license LICENSE
%doc README.rst CHANGELOG.rst docs
%{python3_sitelib}/%{srcname}-%{version}*-py%{python3_version}.egg-info/
%{python3_sitelib}/%{importname}/
%changelog
* Wed Jul 07 2021 wangdi <wangdi@kylinos.cn> - 0.6-1
- Init package

View File

@ -0,0 +1,46 @@
diff --git a/tests/test_urls.py b/tests/test_urls.py
index 3e0d0f3..1d9736d 100644
--- a/tests/test_urls.py
+++ b/tests/test_urls.py
@@ -33,7 +33,7 @@ def test_parallel_build():
# TODO: migrate to `app.build(..., parallel=2)` after merging
# https://github.com/sphinx-doc/sphinx/pull/8257
subprocess.check_call('sphinx-build -j 2 -W -b html tests/examples/parallel-build build', shell=True)
-
+
@pytest.mark.sphinx(srcdir=srcdir)
def test_404_page_created(app, status, warning):
app.build()
@@ -529,7 +529,10 @@ def test_sphinx_resource_urls(app, status, warning):
'<script src="/en/latest/_static/doctools.js"></script>',
]
- if sphinx.version_info >= (1, 8):
+ # This file was added to all the HTML pages in Sphinx>=1.8. However, it was
+ # only required for search page. Sphinx>=3.4 fixes this and only adds it on
+ # search. See (https://github.com/sphinx-doc/sphinx/blob/v3.4.0/CHANGES#L87)
+ if (1, 8) <= sphinx.version_info < (3, 4, 0):
if sphinx.version_info < (2, 4, 0):
chunks.append(
'<script type="text/javascript" src="/en/latest/_static/language_data.js"></script>',
diff --git a/tox.ini b/tox.ini
index 47c0ce6..eade55e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,7 +2,7 @@
envlist =
docs
py27-sphinx{17,18}
- py{36,37,38}-sphinx{17,18,20,21,22,23,24,30,31,32,33}
+ py{36,37,38}-sphinx{17,18,20,21,22,23,24,30,31,32,33,34}
[testenv]
deps =
@@ -20,6 +20,7 @@ deps =
sphinx31: sphinx~=3.1.0
sphinx32: sphinx~=3.2.0
sphinx33: sphinx~=3.3.0
+ sphinx34: sphinx~=3.4.0
commands = pytest {posargs}
[testenv:py38-sphinx30]