-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend function features to allow new repo types #190
Conversation
try: | ||
with urllib.request.urlopen(url) as _: | ||
request = urllib.request.Request(url) | ||
gh_token = os.getenv("GITHUB_ACCESS_TOKEN") | ||
if gh_token is not None: | ||
request.add_header("Authorization", f"token {gh_token}") | ||
with urllib.request.urlopen(request) as _: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repo.exists
call in the trace
function is taking a long time due to the absence of GitHub token here
def _trace(repo: LeanGitRepo, build_deps: bool) -> None:
assert (
repo.exists()
), f"The {repo} does not exist. Please check the URL `{repo.commit_url}`."
Thank you @yangky11 , for your thorough review of most of the work. The remaining tasks are straightforward after this PR merged. Two notes to mention:
For compatibility, the cache directory looks like: ❯ tree -L 2 lean_dojo
lean_dojo
├── leanprover-community-aesop-79fb157c6a5061190d169535f8e5cb007914a82e
├── leanprover-community-batteries-d2b1546c5fc05a06426e3f6ee1cb020e71be5592
├── repos
│ ├── rexzong-lean4-example-3f8c5eb303a225cdef609498b8d87262e5ef344b
│ └── testrepo-lean4-example-3f8c5eb303a225cdef609498b8d87262e5ef344b
├── yangky11-lean4-example-3f8c5eb303a225cdef609498b8d87262e5ef344b
└── yangky11-lean4-example-7b6ecb9ad4829e4e73600a3329baeb3b5df8d23f
11 directories, 0 files |
merge to #179 |
Main Changes
lean_version
instead of a commit hash. Postpone the initialization of the Lean4 repository.cache.get
andcache.store
for increased flexibility._to_commit_hash
,normalize_url
,get_latest_commit
, andurl_to_repo
, each with tests to ensure reliability.Progress
Implementation plan for the new feature:
gitpython
into the project (Fix git method & add more tests #188).