Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 902b78d

Browse files
authored
Merge branch 'xarray-contrib:main' into custom_index
2 parents 09fc1fe + 08e762e commit 902b78d

File tree

72 files changed

+20538
-17465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+20538
-17465
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM pangeo/base-image:2023.12.03
1+
FROM pangeo/base-image:2024.06.28
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"build": {
3+
"dockerfile": "../Dockerfile",
4+
"context": "../../conda"
5+
},
6+
"postCreateCommand": {
7+
"jupyterlab": "mkdir /home/jovyan/.jupyter && cp ${containerWorkspaceFolder}/.devcontainer/scipy2024/jupyter_lab_config.py /home/jovyan/.jupyter/jupyter_lab_config.py",
8+
"vscode": "mkdir ${containerWorkspaceFolder}/.vscode && cp ${containerWorkspaceFolder}/.devcontainer/scipy2024/tasks.json ${containerWorkspaceFolder}/.vscode/tasks.json"
9+
},
10+
"hostRequirements": {
11+
"cpus": 2
12+
},
13+
"customizations": {
14+
"codespaces": {
15+
"openFiles": ["workshops/scipy2024/index.ipynb"]
16+
},
17+
"vscode": {
18+
"extensions": ["ms-toolsai.jupyter", "ms-python.python"]
19+
}
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Configuration file for lab.
2+
3+
c = get_config() # noqa
4+
5+
## The default URL to redirect to from `/`
6+
# Default: '/lab'
7+
c.LabApp.default_url = '/lab/tree/workshops/scipy2024/index.ipynb'
8+
9+
## Set the Access-Control-Allow-Origin header
10+
#
11+
# Use '*' to allow any origin to access your server.
12+
#
13+
# Takes precedence over allow_origin_pat.
14+
# Default: ''
15+
c.ServerApp.allow_origin = '*'

.devcontainer/scipy2024/tasks.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "jupyterlab",
6+
"type": "shell",
7+
"command": "/srv/conda/envs/notebook/bin/jupyter lab --no-browser",
8+
"presentation": {
9+
"reveal": "always"
10+
},
11+
"runOptions": {
12+
"runOn": "folderOpen"
13+
}
14+
}
15+
]
16+
}

.github/dependabot.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# Regularly update Docker tags and Actions steps
12
version: 2
23
updates:
3-
- package-ecosystem: 'docker'
4-
directory: '/.devcontainer'
4+
- package-ecosystem: "docker"
5+
directory: "/.devcontainer"
56
schedule:
6-
interval: 'daily'
7+
interval: "daily"
8+
- package-ecosystem: "github-actions"
9+
directory: "/.github"
10+
schedule:
11+
interval: "monthly"

.github/workflows/main.yaml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: CI
1+
name: Deploy Website to GitHub Pages
22

33
on:
44
push:
55
branches: main
6-
pull_request:
7-
branches: main
6+
paths-ignore:
7+
- ".devcontainer/**"
88

99
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1010
permissions:
@@ -18,19 +18,19 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
build-and-deploy:
21+
build:
2222
runs-on: ubuntu-latest
2323

2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727

2828
- name: Setup JupyterBook Cache
29-
uses: actions/cache@v3
29+
uses: actions/cache@v4
3030
with:
3131
path: _build
3232
# NOTE: change key to "jupyterbook-DATE" to force rebuilding cache
33-
key: jupyterbook-20230707
33+
key: jupyterbook-20240517
3434

