Skip to content

Commit c776e0f

Browse files
authored
Merge pull request #457 from AllenInstitute/dev
Dev
2 parents 3b25a7a + 94dbd62 commit c776e0f

File tree

2 files changed

+25
-35
lines changed

2 files changed

+25
-35
lines changed

.github/workflows/deploy.yml

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,42 @@
1-
2-
name: deployment
1+
name: deploy-book
32
on:
43
workflow_dispatch:
54

65
jobs:
76
deploy:
8-
runs-on: ubuntu-latest
7+
runs-on:
8+
group: LargerInstance
9+
container:
10+
image: rcpeene/openscope_databook:latest
911

1012
steps:
1113
- uses: actions/checkout@v3
1214
with:
1315
fetch-depth: 0
1416
ref: main
17+
fetch-tags: true
1518

16-
- name: Installing python
17-
run: |
18-
sudo apt-get update
19-
sudo apt install python3.12
20-
sudo apt-get install build-essential
21-
22-
- name: Installing package without PEP 517
23-
run: python3.12 -m pip install --no-use-pep517 -e .
24-
25-
- name: Upgrading pip
26-
run: pip install --upgrade pip
27-
28-
- name: Installing dependencies
29-
run: |
30-
pip install --upgrade pip setuptools wheel build
31-
pip install markupsafe==2.0.1 --no-cache-dir
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10.11'
3223

33-
- name: Installing package
24+
- name: Install your package
3425
run: pip install -e .
3526

36-
- name: Installing Jupyter book
37-
run: pip install -U jupyter-book
38-
39-
- name: Printing log
40-
run: git status
41-
42-
- name: Printing shortlog
43-
run: git log | git shortlog -sn
27+
- name: Install build requirements
28+
run: |
29+
pip install -r requirements.txt
30+
pip install markupsafe==2.0.1
31+
pip install -U jupyter-book
4432
45-
- name: Build Jupyter book
33+
- name: Build Jupyter Book
4634
run: |
4735
jupyter-book clean ./docs
4836
jupyter-book build ./docs
49-
50-
- name: Deploy book to GitHub pages
37+
38+
- name: Deploy to GitHub Pages
5139
uses: peaceiris/[email protected]
5240
with:
5341
github_token: ${{ secrets.GITHUB_TOKEN }}
5442
publish_dir: ./docs/_build/html
55-

databook_utils/insert_authors_version.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@ class VersionNumber(Directive):
101101

102102
def run(self):
103103
try:
104-
latest_version = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"], encoding="utf8")
105-
except:
106-
raise EnvironmentError("There are no git tags from which to get the version number")
104+
latest_version = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"],
105+
encoding="utf8",
106+
stderr=subprocess.STDOUT # capture stderr in the output
107+
)
108+
except subprocess.CalledProcessError as e:
109+
raise EnvironmentError(f"There are no git tags from which to get the version number.\n" f"error:\n{e.output}") from e
107110

108111
if self.arguments:
109112
paragraph_node = nodes.paragraph()

0 commit comments

Comments
 (0)