Skip to content

Commit d82c106

Browse files
committed
Avoid error on py3.7 for docs
1 parent d17ac42 commit d82c106

File tree

2 files changed

+32
-30
lines changed

2 files changed

+32
-30
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v2
16+
- uses: actions/setup-python@v3
1717
- uses: pre-commit/[email protected]
1818
with:
1919
extra_args: --hook-stage manual --all-files
@@ -28,9 +28,9 @@ jobs:
2828
runs-on: [ubuntu-latest, macos-latest, windows-latest]
2929

3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
- name: Set up Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v2
33+
uses: actions/setup-python@v3
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636

@@ -89,8 +89,9 @@ jobs:
8989
python arrays.py -run # test one example
9090
9191
- name: Build Documentation
92+
if: ${{ matrix.python-version != '3.7'}}
9293
run: |
93-
94+
# Note: contributors generation below fails on py 3.7 due to pandas version...
9495
pip install .[docs]
9596
cd docs
9697
python generate.py

docs/contributors.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
len_per_info = len(per_info)
1818

1919
empty_list = []
20-
max_tries = 3
20+
max_tries = 100
2121

2222
for i in range(len_per_info):
2323
url = per_info[i]
@@ -39,34 +39,35 @@
3939
data = requests.get(url=url)
4040
max_tries -= 1
4141

42-
df1 = pd.DataFrame(empty_list)
43-
df1["name"] = df1["name"].fillna(df1["login"])
44-
name = df1["name"]
45-
login = df1["login"]
46-
url_html = df1["html_url"]
47-
url_id = df1["id"]
42+
if len(empty_list) > 0:
43+
df1 = pd.DataFrame(empty_list)
44+
df1["name"] = df1["name"].fillna(df1["login"])
45+
name = df1["name"]
46+
login = df1["login"]
47+
url_html = df1["html_url"]
48+
url_id = df1["id"]
4849

49-
login_html = list(zip(name, login, url_html))
50-
zip_dict = dict(zip(url_id, login_html))
50+
login_html = list(zip(name, login, url_html))
51+
zip_dict = dict(zip(url_id, login_html))
5152

52-
file = "sphinx/source/api/Contributors.md"
53-
with open(file, "w") as f:
54-
print(
55-
textwrap.dedent(
56-
"""\
57-
(Modelspec:contributors)=
53+
file = "sphinx/source/api/Contributors.md"
54+
with open(file, "w") as f:
55+
print(
56+
textwrap.dedent(
57+
"""\
58+
(Modelspec:contributors)=
5859
59-
# Modelspec contributors
60+
# Modelspec contributors
6061
61-
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
62-
This page is generated periodically, most recently on {}.""".format(
63-
date.today()
64-
)
65-
),
66-
file=f,
67-
)
62+
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
63+
This page is generated periodically, most recently on {}.""".format(
64+
date.today()
65+
)
66+
),
67+
file=f,
68+
)
6869

69-
print("", file=f)
70+
print("", file=f)
7071

71-
for key, val in zip_dict.items():
72-
print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f)
72+
for key, val in zip_dict.items():
73+
print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f)

0 commit comments

Comments
 (0)