3535
- name: Install Conda environment with Micromamba
3636
uses: mamba-org/setup-micromamba@v1
@@ -50,19 +50,31 @@ jobs:
5050
run: |
5151
if (test -a _build/html/reports/*log); then cat _build/html/reports/*log ; fi
5252
53-
- name: Save Build
53+
- name: Save Build Folder
5454
if: always()
55-
uses: actions/upload-artifact@v3
55+
uses: actions/upload-artifact@v4
5656
with:
5757
name: build
5858
path: _build/
5959

60-
- name: Publish to GitHub Pages
61-
if: github.ref == 'refs/heads/main'
62-
uses: peaceiris/actions-gh-pages@v3
60+
- name: Upload Pages Artifact
61+
uses: actions/upload-pages-artifact@v3
6362
with:
64-
github_token: ${{ secrets.GITHUB_TOKEN }}
65-
publish_dir: _build/html
66-
publish_branch: gh-pages
67-
cname: tutorial.xarray.dev
68-
enable_jekyll: false
63+
path: _build/html
64+
65+
# Publish Website to GitHub Pages if built successfully
66+
deploy:
67+
needs: build
68+
if: github.ref == 'refs/heads/main'
69+
runs-on: ubuntu-latest
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
74+
steps:
75+
- name: Setup Pages
76+
uses: actions/configure-pages@v5
77+
78+
- name: Deploy to GitHub Pages
79+
id: deployment
80+
uses: actions/deploy-pages@v4

.github/workflows/preview.yaml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/pull_request.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Pull Request Build
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, closed]
6+
paths-ignore:
7+
- ".devcontainer/**"
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
preview:
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
shell: bash -el {0}
19+
steps:
20+
- name: Checkout repository
21+
if: github.event.action != 'closed'
22+
uses: actions/checkout@v4
23+
24+
- name: Setup JupyterBook Cache
25+
if: github.event.action != 'closed'
26+
uses: actions/cache@v4
27+
with:
28+
path: _build
29+
# NOTE: change key to "jupyterbook-DATE" to force rebuilding cache
30+
key: jupyterbook-20240517
31+
32+
- name: Install Conda environment with Micromamba
33+
if: github.event.action != 'closed'
34+
uses: mamba-org/setup-micromamba@v1
35+
with:
36+
environment-file: conda/conda-lock.yml
37+
environment-name: xarray-tutorial
38+
cache-environment: true
39+
40+
- name: Build JupyterBook
41+
if: github.event.action != 'closed'
42+
run: |
43+
jupyter-book build ./ --warningiserror --keep-going
44+
45+
- name: Dump Build Logs
46+
if: github.event.action != 'closed'
47+
run: |
48+
if (test -a _build/html/reports/*log); then cat _build/html/reports/*log ; fi
49+
50+
- name: Upload artifact
51+
if: github.event.action != 'closed'
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: html
55+
path: _build/html

.github/workflows/qaqc.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
branches:
66
- main
7+
paths-ignore:
8+
- ".devcontainer/**"
79

810
concurrency:
911
group: ${{ github.workflow }}-${{ github.ref }}
@@ -17,7 +19,7 @@ jobs:
1719
shell: bash -el {0}
1820

1921
steps:
20-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2123

2224
- name: Install Conda environment with Micromamba
2325
uses: mamba-org/setup-micromamba@v1
@@ -33,7 +35,7 @@ jobs:
3335
with:
3436
check_filenames: true
3537
check_hidden: true
36-
skip: '.git,*.js,qaqc.yml'
38+
skip: ".git,*.js,qaqc.yml"
3739
ignore_words_list: hist,nd
3840

3941
# borrowed from https://github.com/ProjectPythia/pythia-foundations/blob/main/.github/workflows/link-checker.yaml

.github/workflows/surge_preview.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Pull Request Preview
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Pull Request Build"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
pull-requests: write # allow surge-preview to create/update PR comments
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.workflow_run.id }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
# NOTE: match job name in pull_request.yaml
18+
preview:
19+
runs-on: ubuntu-latest
20+
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
21+
22+
steps:
23+
# Ensure folder exists for PR 'closed' case
24+
- run: mkdir html
25+
26+
# Download built HTML from PR Build workflow
27+
- uses: actions/download-artifact@v4
28+
continue-on-error: true
29+
with:
30+
github-token: ${{ github.token }}
31+
run-id: ${{ github.event.workflow_run.id }}
32+
33+
- name: Manage Surge.sh Deployment
34+
id: preview_step
35+
uses: afc163/surge-preview@v1
36+
with:
37+
surge_token: ${{ secrets.SURGE_TOKEN }}
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
build: echo 'Uploading html/ folder contents to Surge.sh...'
40+
dist: html # NOTE: match upload_artifact name in pull_request.yaml
41+
failOnError: true
42+
teardown: true

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ ci:
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.5.0
6+
rev: v4.6.0
77
hooks:
88
- id: trailing-whitespace
99
- id: end-of-file-fixer
1010
- id: check-docstring-first
1111
- id: check-json
12+
exclude: ^.devcontainer/
1213
- id: check-yaml
1314
- id: double-quote-string-fixer
1415

1516
- repo: https://github.com/psf/black
16-
rev: 23.10.1
17+
rev: 24.4.2
1718
hooks:
1819
- id: black
1920
- id: black-jupyter
@@ -24,22 +25,22 @@ repos:
2425
- id: blackdoc
2526

2627
- repo: https://github.com/PyCQA/flake8
27-
rev: 6.1.0
28+
rev: 7.0.0
2829
hooks:
2930
- id: flake8
3031

3132
- repo: https://github.com/PyCQA/isort
32-
rev: 5.12.0
33+
rev: 5.13.2
3334
hooks:
3435
- id: isort
3536

3637
- repo: https://github.com/pre-commit/mirrors-prettier
37-
rev: v3.0.3
38+
rev: v4.0.0-alpha.8
3839
hooks:
3940
- id: prettier
4041

4142
- repo: https://github.com/kynan/nbstripout
42-
rev: 0.6.1
43+
rev: 0.7.1
4344
hooks:
4445
- id: nbstripout
4546
args: [--extra-keys=metadata.kernelspec metadata.language_info.version]

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
*lock.yml
21
conda/

0 commit comments

Comments
 (0)