Skip to content

Commit 24bb5d1

Browse files
authored
Merge pull request #95 from cadenmyers13/conf
Replace sys.path to pathlib.Path
2 parents 6942139 + 30ba730 commit 24bb5d1

31 files changed

+154
-44
lines changed

.github/workflows/docs.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
9+
pull_request:
10+
branches:
11+
- main
12+
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
shell: bash -l {0}
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
25+
- uses: conda-incubator/setup-miniconda@v2
26+
with:
27+
activate-environment: build
28+
auto-update-conda: true
29+
30+
- name: install requirements
31+
run: >-
32+
conda install -n build -c conda-forge
33+
--file requirements/build.txt
34+
--file requirements/run.txt
35+
--file requirements/docs.txt
36+
--quiet --yes
37+
38+
- name: install the package
39+
run: python -m pip install . --no-deps
40+
41+
- name: build documents
42+
run: make -C doc/manual html
43+
44+
- name: Deploy
45+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
46+
uses: peaceiris/actions-gh-pages@v3
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: ./doc/manual/build/html

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
default_language_version:
2+
python: python3
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: check-yaml
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- repo: https://github.com/ambv/black
11+
rev: 23.3.0
12+
hooks:
13+
- id: black
14+
- repo: https://github.com/pycqa/flake8
15+
rev: 6.0.0
16+
hooks:
17+
- id: flake8
18+
- repo: https://github.com/pycqa/isort
19+
rev: 5.12.0
20+
hooks:
21+
- id: isort
22+
args: ["--profile", "black"]
23+
- repo: https://github.com/kynan/nbstripout
24+
rev: 0.6.1
25+
hooks:
26+
- id: nbstripout
27+
- repo: local
28+
hooks:
29+
- id: prevent-commit-to-main
30+
name: Prevent Commit to Main Branch
31+
entry: ./prevent_commit_to_main.sh
32+
language: script
33+
stages: [commit]

README.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,24 @@ rather than copied to a system directory, use ::
150150

151151
python -m pip install -e .
152152

153+
CONTRIBUTING
154+
------------------------------------------------------------------------
155+
We welcome contributors from the community. Please consider posting issues, and taking issues and posting PRs.
156+
157+
To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit
158+
hooks.
159+
160+
1. modify the permissions to executable on the bash script called ``prevent_commit_to_main.sh`` in this directory: ``chmod +x prevent_commit_to_main.sh``
161+
162+
2. install pre-commit in your working environment with ``conda install pre-commit``
163+
164+
3. initialize pre-commit (one time only) ``pre-commit install``
165+
166+
Thereafter your code will be linted by black and isort and checked against flake8 before you can commit.
167+
If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should
168+
pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before
169+
trying to commit again
170+
153171

154172
CONTACTS
155173
------------------------------------------------------------------------
File renamed without changes.

0 commit comments

Comments
 (0)