Source: python-coverage
Severity: wishlist
Tags: patch

Hi,

I need pypy-coverage for pypy-hypothesis, which i need for pypy-pytest.

Thanks.

Patch attached.

-- System Information:
Debian Release: buster/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'oldstable-updates'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.14.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff --git a/debian/control b/debian/control
index 13bc36b..2554f12 100644
--- a/debian/control
+++ b/debian/control
@@ -14,6 +14,8 @@ Build-Depends:
     python3-setuptools,
     python3-all-dev,
     python3,
+    pypy,
+    pypy-setuptools,
     debhelper (>= 11~)
 Standards-Version: 4.1.3
 Homepage: http://nedbatchelder.com/code/coverage/
@@ -22,6 +24,33 @@ VCS-Browser: 
https://anonscm.debian.org/git/users/bignose/debian/pkg-python-cove
 X-Python-Version: >= 2.6
 X-Python3-Version: >= 3.3
 
+Package: pypy-coverage
+Architecture: any
+Depends:
+    pypy-pkg-resources,
+    ${pypy:Depends},
+    ${shlibs:Depends},
+    ${misc:Depends}
+Recommends:
+    libjs-jquery-isonscreen,
+    libjs-jquery-tablesorter,
+    libjs-jquery-throttle-debounce,
+    libjs-jquery
+Suggests:
+    python-coverage-doc
+Description: code coverage tool for PyPy
+ Coverage.py is a tool for measuring code coverage of Python programs.
+ It monitors your program, noting which parts of the code have been
+ executed, then analyzes the source to identify code that could have
+ been executed but was not.
+ .
+ Coverage measurement is typically used to gauge the effectiveness of
+ tests. It can show which parts of your code are being exercised by
+ tests, and which are not.
+ .
+ This package installs the PyPy version ‘coverage’ library, and the
+ ‘pypy-coverage’ program to perform and report coverage tests.
+
 Package: python3-coverage
 Architecture: any
 Depends:
diff --git a/debian/rules b/debian/rules
index ba57921..71ae33e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,6 +19,7 @@ export PYBUILD_DISABLE = test
 
 PYTHON2_PACKAGE_NAME = python-${PYBUILD_NAME}
 PYTHON3_PACKAGE_NAME = python3-${PYBUILD_NAME}
+PYPY_PACKAGE_NAME = pypy-${PYBUILD_NAME}
 package_working_root = debian
 package_install_root = debian/{package}
 
@@ -68,7 +69,7 @@ SPHINX_OPTS = -N
 
 
 %:
-       dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
+       dh $@ --with python2,python3,pypy,sphinxdoc --buildsystem=pybuild
 
 
 .PHONY: remove-bundled-libraries
@@ -132,6 +133,12 @@ override_dh_auto_install:
        dh_auto_install --buildsystem=pybuild
        $(RM) $(addprefix ${package_working_root}/${PYTHON3_PACKAGE_NAME}/, \
            usr/bin/python-coverage)
+       mv $(addprefix ${package_working_root}/${PYPY_PACKAGE_NAME}/, \
+           usr/bin/python-coverage) \
+           $(addprefix ${package_working_root}/${PYPY_PACKAGE_NAME}/, \
+           usr/bin/pypy-coverage)
+       $(RM) $(addprefix ${package_working_root}/${PYPY_PACKAGE_NAME}/, \
+           usr/bin/python*-coverage)
 
 export PYBUILD_AFTER_INSTALL = \
        $(INSTALL) --mode=u=rwx,go=rx --directory \
@@ -143,7 +150,7 @@ export PYBUILD_AFTER_INSTALL = \
        dh_link \
            --package={package} \
            "/${RESOURCES_DIR}/${htmlfiles_dirname}" \
-           usr/lib/python{version}/dist-packages/${HTMLFILES_DIR}
+           {install_dir}/${HTMLFILES_DIR}
 
 override_dh_installchangelogs:
        dh_installchangelogs CHANGES.rst
@@ -151,6 +158,13 @@ override_dh_installchangelogs:
 override_dh_installman: manpage-aliases
        dh_installman
 
+       mv $(addprefix ${package_working_root}/${PYPY_PACKAGE_NAME}/, \
+           usr/share/man/man1/python3-coverage.1) \
+           $(addprefix ${package_working_root}/${PYPY_PACKAGE_NAME}/, \
+           usr/share/man/man1/pypy-coverage.1)
+       $(RM) $(addprefix ${package_working_root}/${PYPY_PACKAGE_NAME}/, \
+           usr/share/man/man1/python*-coverage.1)
+
 override_dh_auto_clean:
        dh_auto_clean
        $(RM) -r ${GENERATED_FILES}
diff --git a/debian/tests/control b/debian/tests/control
index 01ea172..e2c7662 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -12,6 +12,11 @@ Depends:
     python3-coverage,
     python3-pkg-resources
 
+Tests: smoke-pypy
+Depends:
+    pypy-coverage,
+    pypy-pkg-resources
+
 Test-Command:
     w3m -dump /usr/share/doc/python-coverage/html/index.html > /dev/null
 Depends:
@@ -30,14 +35,18 @@ Depends:
     python3-coverage,
     python3-all,
     python-coverage,
-    python-all
+    python-all,
+    pypy-coverage,
+    pypy,
 
 Tests: module-scripts
 Depends:
     python3-coverage,
     python3-all,
     python-coverage,
-    python-all
+    python-all,
+    pypy-coverage,
+    pypy,
 
 
 # Local variables:
diff --git a/debian/tests/entry-point-scripts b/debian/tests/entry-point-scripts
index c9ae7cf..2a660a3 100644
--- a/debian/tests/entry-point-scripts
+++ b/debian/tests/entry-point-scripts
@@ -15,11 +15,12 @@ set -o errexit
 set -o errtrace
 set -o nounset
 
-COMMAND_TEMPLATE='python%s-coverage'
+COMMAND_TEMPLATE='%s-coverage'
 
-versions=(
-        ''
-        '3' '2'
+entry_points=(
+        'python'
+        'python3' 'python2'
+        'pypy'
 )
 
 test_input_path="$(mktemp -t --suffix=".py")"
@@ -27,8 +28,8 @@ cat > "$test_input_path" <<_EOF_
 print("Hello, world!")
 _EOF_
 
-for ver in "${versions[@]}" ; do
-    command="$(printf "$COMMAND_TEMPLATE" "$ver")"
+for entry_point in "${entry_points[@]}" ; do
+    command="$(printf "$COMMAND_TEMPLATE" "$entry_point")"
     printf "Entry point script: ‘%s’\n" "$command"
     $command run "$test_input_path"
     printf "\n"
diff --git a/debian/tests/module-scripts b/debian/tests/module-scripts
index b39176e..c7c3942 100644
--- a/debian/tests/module-scripts
+++ b/debian/tests/module-scripts
@@ -15,13 +15,14 @@ set -o errexit
 set -o errtrace
 set -o nounset
 
-COMMAND_TEMPLATE='python%s -m coverage'
+COMMAND_TEMPLATE='%s -m coverage'
 
-versions=(
-        ''
-        '3' '2'
-        $(py3versions --version --supported)
-        $(pyversions --version --supported)
+interpreters=(
+        'python'
+        'python3' 'python2'
+        $(py3versions --supported)
+        $(pyversions --supported)
+        'pypy'
 )
 
 test_input_path="$(mktemp -t --suffix=".py")"
@@ -29,8 +30,8 @@ cat > "$test_input_path" <<_EOF_
 print("Hello, world!")
 _EOF_
 
-for ver in "${versions[@]}" ; do
-    command="$(printf "$COMMAND_TEMPLATE" "$ver")"
+for interpreter in "${interpreters[@]}" ; do
+    command="$(printf "$COMMAND_TEMPLATE" "$interpreter")"
     printf "Module script: ‘%s’\n" "$command"
     $command run "$test_input_path"
     printf "\n"

Reply via email to