Opened 10 months ago

Closed 8 months ago

#31118 closed defect (fixed)

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

Reported by: mkoeppe Owned by:
Priority: blocker Milestone: sage-9.3
Component: scripts Keywords:
Cc: vbraun, slabbe, jhpalmieri, dimpase, vdelecroix Merged in:
Authors: Matthias Koeppe Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 182b3d2 (Commits, GitHub, GitLab) Commit: 182b3d22106e206a95d9ffbf2104f5c2a32dd3b5
Dependencies: Stopgaps:

Status badges

Description (last modified by mkoeppe)

... 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.

Change History (12)

comment:1 Changed 9 months ago by mkoeppe

  • Branch set to u/mkoeppe/sage___package_update_latest__fix_for_package_names_containing_dashes

comment:2 Changed 9 months ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Cc jhpalmieri dimpase added
  • Commit set to 9d747fc169e04f78dc9d1ba8e13c4e09f162d3a6
  • Status changed from new to needs_review

New commits:

9d747fcsage --package update-latest: Distinguish pypi package name and spkg name

comment:3 Changed 9 months ago by git

  • Commit changed from 9d747fc169e04f78dc9d1ba8e13c4e09f162d3a6 to c826c73010ca7eeaa399ffcb08a3d951b08f4e2c

Branch pushed to git repo; I updated commit sha1. New commits:

c826c73sage --package update-latest: Accept package classes :standard:, :optional: etc., restrict to normal Python packages

comment:4 Changed 9 months ago by mkoeppe

  • Description modified (diff)
  • Priority changed from minor to major
  • Summary changed from sage --package update-latest: Fix for package-names-containing-dashes to sage --package update-latest: Fix for package-names-containing-dashes; accept package classes :standard:, :optional: etc., restrict to normal Python packages

comment:5 Changed 9 months ago by git

  • Commit changed from c826c73010ca7eeaa399ffcb08a3d951b08f4e2c to f74f66c31a358b3ff5dd2381ce4b7c1f5899858d

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f74f66csage --package update-latest: Accept package classes :standard:, :optional: etc., restrict to normal Python packages

comment:6 Changed 9 months ago by mkoeppe

  • Cc vdelecroix added

comment:7 Changed 9 months ago by git

  • Commit changed from f74f66c31a358b3ff5dd2381ce4b7c1f5899858d to 182b3d22106e206a95d9ffbf2104f5c2a32dd3b5

Branch pushed to git repo; I updated commit sha1. New commits:

182b3d2sage -package fix-checksum: Handle package classes, ignore non-normal packages

comment:8 Changed 9 months ago by mkoeppe

  • Description modified (diff)
  • Summary changed from sage --package update-latest: Fix for package-names-containing-dashes; accept package classes :standard:, :optional: etc., restrict to normal Python packages to 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

comment:9 Changed 9 months ago by dimpase

  • Priority changed from major to blocker
  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

OK, this appears to fix sage -package fix-checksum.

comment:10 Changed 9 months ago by mkoeppe

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

comment:11 Changed 9 months ago by dimpase

inability to update spkgs is a blocker all right.

comment:12 Changed 8 months ago by vbraun

  • Branch changed from u/mkoeppe/sage___package_update_latest__fix_for_package_names_containing_dashes to 182b3d22106e206a95d9ffbf2104f5c2a32dd3b5
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.