Skip to content

Commit 68e4fb8

Browse files
committed
Merge branch 'main' into jb2
# Conflicts: # .github/workflows/ci.yml # lectures/need_for_speed.md # lectures/numba.md # lectures/numpy_vs_numba_vs_jax.md
2 parents 6f5dbee + 06af1a9 commit 68e4fb8

22 files changed

Lines changed: 1779 additions & 1121 deletions

.github/workflows/cache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ jobs:
3333
run: |
3434
jb build lectures --path-output ./ -W --keep-going
3535
- name: Upload Execution Reports
36-
uses: actions/upload-artifact@v6
36+
uses: actions/upload-artifact@v7
3737
if: failure()
3838
with:
3939
name: execution-reports
4040
path: _build/html/reports
4141
- name: Upload "_build" folder (cache)
42-
uses: actions/upload-artifact@v6
42+
uses: actions/upload-artifact@v7
4343
with:
4444
name: build-cache
4545
path: _build

.github/workflows/execution-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
shell: bash -l {0}
3333
run: jb build lectures --path-output=./ -W --keep-going
3434
- name: Upload Execution Reports
35-
uses: actions/upload-artifact@v6
35+
uses: actions/upload-artifact@v7
3636
if: failure()
3737
with:
3838
name: execution-reports

.github/workflows/execution-osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
shell: bash -l {0}
3333
run: jb build lectures --path-output=./ -W --keep-going
3434
- name: Upload Execution Reports
35-
uses: actions/upload-artifact@v6
35+
uses: actions/upload-artifact@v7
3636
if: failure()
3737
with:
3838
name: execution-reports

.github/workflows/execution-win.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
shell: powershell
3838
run: jb build lectures --path-output=./ -W --keep-going
3939
- name: Upload Execution Reports
40-
uses: actions/upload-artifact@v6
40+
uses: actions/upload-artifact@v7
4141
if: failure()
4242
with:
4343
name: execution-reports

.github/workflows/linkcheck.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ jobs:
1111
permissions:
1212
issues: write # required for QuantEcon link-checker
1313
steps:
14-
# Checkout the live site (html)
15-
- name: Checkout
16-
uses: actions/checkout@v6
17-
with:
18-
ref: gh-pages
14+
# Download the latest release HTML archive (permanent, not subject to artifact expiry)
15+
- name: Get latest release asset URL
16+
id: release
17+
env:
18+
GH_TOKEN: ${{ github.token }}
19+
run: |
20+
ASSET_URL=$(gh api repos/${{ github.repository }}/releases/latest \
21+
--jq '.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url')
22+
echo "asset-url=$ASSET_URL" >> $GITHUB_OUTPUT
23+
- name: Download and extract release HTML
24+
run: |
25+
mkdir -p _site
26+
curl -sL "${{ steps.release.outputs.asset-url }}" | tar -xz -C _site
1927
- name: AI-Powered Link Checker
2028
uses: QuantEcon/action-link-checker@main
2129
with:
22-
html-path: '.' # gh-pages live html
30+
html-path: '_site'
2331
fail-on-broken: 'false'
2432
silent-codes: '403,503'
2533
ai-suggestions: 'true'

