Skip to content

Instantly share code, notes, and snippets.

@bryangingechen
Created September 26, 2019 02:55
Show Gist options
  • Save bryangingechen/e1b460d146549df09df4b5a4a9b2656f to your computer and use it in GitHub Desktop.
Save bryangingechen/e1b460d146549df09df4b5a4a9b2656f to your computer and use it in GitHub Desktop.
from leancrawler import LeanLibModel, create_db, Path
import os
pkgname = 'mathlib'
pkgpath = '/Users/chb/Documents/lean/'+pkgname
# uncomment this and edit for a package with dependencies
# os.environ['LEAN_PATH']="/Users/chb/Documents/lean/leancrawler/src/leancrawler/:"+pkgpath+"/src:"+pkgpath+"/_target/deps/mathlib:/Users/chb/.elan/toolchains/3.4.2/lib/lean/library/"
# use this for a package with no dependencies
os.environ['LEAN_PATH']="/Users/chb/Documents/lean/leancrawler/src/leancrawler/:"+pkgpath+"/src:/Users/chb/.elan/toolchains/3.4.2/lib/lean/library/"
# print(os.environ['LEAN_PATH'])
create_db(pkgname+'.db')
LeanLibModel.from_path(pkgname, Path(pkgpath+'/src'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment