Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 't/31118/sage___package_update_latest__fix_for_package_n…
Browse files Browse the repository at this point in the history
…ames_containing_dashes' into t/31280/jupyter_upgrade
  • Loading branch information
Matthias Koeppe committed Jan 22, 2021
2 parents ee9317e + f74f66c commit aa67103
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
21 changes: 12 additions & 9 deletions build/sage_bootstrap/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from sage_bootstrap.tarball import Tarball, FileNotMirroredError
from sage_bootstrap.updater import ChecksumUpdater, PackageUpdater
from sage_bootstrap.creator import PackageCreator
from sage_bootstrap.pypi import PyPiVersion, PyPiNotFound
from sage_bootstrap.pypi import PyPiVersion, PyPiNotFound, PyPiError
from sage_bootstrap.fileserver import FileServer
from sage_bootstrap.expand_class import PackageClass

Expand Down Expand Up @@ -140,19 +140,22 @@ def update_latest(self, package_name):
else:
pypi.update(Package(package_name))

def update_latest_all(self):
log.debug('Attempting to update all packages')
def update_latest_cls(self, package_name_or_class):
exclude = [
'atlas', 'flint', 'bzip2', 'ecm', 'freetype', 'gap', 'glpk', 'graphs',
'iconv', 'patch', 'r', 'configure', 'bliss', 'readline', 'decorator',
'igraph', 'rw', 'planarity', 'gambit',
'cypari' # Name conflict
]
pc = PackageClass(':standard:')
for package_name in pc.names:
# Restrict to normal Python packages
pc = PackageClass(package_name_or_class, has_files=['checksums.ini', 'install-requires.txt'])
if not pc.names:
log.warn('nothing to do (does not name a normal Python package)')
for package_name in sorted(pc.names):
if package_name in exclude:
log.debug('skipping %s because of pypi name collision', package_name)
continue
self.update_latest(package_name)
try:
self.update_latest(package_name)
except PyPiError as e:
log.warn('updating %s failed: %s', package_name, e)

def download(self, package_name, allow_upstream=False):
"""
Expand Down
5 changes: 1 addition & 4 deletions build/sage_bootstrap/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,7 @@ def run():
elif args.subcommand == 'update':
app.update(args.package_name, args.new_version, url=args.url)
elif args.subcommand == 'update-latest':
if args.package_name == ':all:':
app.update_latest_all()
else:
app.update_latest(args.package_name)
app.update_latest_cls(args.package_name)
elif args.subcommand == 'download':
app.download_cls(args.package_name,
allow_upstream=args.allow_upstream,
Expand Down

0 comments on commit aa67103

Please sign in to comment.