Skip to content

Commit

Permalink
add pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <[email protected]>
  • Loading branch information
Zethson committed May 21, 2022
1 parent 8f557cd commit bb4d523
Show file tree
Hide file tree
Showing 17 changed files with 319 additions and 298 deletions.
88 changes: 44 additions & 44 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
name-template: "1.0.0 🌈"
tag-template: 1.0.0
categories:
- title: "🚀 Features"
labels:
- feature
- enhancement
- title: "🐛 Bug Fixes"
labels:
- fix
- bugfix
- bug
- title: "🧰 Maintenance"
label: chore
- title: ":package: Dependencies"
labels:
- dependencies
- build
- dependabot
- DEPENDABOT
- title: "🚀 Features"
labels:
- feature
- enhancement
- title: "🐛 Bug Fixes"
labels:
- fix
- bugfix
- bug
- title: "🧰 Maintenance"
label: chore
- title: ":package: Dependencies"
labels:
- dependencies
- build
- dependabot
- DEPENDABOT
version-resolver:
major:
labels:
- major
minor:
labels:
- minor
patch:
labels:
- patch
default: patch
major:
labels:
- major
minor:
labels:
- minor
patch:
labels:
- patch
default: patch
autolabeler:
- label: chore
files:
- "*.md"
branch:
- '/docs{0,1}\/.+/'
- label: bug
branch:
- /fix\/.+/
title:
- /fix/i
- label: enhancement
branch:
- /feature\/.+/
body:
- "/JIRA-[0-9]{1,4}/"
- label: chore
files:
- "*.md"
branch:
- '/docs{0,1}\/.+/'
- label: bug
branch:
- /fix\/.+/
title:
- /fix/i
- label: enhancement
branch:
- /feature\/.+/
body:
- "/JIRA-[0-9]{1,4}/"
template: |
## Changes
## Changes
$CHANGES
$CHANGES
40 changes: 20 additions & 20 deletions .github/workflows/build_book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ jobs:
build-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Setup environment
run: pip install --upgrade jupyter-book jupytext beautifulsoup4
- name: Setup environment
run: pip install --upgrade jupyter-book jupytext beautifulsoup4

- name: Cache jupyter-cache folder
uses: actions/cache@v2
env:
cache-name: jupyter-cache
with:
path: jupyter-book/_build/.jupyter_cache
key: v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
restore-keys: |
v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
v1-${{ github.ref }}
v1-refs/heads/master
- name: Build the JupyterBook
run: make
- name: Cache jupyter-cache folder
uses: actions/cache@v2
env:
cache-name: jupyter-cache
with:
path: jupyter-book/_build/.jupyter_cache
key: v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
restore-keys: |
v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
v1-${{ github.ref }}
v1-refs/heads/master
- name: Build the JupyterBook
run: make
26 changes: 13 additions & 13 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Labeler

on:
push:
branches:
- main
- master
push:
branches:
- main
- master

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/[email protected]
labeler:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/[email protected]

- name: Run Labeler
uses: crazy-max/[email protected]
with:
skip-delete: true
- name: Run Labeler
uses: crazy-max/[email protected]
with:
skip-delete: true
50 changes: 25 additions & 25 deletions .github/workflows/publish_book.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
name: Publish book

on:
release:
types: [published]
release:
types: [published]

jobs:
build-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Setup environment
run: pip install --upgrade jupyter-book jupytext beautifulsoup4
- name: Setup environment
run: pip install --upgrade jupyter-book jupytext beautifulsoup4

- name: Cache jupyter-cache folder
uses: actions/cache@v2
env:
cache-name: jupyter-cache
with:
path: jupyter-book/_build/.jupyter_cache
key: v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
restore-keys: |
v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
v1-${{ github.ref }}
v1-refs/heads/master
- name: Cache jupyter-cache folder
uses: actions/cache@v2
env:
cache-name: jupyter-cache
with:
path: jupyter-book/_build/.jupyter_cache
key: v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
restore-keys: |
v1-${{ github.ref }}-${{ hashFiles('notebook_scripts/**/*.py') }}
v1-${{ github.ref }}
v1-refs/heads/master
- name: Build the JupyterBook
run: make
- name: Build the JupyterBook
run: make

- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./jupyter-book/_build/html/
32 changes: 16 additions & 16 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Release Drafter
on:
push:
branches:
- development
pull_request:
branches:
- development
types:
- opened
- reopened
- synchronize
push:
branches:
- development
pull_request:
branches:
- development
types:
- opened
- reopened
- synchronize
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
fail_fast: false
default_language_version:
python: python3
default_stages:
- commit
- push
minimum_pre_commit_version: 2.16.0
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
hooks:
- id: prettier
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black-jupyter
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In case of questions or problems, please get in touch by posting an issue in thi

## Adapting the notebooks to other datasets:

All notebooks for the various steps can be found in the [jupyter book folder](extended-single-cell-best-practices/tree/master/jupyter-book).
All notebooks for the various steps can be found in the [jupyter book folder](extended-single-cell-best-practices/tree/master/jupyter-book).
These can easily be reused for your own projects.

## Acknowledgements
Expand Down
26 changes: 13 additions & 13 deletions jupyter-book/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ exclude_patterns:
- "README.md"

execute:
execute_notebooks : 'off'
timeout : 600000
execute_notebooks: "off"
timeout: 600000

parse:
myst_enable_extensions:
Expand All @@ -26,10 +26,10 @@ parse:
- html_image

html:
home_page_in_navbar : false
use_edit_page_button : true
use_repository_button : true
use_issues_button : true
home_page_in_navbar: false
use_edit_page_button: true
use_repository_button: true
use_issues_button: true
favicon: _static/favicon.ico
comments:
hypothesis: true
Expand All @@ -40,11 +40,11 @@ html:
</div>
latex:
latex_engine : "xelatex"
latex_engine: "xelatex"
latex_documents:
targetname: book.tex

notebook_interface : "notebook"
notebook_interface: "notebook"

sphinx:
config:
Expand All @@ -60,12 +60,12 @@ sphinx:
language: en

bibtex_bibfiles:
- references.bib
- references.bib

repository:
url : https://github.com/theislab/extended-single-cell-tutorial
branch : master
url: https://github.com/theislab/extended-single-cell-tutorial
branch: master

binder:
binderhub_url : "https://mybinder.org"
text : "Launch binder"
binderhub_url: "https://mybinder.org"
text: "Launch binder"
Loading

0 comments on commit bb4d523

Please sign in to comment.