mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-03-14 10:46:46 +08:00
wip 1
This commit is contained in:
23
scripts/git_sources.py
Normal file
23
scripts/git_sources.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Django branch to typecheck against
|
||||
from pathlib import Path
|
||||
|
||||
from git import Repo
|
||||
|
||||
DJANGO_BRANCH = 'stable/2.1.x'
|
||||
|
||||
# Specific commit in the Django repository to check against
|
||||
DJANGO_COMMIT_SHA = '03219b5f709dcd5b0bfacd963508625557ec1ef0'
|
||||
|
||||
PROJECT_DIRECTORY = Path(__file__).parent.parent
|
||||
REPO_DIRECTORY = PROJECT_DIRECTORY / 'django-sources'
|
||||
|
||||
|
||||
def update_django_sources_repo():
|
||||
# clone Django repository, if it does not exist
|
||||
if not REPO_DIRECTORY.exists():
|
||||
repo = Repo.clone_from('https://github.com/django/django.git', REPO_DIRECTORY)
|
||||
else:
|
||||
repo = Repo(REPO_DIRECTORY)
|
||||
repo.remotes['origin'].pull(DJANGO_BRANCH)
|
||||
|
||||
repo.git.checkout(DJANGO_COMMIT_SHA)
|
||||
Reference in New Issue
Block a user