New Upstream Snapshot - pip-requirements-el

Ready changes

Summary

Merged new upstream version: 0.5+git20181027.1.216cd16 (was: 0.5).

Resulting package

Built on 2022-10-18T00:52 (took 4m41s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots elpa-pip-requirements

Lintian Result

Diff

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d4691b7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.cask
diff --git a/README.md b/README.md
index 3d4d3fe..697a7d2 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,11 @@ To use [Auto Complete][] instead, add the following to your `init.el`:
 
 ## Changelog
 
+### 0.6
+
+Update pip-requirements completion to handle the move from
+pypi.python.org to pypi.org (minor HTML difference broke our parsing).
+
 ### 0.5
 
 Added support for completion-at-point-functions. Autocomplete is now
diff --git a/debian/changelog b/debian/changelog
index 845d2f4..0c6529c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
-pip-requirements-el (0.5-4) UNRELEASED; urgency=medium
+pip-requirements-el (0.5+git20181027.1.216cd16-1) UNRELEASED; urgency=medium
 
+  [ Nicholas D Steeves ]
   * Drop emacs25 from Enhances (package does not exist in bullseye).
 
- -- Nicholas D Steeves <sten@debian.org>  Wed, 28 Jul 2021 19:41:08 -0400
+  [ Debian Janitor ]
+  * New upstream snapshot.
+
+ -- Nicholas D Steeves <sten@debian.org>  Tue, 18 Oct 2022 00:48:55 -0000
 
 pip-requirements-el (0.5-3) UNRELEASED; urgency=medium
 
diff --git a/debian/patches/0001-clean-documentation.diff b/debian/patches/0001-clean-documentation.diff
index 0fac5c6..36dc109 100644
--- a/debian/patches/0001-clean-documentation.diff
+++ b/debian/patches/0001-clean-documentation.diff
@@ -5,8 +5,10 @@ This patch removes badge icons and screenshot from README file. These
 icons are intended rather for developers. They are loaded from an
 external web site and not included in the original source.
 
---- a/README.md
-+++ b/README.md
+Index: pip-requirements-el.git/README.md
+===================================================================
+--- pip-requirements-el.git.orig/README.md
++++ pip-requirements-el.git/README.md
 @@ -1,16 +1,11 @@
  # pip-requirements.el
  
diff --git a/example.pip b/example.pip
index d869ef7..81a1107 100644
--- a/example.pip
+++ b/example.pip
@@ -4,3 +4,8 @@ foo[bar]==1.2
 baz>1,<2
 python-dateutil>=1.5,<=2.1,!=2.0
 backports.ssl-match-hostname==3.4.0.2
+
+# https://www.python.org/dev/peps/pep-0440/#version-specifiers
+quux~=1.2
+xyx==1.2.*
+abc===foobar
diff --git a/pip-requirements.el b/pip-requirements.el
index 9f25de0..91d70ca 100644
--- a/pip-requirements.el
+++ b/pip-requirements.el
@@ -4,7 +4,7 @@
 ;;
 ;; Author: Wilfred Hughes <me@wilfred.me.uk>
 ;; Created: 11 September 2014
-;; Version: 0.5
+;; Version: 0.6
 ;; Package-Requires: ((dash "2.8.0"))
 
 ;;; License:
@@ -55,6 +55,12 @@
   :type 'hook
   :risky t)
 
+(defcustom pip-requirements-index-url
+  "https://pypi.org/simple/"
+  "The URL used to fetch the list of packages used for completion."
+  :group 'pip-requirements
+  :type 'string)
+
 ;;;###autoload
 (add-to-list 'auto-mode-alist
              `(,(rx ".pip" string-end) . pip-requirements-mode))
@@ -72,20 +78,31 @@
    (group (1+ (or alphanumeric "-" "_" ".")))))
 
 (defconst pip-requirements-version-regex
+  ;; https://www.python.org/dev/peps/pep-0440/#version-specifiers
   (rx
-   (group (or "==" ">" ">=" "<" "<=" "!="))
-   (group (1+ (or digit "b" "." "post")))))
+   (group (or "==" ">" ">=" "<" "<=" "!=" "~="))
+   (group (1+ (or digit "b" "." "post" "*")))))
+
+(defconst pip-requirements-arbitrary-version-regex
+  ;; https://www.python.org/dev/peps/pep-0440/#arbitrary-equality
+  (rx (group "===") (group (1+ not-newline))))
 
 (defconst pip-requirements-operators
   (list
    (list pip-requirements-name-regex 1 'font-lock-variable-name-face)
    (list pip-requirements-version-regex 1 'font-lock-builtin-face)
-   (list pip-requirements-version-regex 2 'font-lock-constant-face)))
+   (list pip-requirements-arbitrary-version-regex 1 'font-lock-builtin-face)
+   (list pip-requirements-version-regex 2 'font-lock-constant-face)
+   (list pip-requirements-arbitrary-version-regex 2 'font-lock-constant-face)))
 
 (defconst pip-requirements-syntax-table
   (let ((table (make-syntax-table)))
     (modify-syntax-entry ?# "<" table)
     (modify-syntax-entry ?\n ">" table)
+    (modify-syntax-entry ?> "." table)
+    (modify-syntax-entry ?< "." table)
+    (modify-syntax-entry ?= "." table)
+    (modify-syntax-entry ?~ "." table)
     table))
 
 (defvar pip-http-buffer nil)
@@ -98,23 +115,20 @@
     (goto-char (point-min))
     (re-search-forward "^$" nil 'move)
 
-    (setq pip-packages
-          (->> (libxml-parse-html-region (point) (point-max))
-               ;; Get the body tag.
-               -last-item
-               ;; Immediate children of the body.
-               cdr cdr cdr
-               ;; Anchor tags.
-               (--filter (eq (car it) 'a))
-               ;; Inner text of anchor tags.
-               (-map #'cl-third))))
+    (let* ((dom (libxml-parse-html-region (point) (point-max)))
+           (body-tag (-last-item dom))
+           (body-children (cdddr body-tag))
+           (a-tags (--filter (eq (car-safe it) 'a) body-children)))
+      (setq pip-packages
+            ;; Inner text of anchor tags.
+            (-map #'cl-third a-tags))))
   (kill-buffer pip-http-buffer))
 
 (defun pip-requirements-fetch-packages ()
   "Get a list of all packages available on PyPI and store them in `pip-packages'.
 Assumes Emacs is compiled with libxml."
   (setq pip-http-buffer
-        (url-retrieve "https://pypi.python.org/simple/"
+        (url-retrieve pip-requirements-index-url
                       #'pip-requirements-callback nil t)))
 
 (defun pip-requirements-complete-at-point ()

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/share/emacs/site-lisp/elpa-src/pip-requirements-0.6/pip-requirements-autoloads.el
-rw-r--r--  root/root   /usr/share/emacs/site-lisp/elpa-src/pip-requirements-0.6/pip-requirements-pkg.el
-rw-r--r--  root/root   /usr/share/emacs/site-lisp/elpa-src/pip-requirements-0.6/pip-requirements.el

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/share/emacs/site-lisp/elpa-src/pip-requirements-0.5/pip-requirements-autoloads.el
-rw-r--r--  root/root   /usr/share/emacs/site-lisp/elpa-src/pip-requirements-0.5/pip-requirements-pkg.el
-rw-r--r--  root/root   /usr/share/emacs/site-lisp/elpa-src/pip-requirements-0.5/pip-requirements.el

No differences were encountered in the control files

More details

Full run details