mathlibtools/lib.py
def upgrade_mathlib(self) -> None:
        """Upgrade mathlib in the project.

        In case this project is mathlib, we assume we are already on the branch
        we want.
        """
        if self.is_mathlib:
            assert self.repo
            try:
                rem = next(remote for remote in self.repo.remotes
                           if any('leanprover' in url
                                  for url in remote.urls))
                log.info('Pulling...')
                rem.pull(self.repo.active_branch)
            except (StopIteration, GitCommandError):
                log.info("Couldn't pull from a relevant git remote. "
                         "You may try to git pull manually and then "
                         "run `leanproject get-cache`")
                return
            self.rev = self.repo.commit().hexsha
        else:
            self.clean_mathlib_dep()
            if self.upgrade_lean:
                mathlib_lean = mathlib_lean_version()

                if mathlib_lean > self.lean_version:
                    self.lean_version = mathlib_lean
                    self.write_config()
            self.run_echo(['leanpkg', 'upgrade'])
            self.read_config()
        self.get_mathlib_olean()
Upgrade mathlib in the project.

        In case this project is mathlib, we assume we are already on the branch
        we want.
        
Upgrade mathlib in the project.
In case this project is mathlib, we assume we are already on the branch
we want.
Upgrade mathlib in the project . In case this project is mathlib we assume we are already on the branch we want .
def upgrade_mathlib(self) -> None:
        if self.is_mathlib:
            assert self.repo
            try:
                rem = next(remote for remote in self.repo.remotes
                           if any('leanprover' in url
                                  for url in remote.urls))
                log.info('Pulling...')
                rem.pull(self.repo.active_branch)
            except (StopIteration, GitCommandError):
                log.info("Couldn't pull from a relevant git remote. "
                         "You may try to git pull manually and then "
                         "run `leanproject get-cache`")
                return
            self.rev = self.repo.commit().hexsha
        else:
            self.clean_mathlib_dep()
            if self.upgrade_lean:
                mathlib_lean = mathlib_lean_version()
                if mathlib_lean > self.lean_version:
                    self.lean_version = mathlib_lean
                    self.write_config()
            self.run_echo(['leanpkg', 'upgrade'])
            self.read_config()
        self.get_mathlib_olean()
def upgrade_mathlib ( self ) -> None : if self . is_mathlib : assert self . repo try : rem = next ( remote for remote in self . repo . remotes if any ( 'leanprover' in url for url in remote . urls ) ) log . info ( 'Pulling...' ) rem . pull ( self . repo . active_branch ) except ( StopIteration , GitCommandError ) : log . info ( "Couldn't pull from a relevant git remote. " "You may try to git pull manually and then " "run `leanproject get-cache`" ) return self . rev = self . repo . commit ( ) . hexsha else : self . clean_mathlib_dep ( ) if self . upgrade_lean : mathlib_lean = mathlib_lean_version ( ) if mathlib_lean > self . lean_version : self . lean_version = mathlib_lean self . write_config ( ) self . run_echo ( [ 'leanpkg' , 'upgrade' ] ) self . read_config ( ) self . get_mathlib_olean ( )
Upgrade mathlib in the project.
Upgrade mathlib in the project .
"""Upgrade mathlib in the project.

        In case this project is mathlib, we assume we are already on the branch
        we want.
        """
self