Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #31118

Closed
mkoeppe opened this issue Dec 27, 2020 · 17 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 27, 2020

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

@mkoeppe mkoeppe added this to the sage-9.3 milestone Dec 27, 2020
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 22, 2021

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 22, 2021

Commit: 9d747fc

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 22, 2021

Author: Matthias Koeppe

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 22, 2021

New commits:

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

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 22, 2021

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

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 22, 2021

Changed commit from 9d747fc to c826c73

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title sage --package update-latest: Fix for package-names-containing-dashes sage --package update-latest: Fix for package-names-containing-dashes; accept package classes :standard:, :optional: etc., restrict to normal Python packages Jan 22, 2021
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 22, 2021

Changed commit from c826c73 to f74f66c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 22, 2021

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

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2021

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

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

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 24, 2021

Changed commit from f74f66c to 182b3d2

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title sage --package update-latest: Fix for package-names-containing-dashes; accept package classes :standard:, :optional: etc., restrict to normal Python packages 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 Jan 24, 2021
@dimpase
Copy link
Member

dimpase commented Jan 24, 2021

comment:9

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

@dimpase
Copy link
Member

dimpase commented Jan 24, 2021

Reviewer: Dima Pasechnik

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 24, 2021

comment:10

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

@dimpase
Copy link
Member

dimpase commented Jan 25, 2021

comment:11

inability to update spkgs is a blocker all right.

@vbraun
Copy link
Member

vbraun commented Feb 20, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants