mathlibtools/lib.py
def new(cls, path: Path = Path('.'), cache_url: str = '',
            force_download: bool = False) -> 'LeanProject':
        """Create a new Lean project and prepare mathlib."""
        if path == Path('.'):
            subprocess.run(['leanpkg', 'init', path.absolute().name], check=True)
        else:
            if path.exists():
                raise FileExistsError('Directory ' + str(path) + ' already exists')
            subprocess.run(['leanpkg', 'new', str(path)], check=True)

        proj = cls.from_path(path, cache_url, force_download)
        proj.lean_version = mathlib_lean_version()
        proj.write_config()
        proj.add_mathlib()
        assert proj.repo
        proj.repo.git.checkout('-b', 'master')
        return proj
Create a new Lean project and prepare mathlib.
Create a new Lean project and prepare mathlib.
Create a new Lean project and prepare mathlib .
def new(cls, path: Path = Path('.'), cache_url: str = '',
            force_download: bool = False) -> 'LeanProject':
        if path == Path('.'):
            subprocess.run(['leanpkg', 'init', path.absolute().name], check=True)
        else:
            if path.exists():
                raise FileExistsError('Directory ' + str(path) + ' already exists')
            subprocess.run(['leanpkg', 'new', str(path)], check=True)
        proj = cls.from_path(path, cache_url, force_download)
        proj.lean_version = mathlib_lean_version()
        proj.write_config()
        proj.add_mathlib()
        assert proj.repo
        proj.repo.git.checkout('-b', 'master')
        return proj
def new ( cls , path : Path = Path ( '.' ) , cache_url : str = '' , force_download : bool = False ) -> 'LeanProject' : if path == Path ( '.' ) : subprocess . run ( [ 'leanpkg' , 'init' , path . absolute ( ) . name ] , check = True ) else : if path . exists ( ) : raise FileExistsError ( 'Directory ' + str ( path ) + ' already exists' ) subprocess . run ( [ 'leanpkg' , 'new' , str ( path ) ] , check = True ) proj = cls . from_path ( path , cache_url , force_download ) proj . lean_version = mathlib_lean_version ( ) proj . write_config ( ) proj . add_mathlib ( ) assert proj . repo proj . repo . git . checkout ( '-b' , 'master' ) return proj
Create a new Lean project and prepare mathlib.
Create a new Lean project and prepare mathlib .
"""Create a new Lean project and prepare mathlib."""
cls
path
Path
cache_url
str
force_download
bool