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

[lintian] 01/02: Add check for unsupported PyPI URL in debian/watch



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

abe pushed a commit to branch master
in repository lintian.

commit 55c52c2b1616cfdf8e6193e6c9107323c7aaef9d
Author: Ben Finney <ben+debian@benfinney.id.au>
Date:   Fri Apr 17 02:46:34 2015 +0200

    Add check for unsupported PyPI URL in debian/watch
    
    Signed-off-by: Axel Beckert <abe@deuxchevaux.org>
---
 checks/watch-file.desc                         | 12 ++++++++++++
 checks/watch-file.pm                           |  4 ++++
 t/tests/watch-file-general/debian/debian/watch |  5 ++++-
 t/tests/watch-file-general/desc                |  1 +
 t/tests/watch-file-general/tags                |  2 ++
 5 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/checks/watch-file.desc b/checks/watch-file.desc
index 5d7e632..431725f 100644
--- a/checks/watch-file.desc
+++ b/checks/watch-file.desc
@@ -181,3 +181,15 @@ Certainty: certain
 Info: The watch file is pointing at PyPI, using a http URL, not https.
  PyPI now has https enabled, you should be able to simply switch to
  https.
+
+Tag: debian-watch-file-unsupported-pypi-url
+Severity: important
+Certainty: certain
+Ref: https://wiki.python.org/moin/PyPISimple
+Info: The watch file specifies a PyPI URL which is not a supported API.
+ Instead, use PyPI's Simple API:
+ .
+   https://pypi.python.org/simple/&lt;distribution-name&gt;/
+ .
+ replacing <tt>&lt;distribution-name&gt;</tt> with the canonical name
+ of the Python project.
diff --git a/checks/watch-file.pm b/checks/watch-file.pm
index 2d5c478..46ab633 100644
--- a/checks/watch-file.pm
+++ b/checks/watch-file.pm
@@ -135,6 +135,10 @@ sub run {
                 tag 'debian-watch-file-should-use-sf-redirector', "line $.";
             }
 
+            if (m%https?://pypi\.python\.org/packages/source/%) {
+                tag 'debian-watch-file-unsupported-pypi-url', "line $.";
+            }
+
             # This bit is as-is from uscan.pl:
             my ($base, $filepattern, $lastversion, $action) = split ' ', $_, 4;
             # Per #765995, $base might be undefined.
diff --git a/t/tests/watch-file-general/debian/debian/watch b/t/tests/watch-file-general/debian/debian/watch
index 3cb44e4..71b4717 100644
--- a/t/tests/watch-file-general/debian/debian/watch
+++ b/t/tests/watch-file-general/debian/debian/watch
@@ -21,6 +21,9 @@ version=42
 http://example.com/ foo([\d.]+)\.tar\.gz 2.0.ds1-1 uupdate
 
 opts="dversionmangle=s/ds-.*$//" \
-http://pypi.python.org/foo scripts\.([\d.]+)\.tar\.gz debian uupdate
+http://pypi.python.org/foo scripts\.([\d.]+)\.tar\.gz debian uupdate 
+
+# Unsupported PyPI URL.
+https://pypi.python.org/packages/source/p/pip/ pip-(\S+)\.tar\.gz
 
 # without any pgpsigurlmangle
\ No newline at end of file
diff --git a/t/tests/watch-file-general/desc b/t/tests/watch-file-general/desc
index 10133cb..64d09c9 100644
--- a/t/tests/watch-file-general/desc
+++ b/t/tests/watch-file-general/desc
@@ -13,6 +13,7 @@ Test-For:
  debian-watch-file-should-use-sf-redirector
  debian-watch-file-specifies-wrong-upstream-version
  debian-watch-file-unknown-version
+ debian-watch-file-unsupported-pypi-url
  debian-watch-file-uses-deprecated-sf-redirector-method
  debian-watch-may-check-gpg-signature
 References: Debian Bug#510398
diff --git a/t/tests/watch-file-general/tags b/t/tests/watch-file-general/tags
index 3eea3a7..a80f45b 100644
--- a/t/tests/watch-file-general/tags
+++ b/t/tests/watch-file-general/tags
@@ -1,3 +1,4 @@
+E: watch-file-general source: debian-watch-file-unsupported-pypi-url line 27
 I: watch-file-general source: debian-watch-file-accesses-pypi-over-http line 24
 I: watch-file-general source: debian-watch-file-should-dversionmangle-not-uversionmangle line 5
 P: watch-file-general source: debian-watch-may-check-gpg-signature
@@ -6,6 +7,7 @@ W: watch-file-general source: debian-watch-file-declares-multiple-versions line
 W: watch-file-general source: debian-watch-file-should-mangle-version line 12
 W: watch-file-general source: debian-watch-file-should-mangle-version line 14
 W: watch-file-general source: debian-watch-file-should-mangle-version line 15
+W: watch-file-general source: debian-watch-file-should-mangle-version line 27
 W: watch-file-general source: debian-watch-file-should-use-sf-redirector line 12
 W: watch-file-general source: debian-watch-file-should-use-sf-redirector line 14
 W: watch-file-general source: debian-watch-file-should-use-sf-redirector line 15

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


Reply to: