[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: Check for packages that alternatively Build-Depend on the Python 2 and Python 3 versions of Sphinx. (Closes: #870758)



This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit 1bba812c0a588d7567fb542832ff2edf6f77555e
Author: Chris Lamb <lamby@debian.org>
Date:   Fri Aug 4 15:29:37 2017 -0400

    Check for packages that alternatively Build-Depend on the Python 2 and Python 3 versions of Sphinx. (Closes: #870758)
---
 checks/python.desc                                      | 12 ++++++++++++
 checks/python.pm                                        |  4 ++++
 debian/changelog                                        |  2 ++
 .../debian/debian/control.in                            | 17 +++++++++++++++++
 t/tests/python-build-depends-on-sphinx-alternative/desc |  5 +++++
 t/tests/python-build-depends-on-sphinx-alternative/tags |  1 +
 t/tests/python-build-depends-on-sphinx-unrel/desc       |  1 +
 t/tests/python-build-depends-on-sphinx/desc             |  2 ++
 8 files changed, 44 insertions(+)

diff --git a/checks/python.desc b/checks/python.desc
index 0d6da56..ebaefc1 100644
--- a/checks/python.desc
+++ b/checks/python.desc
@@ -39,3 +39,15 @@ Info: This package Build-Depends on the Python 2.x version of the Sphinx
  Some Python modules may need to depend on both <tt>python-sphinx</tt> and
  <tt>python3-sphinx</tt> but please consider moving to only Build-Depending on
  the <tt>python3-sphinx</tt> package instead.
+
+Tag: alternatively-build-depends-on-python-sphinx-and-python3-sphinx
+Severity: normal
+Certainty: certain
+Info: This package alternatively Build-Depends on the Python 2 or Python 3
+ version of the Sphinx documentation generator.
+ .
+ The 2.x series of Python is due for deprecation and will not be maintained
+ past 2020.
+ .
+ Please replace the alternative with a single build dependency on
+ <tt>python3-sphinx</tt>.
diff --git a/checks/python.pm b/checks/python.pm
index 11eadc4..c8cb441 100644
--- a/checks/python.pm
+++ b/checks/python.pm
@@ -51,6 +51,10 @@ sub run {
       if $build_all->implies('python-sphinx')
       and not $build_all->implies('python3-sphinx');
 
+    tag 'alternatively-build-depends-on-python-sphinx-and-python3-sphinx'
+      if $info->field('build-depends')
+      =~ m,\bpython-sphinx\s+\|\s+python3-sphinx\b,g;
+
     return;
 }
 
diff --git a/debian/changelog b/debian/changelog
index e3f6d1d..dc27062 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -39,6 +39,8 @@ lintian (2.5.53) UNRELEASED; urgency=medium
       to assist in Python 2.x deprecation.  (Closes: #870681)
     + [CL] Check for packages that Build-Depend on python-sphinx only.
       (Closes: #870730)
+    + [CL] Check for packages that alternatively Build-Depend on the
+      Python 2 and Python 3 versions of Sphinx.  (Closes: #870758)
   * checks/scripts.pm:
     + [CL] Correct false positives in
       unconditional-use-of-dpkg-statoverride by detecting "if !" as a
diff --git a/t/tests/python-build-depends-on-sphinx-alternative/debian/debian/control.in b/t/tests/python-build-depends-on-sphinx-alternative/debian/debian/control.in
new file mode 100644
index 0000000..9e2767a
--- /dev/null
+++ b/t/tests/python-build-depends-on-sphinx-alternative/debian/debian/control.in
@@ -0,0 +1,17 @@
+Source: {$source}
+Priority: extra
+Section: python
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 9), python-sphinx | python3-sphinx
+
+Package: python3-{$source}
+Architecture: all
+Depends: $\{misc:Depends\}, python3
+Description: Test package
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.  It may
+ be an empty package.
+ .
+ Python 3 variant.
diff --git a/t/tests/python-build-depends-on-sphinx-alternative/desc b/t/tests/python-build-depends-on-sphinx-alternative/desc
new file mode 100644
index 0000000..4eac029
--- /dev/null
+++ b/t/tests/python-build-depends-on-sphinx-alternative/desc
@@ -0,0 +1,5 @@
+Testname: python-build-depends-on-sphinx-alternative
+Version: 1.0
+Description: Check packages that Build-Depend on python-sphinx | python3-sphinx
+Test-For:
+ alternatively-build-depends-on-python-sphinx-and-python3-sphinx
diff --git a/t/tests/python-build-depends-on-sphinx-alternative/tags b/t/tests/python-build-depends-on-sphinx-alternative/tags
new file mode 100644
index 0000000..4e159b3
--- /dev/null
+++ b/t/tests/python-build-depends-on-sphinx-alternative/tags
@@ -0,0 +1 @@
+W: python-build-depends-on-sphinx-alternative source: alternatively-build-depends-on-python-sphinx-and-python3-sphinx
diff --git a/t/tests/python-build-depends-on-sphinx-unrel/desc b/t/tests/python-build-depends-on-sphinx-unrel/desc
index 5d88e88..4f7dd74 100644
--- a/t/tests/python-build-depends-on-sphinx-unrel/desc
+++ b/t/tests/python-build-depends-on-sphinx-unrel/desc
@@ -2,4 +2,5 @@ Testname: python-build-depends-on-sphinx-unrel
 Version: 1.0
 Description: Check packages that Build-Depend on python-sphinx
 Test-Against:
+ alternatively-build-depends-on-python-sphinx-and-python3-sphinx
  build-depends-on-python-sphinx-only
diff --git a/t/tests/python-build-depends-on-sphinx/desc b/t/tests/python-build-depends-on-sphinx/desc
index 3de76d0..f4e13f5 100644
--- a/t/tests/python-build-depends-on-sphinx/desc
+++ b/t/tests/python-build-depends-on-sphinx/desc
@@ -3,3 +3,5 @@ Version: 1.0
 Description: Check packages that Build-Depend on python-sphinx
 Test-For:
  build-depends-on-python-sphinx-only
+Test-Against:
+ alternatively-build-depends-on-python-sphinx-and-python3-sphinx

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: