Run of fresh-snapshots for pip-requirements-el

Try this locally (using the package):

debcheckout pip-requirements-el
cd pip-requirements-el
DEB_UPDATE_CHANGELOG=auto new-upstream --snapshot --refresh-patches

Summary

Merged new upstream version: (was: 0.5).

Diff

Branch: main

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..de9a15f 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>  Wed, 18 Aug 2021 03:34:08 -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..fad7dfe 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/README.md
+===================================================================
+--- pip-requirements-el.orig/README.md
++++ pip-requirements-el/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 ()

Branch: pristine-tar

diff --git a/pip-requirements-el_0.5+git20181027.1.216cd16.orig.tar.gz.delta b/pip-requirements-el_0.5+git20181027.1.216cd16.orig.tar.gz.delta
new file mode 100644
index 0000000..61d8604
Binary files /dev/null and b/pip-requirements-el_0.5+git20181027.1.216cd16.orig.tar.gz.delta differ
diff --git a/pip-requirements-el_0.5+git20181027.1.216cd16.orig.tar.gz.id b/pip-requirements-el_0.5+git20181027.1.216cd16.orig.tar.gz.id
new file mode 100644
index 0000000..6d79fc1
--- /dev/null
+++ b/pip-requirements-el_0.5+git20181027.1.216cd16.orig.tar.gz.id
@@ -0,0 +1 @@
+3ccd4837f5cba27782df06d4b1168ca9135522fc

Branch: upstream

Tag: upstream/0.5+git20181027.1.216cd16
Unable to retrieve diff; error 400

Resulting package

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

Full worker log Full build log Full dist log