sage --package update-latest: Fix for package-names-containing-dashes; accept package classes :standard:, :optional: etc., restrict to normal Python packages; fix sage --package fix-checksum
mkoeppe opened this issue · 17 comments
... the current code is confused about pypa-normalized names vs. spkg-normalized names:
$ ./sage -package update-latest importlib_metadata
Traceback (most recent call last):
File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/bin/sage-package", line 42, in <module>
run()
File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/bin/../sage_bootstrap/cmdline.py", line 337, in run
app.update_latest(args.package_name)
File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/bin/../sage_bootstrap/app.py", line 141, in update_latest
pypi.update()
File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/bin/../sage_bootstrap/pypi.py", line 104, in update
package = Package(self.name)
File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/bin/../sage_bootstrap/package.py", line 48, in __init__
self._init_type()
File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/bin/../sage_bootstrap/package.py", line 309, in _init_type
with open(os.path.join(self.path, 'type')) as f:
IOError: [Errno 2] No such file or directory: u'/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/pkgs/importlib-metadata/type'
We also update the code so that it uses the files checksums.ini and install-requires.txt to recognize normal Python packages.
As a result, the interface has changed slightly:
sage --package update-latest :all:now also updates optional and experimental packages- use
sage --package update-latest :standard:for (a better version of) the previous behavior
We also fix sage --package fix-checksum so it does not trip over non-normal packages.
CC: @vbraun @seblabbe @jhpalmieri @dimpase @videlec
Component: scripts
Author: Matthias Koeppe
Branch/Commit: 182b3d2
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/31118
Author: Matthias Koeppe
New commits:
9d747fc | sage --package update-latest: Distinguish pypi package name and spkg name |
Branch pushed to git repo; I updated commit sha1. New commits:
c826c73 | sage --package update-latest: Accept package classes :standard:, :optional: etc., restrict to normal Python packages |
Description changed:
---
+++
@@ -18,3 +18,12 @@
IOError: [Errno 2] No such file or directory: u'/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/pkgs/importlib-metadata/type'
```
+We also update the code so that it uses the files `checksums.ini` and `install-requires.txt` to recognize normal Python packages.
+
+As a result, the interface has changed slightly:
+
+- `sage --package update-latest :all:` now also updates optional and experimental packages
+- use `sage --package update-latest :standard:` for (a better version of) the previous behavior
+
+
+Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
f74f66c | sage --package update-latest: Accept package classes :standard:, :optional: etc., restrict to normal Python packages |
Branch pushed to git repo; I updated commit sha1. New commits:
182b3d2 | sage -package fix-checksum: Handle package classes, ignore non-normal packages |
Description changed:
---
+++
@@ -25,5 +25,7 @@
- `sage --package update-latest :all:` now also updates optional and experimental packages
- use `sage --package update-latest :standard:` for (a better version of) the previous behavior
+We also fix `sage --package fix-checksum` so it does not trip over non-normal packages.
+OK, this appears to fix sage -package fix-checksum.
Reviewer: Dima Pasechnik
By the way, only sage -package fix-checksum without specifying the package was broken because it looped over all packages, including script packages. Hardly a blocker, but it does not really matter
inability to update spkgs is a blocker all right.
Changed branch from u/mkoeppe/sage___package_update_latest__fix_for_package_names_containing_dashes to 182b3d2