.github/workflows/publish.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@ on:
33
push:
44
tags:
55
- 'publish*'
6+
7+
permissions:
8+
contents: write
9+
actions: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
617
jobs:
718
publish:
819
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
920
runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/disk=large"
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
1024
steps:
1125
- name: Checkout
1226
uses: actions/checkout@v6
@@ -52,7 +66,7 @@ jobs:
5266
run: pip list
5367
# Download Build Cache from cache.yml
5468
- name: Download "build" folder (cache)
55-
uses: dawidd6/action-download-artifact@v12
69+
uses: dawidd6/action-download-artifact@v20
5670
with:
5771
workflow: cache.yml
5872
branch: main
@@ -73,7 +87,7 @@ jobs:
7387
run: |
7488
jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter -n -W --keep-going
7589
zip -r download-notebooks.zip _build/jupyter
76-
- uses: actions/upload-artifact@v6
90+
- uses: actions/upload-artifact@v7
7791
with:
7892
name: download-notebooks
7993
path: download-notebooks.zip
@@ -113,12 +127,17 @@ jobs:
113127
html-manifest.json
114128
env:
115129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116-
- name: Deploy website to gh-pages
117-
uses: peaceiris/actions-gh-pages@v4
130+
- name: Add CNAME for custom domain
131+
run: echo "python-programming.quantecon.org" > _build/html/CNAME
132+
- name: Setup Pages
133+
uses: actions/configure-pages@v6
134+
- name: Upload Pages artifact
135+
uses: actions/upload-pages-artifact@v4
118136
with:
119-
github_token: ${{ secrets.GITHUB_TOKEN }}
120-
publish_dir: _build/html/
121-
cname: python-programming.quantecon.org
137+
path: _build/html/
138+
- name: Deploy to GitHub Pages
139+
id: deployment
140+
uses: actions/deploy-pages@v5
122141
- name: Prepare lecture-python-programming.notebooks sync
123142
shell: bash -l {0}
124143
run: |
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Sync Translations — Farsi
2+
# On merged PR, translate changed lectures into the Farsi target repo.
3+
# Comment \translate-resync on a merged PR to re-trigger sync.
4+
name: Sync Translations (Farsi)
5+
6+
on:
7+
pull_request:
8+
types: [closed]
9+
paths:
10+
- 'lectures/**/*.md'
11+
- 'lectures/_toc.yml'
12+
issue_comment:
13+
types: [created]
14+
15+
jobs:
16+
sync:
17+
if: >
18+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
19+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync'))
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v6
24+
with:
25+
fetch-depth: 2
26+
27+
- uses: QuantEcon/action-translation@v0.14.1
28+
with:
29+
mode: sync
30+
target-repo: QuantEcon/lecture-python-programming.fa
31+
target-language: fa
32+
source-language: en
33+
docs-folder: lectures
34+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
35+
github-token: ${{ secrets.QUANTECON_SERVICES_PAT }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Sync Translations — Simplified Chinese
2+
# On merged PR, translate changed lectures into the zh-cn target repo.
3+
# Comment \translate-resync on a merged PR to re-trigger sync.
4+
name: Sync Translations (Simplified Chinese)
5+
6+
on:
7+
pull_request:
8+
types: [closed]
9+
paths:
10+
- 'lectures/**/*.md'
11+
- 'lectures/_toc.yml'
12+
issue_comment:
13+
types: [created]
14+
15+
jobs:
16+
sync:
17+
if: >
18+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
19+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync'))
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v6
24+
with:
25+
fetch-depth: 2
26+
27+
- uses: QuantEcon/action-translation@v0.14.1
28+
with:
29+
mode: sync
30+
target-repo: QuantEcon/lecture-python-programming.zh-cn
31+
target-language: zh-cn
32+
source-language: en
33+
docs-folder: lectures
34+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
35+
github-token: ${{ secrets.QUANTECON_SERVICES_PAT }}

_notebook_repo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
Notebooks for https://python-programming.quantecon.org
66

7-
**Note:** This README should be edited [here](https://github.com/quantecon/lecture-python-programming.myst/.binder)
7+
**Note:** This README should be edited [here](https://github.com/quantecon/lecture-python-programming/.binder)

environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ dependencies:
77
- pip
88
- pip:
99
- jupyter-book>=1.0.4post1,<2.0
10-
- quantecon-book-theme==0.15.1
10+
- quantecon-book-theme==0.20.0
1111
- sphinx-tojupyter==0.6.0
1212
- sphinxext-rediraffe==0.3.0
1313
- sphinx-exercise==1.2.1
14-
- sphinxcontrib-youtube==1.4.1
15-
- sphinx-togglebutton==0.3.2
14+
- sphinxcontrib-youtube==1.5.0
15+
- sphinx-togglebutton==0.4.5
1616

1717

0 commit comments

Comments
 (0)