New upstream version: split out docs into separate package

This commit is contained in:
Julian Gilbey 2022-07-15 18:46:45 +01:00
parent 5c351ccd14
commit 9c1c3b0913
10 changed files with 107 additions and 14 deletions

9
debian/changelog vendored
View file

@ -1,3 +1,12 @@
pytest-mock (3.8.2-1) unstable; urgency=medium
* Team upload
* New upstream version: this introduces sphinx-based documentation, so
split that out into a new package
* Explicitly depend on pytest 7
-- Julian Gilbey <jdg@debian.org> Fri, 15 Jul 2022 18:46:34 +0100
pytest-mock (3.7.0-2) unstable; urgency=medium
* Team upload

50
debian/control vendored
View file

@ -5,12 +5,16 @@ Section: python
Priority: optional
Build-Depends: debhelper-compat (= 13),
dh-python,
dh-sequence-python3,
python3-all,
python3-pytest,
python3-mock,
python3-pytest (>= 7.1.2),
python3-pytest-asyncio (>= 0.18),
python3-setuptools,
python3-setuptools-scm
Build-Conflicts: python3-mock
python3-setuptools-scm,
python3-sphinx-copybutton <!nodoc>,
python3-sphinx-rtd-theme <!nodoc>,
sphinx <!nodoc>
Standards-Version: 4.6.1
Vcs-Browser: https://salsa.debian.org/python-team/packages/pytest-mock
Vcs-Git: https://salsa.debian.org/python-team/packages/pytest-mock.git
@ -19,15 +23,37 @@ Rules-Requires-Root: no
Package: python3-pytest-mock
Architecture: all
Depends: ${misc:Depends},
${python3:Depends},
python3-pytest (>= 3.0.3) | python3-pytest (<< 3)
Depends: python3-pytest (>= 3.0.3) | python3-pytest (<< 3),
${misc:Depends},
${python3:Depends}
Recommends: ${python3:Recommends}
Suggests: ${python3:Suggests}
Description: thin-wrapper around mock for easier use with py.test (Python 3 module)
This plugin installs a "mocker" fixture which is a thin-wrapper
around the patching API provided by the excellent "mock" package, but
with the benefit of not having to worry about undoing patches at the
end of a test.
Suggests: python-pytest-mock-doc,
python3-mock,
${python3:Suggests}
Description: Thin wrapper around mock for easier use with pytest (Python 3 module)
This plugin installs a "mocker" fixture which is a thin wrapper
around the patching API provided by the excellent "mock" package or
by unittest.mock, but with the benefit of not having to worry about
undoing patches at the end of a test. It also provides other nice
utilities such as spy and stub, and uses pytest introspection when
comparing calls.
.
This package provides the Python 3 module.
Package: python-pytest-mock-doc
Architecture: all
Section: doc
Depends: ${misc:Depends},
${sphinxdoc:Depends}
Recommends: python3-pytest-mock
Multi-Arch: foreign
Description: Documentation of the Pytest Mock plugin (HTML)
The pytest-mock plugin installs a "mocker" fixture which is a thin
wrapper around the patching API provided by the excellent "mock" package
or by unittest.mock, but with the benefit of not having to worry about
undoing patches at the end of a test. It also provides other nice
utilities such as spy and stub, and uses pytest introspection when
comparing calls.
.
This package contains the HTML documentation of the pytest-mock plugin.
Build-Profiles: <!nodoc>

View file

@ -0,0 +1,18 @@
Description: Use already packaged theme for documentation
Upstream uses the furo theme, which has not been packaged for Debian.
We switch to the common RTD theme instead.
Forwarded: not-needed
Author: Julian Gilbey <jdg@debian.org>
Last-Update: 2022-07-15
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -42,7 +42,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
-html_theme = "furo"
+html_theme = "sphinx_rtd_theme"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,

1
debian/patches/series vendored Normal file
View file

@ -0,0 +1 @@
change_sphinx_theme.patch

10
debian/python-pytest-mock-doc.doc-base vendored Normal file
View file

@ -0,0 +1,10 @@
Document: pytest-mock
Title: Pytest Mock Manual
Author: Bruno Oliveira <nicoddemus@gmail.com>
Abstract: This manual describes the pytest-mock plugin for pytest,
which provides a thin wrapper around the "mock" package.
Section: Programming/Python
Format: HTML
Index: /usr/share/doc/python3-pytest-mock/html/index.html
Files: /usr/share/doc/python3-pytest-mock/html/*.html

1
debian/python-pytest-mock-doc.docs vendored Normal file
View file

@ -0,0 +1 @@
docs/_build/html

View file

@ -0,0 +1,9 @@
Debian pytest-mock package
==========================
The HTML documentation for pytest-mock is available in the package
python-pytest-mock-doc, and is available in
/usr/share/doc/python3-pytest-mock/html
when that package is installed.
-- Julian Gilbey <jdg@debian.org>, Fri, 15 Jul 2022 09:01:41 +0100

20
debian/rules vendored
View file

@ -4,13 +4,31 @@ export PYBUILD_NAME=pytest-mock
# Add the pytest-mock egg to the build dir, so pytest can find it when
# running the tests.
# The --assert=plain is needed to skip four tests; see
# https://github.com/pytest-dev/pytest-mock/issues/102
# for more information.
export PYBUILD_BEFORE_TEST=cp -r {dir}/src/*.egg-info {build_dir}
export PYBUILD_TEST_ARGS=--assert=plain {dir}/tests
export PYBUILD_AFTER_TEST=rm -rf {build_dir}/*.egg-info
ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
%:
dh $@ --with python3 --buildsystem=pybuild
dh $@ --with sphinxdoc --buildsystem=pybuild
execute_after_dh_auto_build:
mkdir docs/_static
sphinx-build -W --keep-going -b html docs docs/_build/html
override_dh_installdocs:
dh_installdocs -ppython-pytest-mock-doc --doc-main-package=python3-pytest-mock
dh_installdocs --remaining-packages
else
%:
dh $@ --buildsystem=pybuild
endif
override_dh_auto_clean:
dh_auto_clean
rm -rf docs/_build docs/_static
rm -f src/pytest_mock/_version.py

View file

@ -6,6 +6,7 @@ Test-Command: set -e
; $py -m pytest -v --assert=plain -o asyncio_mode=auto
; done
Depends: python3-all,
python3-pytest,
python3-mock,
python3-pytest (>= 7.1.2),
python3-pytest-asyncio (>= 0.18),
python3-pytest-mock