Beispiel #1
0
    def fix_checksum_cls(self, *package_classes):
        """
        Fix the checksum of packages

        $ sage --package fix-checksum
        """
        pc = PackageClass(*package_classes, has_files=['checksums.ini'])
        pc.apply(self.fix_checksum)
Beispiel #2
0
    def list_cls(self, *package_classes, **filters):
        """
        Print a list of all available packages

        $ sage --package list | sort
        4ti2
        arb
        atlas
        autotools
        [...]
        zn_poly

        $ sage -package list --has-file=spkg-configure.m4 :experimental:
        perl_term_readline_gnu

        $ sage -package list --has-file=spkg-configure.m4 --has-file=distros/debian.txt | sort
        arb
        boost_cropped
        brial
        [...]
        zn_poly
        """
        log.debug('Listing packages')
        pc = PackageClass(*package_classes, **filters)
        for pkg_name in pc.names:
            print(pkg_name)
Beispiel #3
0
    def download_cls(self,
                     package_name_or_class,
                     allow_upstream=False,
                     on_error='stop'):
        """
        Download a package or a class of packages
        """
        pc = PackageClass(package_name_or_class, has_files=['checksums.ini'])

        def download_with_args(package):
            try:
                self.download(package, allow_upstream=allow_upstream)
            except FileNotMirroredError:
                if on_error == 'stop':
                    raise
                elif on_error == 'warn':
                    log.warn('Unable to download tarball of %s', package)
                else:
                    raise ValueError(
                        'on_error must be one of "stop" and "warn"')

        pc.apply(download_with_args)
Beispiel #4
0
 def update_latest_all(self):
     log.debug('Attempting to update all packages')
     exclude = [
         'atlas', 'flint', 'bzip2', 'ecm', 'freetype', 'gap', 'glpk', 'graphs',
         'iconv', 'patch', 'r', 'configure', 'bliss', 'readline', 'decorator',
         'igraph', 'rw', 'planarity', 'gambit', 
     ]
     pc = PackageClass(':standard:')
     for package_name in pc.names:
         if package_name in exclude:
             log.debug('skipping %s because of pypi name collision', package_name)
             continue
         self.update_latest(package_name)
Beispiel #5
0
    def list_cls(self, package_class):
        """
        Print a list of all available packages

        $ sage --package list | sort
        4ti2
        arb
        atlas
        autotools
        [...]
        zn_poly
        """
        log.debug('Listing packages')
        pc = PackageClass(package_class)
        for pkg_name in pc.names:
            print(pkg_name)
Beispiel #6
0
 def update_latest_cls(self, package_name_or_class):
     exclude = [
         'cypari'  # Name conflict
     ]
     # 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
         try:
             self.update_latest(package_name)
         except PyPiError as e:
             log.warn('updating %s failed: %s', package_name, e)
Beispiel #7
0
 def upload_cls(self, package_name_or_class):
     pc = PackageClass(package_name_or_class)
     pc.apply(self.upload)
     fs = FileServer()
     log.info('Publishing')
     fs.publish()
Beispiel #8
0
 def download_cls(self, package_name_or_class):
     pc = PackageClass(package_name_or_class)
     pc.apply(self.download)