-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
template update scverse scverse tutorials v0.2.21 (#108)
Co-authored-by: scverse-bot <None> Co-authored-by: grst <grst@users.noreply.github.com> Co-authored-by: Philipp A <flying-sheep@web.de>
- Loading branch information
1 parent
4be6027
commit d0e6c24
Showing
41 changed files
with
810 additions
and
762 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Based on pydata/xarray | ||
codecov: | ||
require_ci_to_pass: no | ||
require_ci_to_pass: no | ||
|
||
coverage: | ||
status: | ||
project: | ||
default: | ||
# Require 1% coverage, i.e., always succeed | ||
target: 1 | ||
patch: false | ||
changes: false | ||
status: | ||
project: | ||
default: | ||
# Require 1% coverage, i.e., always succeed | ||
target: 1 | ||
patch: false | ||
changes: false | ||
|
||
comment: | ||
layout: diff, flags, files | ||
behavior: once | ||
require_base: no | ||
layout: diff, flags, files | ||
behavior: once | ||
require_base: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"template": "https://github.com/scverse/cookiecutter-scverse", | ||
"commit": "c21b82bf134f3a0f13db7482d4fb04ca1f562d59", | ||
"checkout": "main", | ||
"context": { | ||
"cookiecutter": { | ||
"project_name": "scverse-tutorials", | ||
"package_name": "scverse_tutorials", | ||
"project_description": "A very interesting piece of code", | ||
"author_full_name": "scverse team", | ||
"author_email": "core-team@scverse.org", | ||
"github_user": "scverse", | ||
"project_repo": "https://github.com/scverse/scverse-tutorials", | ||
"license": "BSD 3-Clause License", | ||
"_copy_without_render": [ | ||
".github/workflows/**.yaml", | ||
"docs/_templates/autosummary/**.rst" | ||
], | ||
"_template": "https://github.com/scverse/cookiecutter-scverse" | ||
} | ||
}, | ||
"directory": null | ||
"template": "https://github.com/scverse/cookiecutter-scverse", | ||
"commit": "23a9eaaf101dc9b6d31976f32f7345e1b209b071", | ||
"checkout": "v0.2.21", | ||
"context": { | ||
"cookiecutter": { | ||
"project_name": "scverse-tutorials", | ||
"package_name": "scverse_tutorials", | ||
"project_description": "A very interesting piece of code", | ||
"author_full_name": "scverse team", | ||
"author_email": "core-team@scverse.org", | ||
"github_user": "scverse", | ||
"project_repo": "https://github.com/scverse/scverse-tutorials", | ||
"license": "BSD 3-Clause License", | ||
"_copy_without_render": [ | ||
".github/workflows/**.yaml", | ||
"docs/_templates/autosummary/**.rst" | ||
], | ||
"_template": "https://github.com/scverse/cookiecutter-scverse" | ||
} | ||
}, | ||
"directory": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,80 @@ | ||
name: Execute notebooks | ||
on: | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "docs/**" | ||
- "environment.yml" | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- "docs/**" | ||
- "environment.yml" | ||
|
||
jobs: | ||
runnbs: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.head_ref }} | ||
- name: Cache conda | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if env file has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | ||
- name: Cache notebooks | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if env file has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: .jupyter_cache | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: tutorials | ||
channel-priority: strict | ||
environment-file: environment.yml | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
use-mamba: true | ||
use-only-tar-bz2: true # This needs to be set for caching to work properly! | ||
runnbs: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.head_ref }} | ||
- name: Cache conda | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if env file has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | ||
- name: Cache notebooks | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if env file has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: .jupyter_cache | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: tutorials | ||
channel-priority: strict | ||
environment-file: environment.yml | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
use-mamba: true | ||
use-only-tar-bz2: true # This needs to be set for caching to work properly! | ||
|
||
- name: execute notebooks | ||
run: | | ||
mkdir -p .jupyter_cache | ||
# set kernel to "python3" (just in case someone used a custom conda env kernel locally) | ||
for f in docs/notebooks/*.ipynb ; do | ||
jupytext --to notebook --set-kernel python3 $f | ||
done | ||
- name: execute notebooks | ||
run: | | ||
mkdir -p .jupyter_cache | ||
# set kernel to "python3" (just in case someone used a custom conda env kernel locally) | ||
for f in docs/notebooks/*.ipynb ; do | ||
jupytext --to notebook --set-kernel python3 $f | ||
done | ||
# First remove all notebooks from the project, then add all again. | ||
# This does not remove them from the cache. This step is required since a notebook could be in the cache, but not in the PR. | ||
jcache notebook clear --force | ||
jcache notebook add docs/notebooks/*.ipynb | ||
jcache project execute --timeout 1800 | ||
# First remove all notebooks from the project, then add all again. | ||
# This does not remove them from the cache. This step is required since a notebook could be in the cache, but not in the PR. | ||
jcache notebook clear --force | ||
jcache notebook add docs/notebooks/*.ipynb | ||
jcache project execute --timeout 1800 | ||
- name: output logs | ||
run: | | ||
jcache notebook list | ||
for f in docs/notebooks/*.ipynb ; do | ||
jcache notebook info --tb $f | ||
done | ||
- name: output logs | ||
run: | | ||
jcache notebook list | ||
for f in docs/notebooks/*.ipynb ; do | ||
jcache notebook info --tb $f | ||
done | ||
# write changed outputs back to the ipynb files | ||
# will fail if there was an execution error | ||
- name: merge notebooks | ||
run: | | ||
for f in docs/notebooks/*.ipynb ; do | ||
jcache notebook merge $f $f | ||
done | ||
# write changed outputs back to the ipynb files | ||
# will fail if there was an execution error | ||
- name: merge notebooks | ||
run: | | ||
for f in docs/notebooks/*.ipynb ; do | ||
jcache notebook merge $f $f | ||
done | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Render notebooks | ||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Render notebooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
name: Make JSON of tutorial registry | ||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
schedule: | ||
- cron: "0 2 * * *" | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
schedule: | ||
- cron: "0 2 * * *" | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
mkjson: | ||
runs-on: ubuntu-latest | ||
mkjson: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" # caching pip dependencies | ||
- name: Install dependencies for validation script | ||
run: pip install jsonschema pillow requests pyyaml | ||
- name: Execute validation script and create output directory | ||
run: | | ||
./tutorial-registry/validate.py --outdir=build | ||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: "build" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" # caching pip dependencies | ||
- name: Install dependencies for validation script | ||
run: pip install jsonschema pillow requests pyyaml | ||
- name: Execute validation script and create output directory | ||
run: | | ||
./tutorial-registry/validate.py --outdir=build | ||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: "build" | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: mkjson | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: mkjson | ||
|
||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write | ||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
if: github.ref == 'refs/heads/main' && github.event_name != 'schedule' | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 | ||
- name: Trigger website build | ||
run: | | ||
curl -XPOST \ | ||
-u "scverse-bot:${{ secrets.BOT_GH_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.everest-preview+json" \ | ||
-H "Content-Type: application/json" \ | ||
https://api.github.com/repos/scverse/scverse.github.io/actions/workflows/gh-pages.yml/dispatches \ | ||
--data '{"ref": "main"}' | ||
if: github.ref == 'refs/heads/main' && github.event_name != 'schedule' | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 | ||
- name: Trigger website build | ||
run: | | ||
curl -XPOST \ | ||
-u "scverse-bot:${{ secrets.BOT_GH_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.everest-preview+json" \ | ||
-H "Content-Type: application/json" \ | ||
https://api.github.com/repos/scverse/scverse.github.io/actions/workflows/gh-pages.yml/dispatches \ | ||
--data '{"ref": "main"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install hatch | ||
run: pip install hatch | ||
|
||
- name: Build project for distribution | ||
run: hatch build | ||
|
||
- name: Publish a Python distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
Oops, something went wrong.