Skip to content

Commit a5d5765

Browse files
committed
Build out pulling workflow.
1 parent db87f62 commit a5d5765

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repos/

repos.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name,url
2+
Intro to Python for Data Science,https://github.com/uc-python/intro-python-datasci.git

uc_python/pull.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
import subprocess
3+
4+
from .repos import repos
5+
6+
for repo in repos:
7+
os.mkdir("repos")
8+
os.chdir("repos")
9+
subprocess.run(["git", "clone", repo.url], check=True)
10+
os.chdir("..")

uc_python/repos.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import csv
2+
from dataclasses import dataclass
3+
4+
__all__ = ['repos', 'Repo']
5+
6+
@dataclass
7+
class Repo:
8+
name: str
9+
url: str
10+
11+
12+
with open('repos.csv', 'r', newline='') as f:
13+
reader = csv.DictReader(f)
14+
repos = [Repo(r["name"], r["url"]) for r in reader]

0 commit comments

Comments
 (0)