Skip to content

Commit a0154e6

Browse files
authored
CI overhaul (#12)
1 parent f94acf7 commit a0154e6

30 files changed

+186
-197
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [ ] Closes #xxxx
2+
- [ ] Tests added / passed
3+
- [ ] Passes `pre-commit run --all-files`

.github/workflows/docs.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
1517

16-
- name: Setup conda environment
17-
uses: goanpeca/setup-miniconda@v1
18+
- name: Setup Conda Environment
19+
uses: conda-incubator/setup-miniconda@v2
1820
with:
19-
miniconda-version: latest
20-
auto-update-conda: true
21-
python-version: 3.7
21+
miniforge-variant: Mambaforge
22+
miniforge-version: latest
23+
condarc-file: ci/condarc
24+
use-mamba: true
25+
python-version: '3.8'
2226
environment-file: ci/requirements-docs.yml
2327
activate-environment: recursive_diff-docs
24-
auto-activate-base: false
2528

2629
- name: conda info
2730
shell: bash -l {0}
@@ -37,7 +40,7 @@ jobs:
3740

3841
- name: Build docs
3942
shell: bash -l {0}
40-
run: sphinx-build -W -n -j auto -b html -d build/doctrees doc build/html
43+
run: sphinx-build -n -j auto -b html -d build/doctrees doc build/html
4144

4245
- uses: actions/upload-artifact@v1
4346
with:

.github/workflows/lint.yml

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

.github/workflows/pre-commit.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: ['*']
8+
9+
jobs:
10+
checks:
11+
name: pre-commit hooks
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-python@v2
16+
- uses: pre-commit/[email protected]

.github/workflows/pytest.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version:
17-
- '3.6'
18-
- '3.7'
19-
- '3.8'
16+
python-version: ['3.8', '3.9', '3.10']
2017
requirements:
2118
- latest
2219
- minimal
@@ -26,26 +23,27 @@ jobs:
2623
- macos
2724
- windows
2825
exclude:
29-
- python-version: '3.7'
26+
- python-version: '3.9'
3027
requirements: minimal
31-
- python-version: '3.8'
28+
- python-version: '3.10'
3229
requirements: minimal
33-
- python-version: '3.7'
34-
requirements: no_optionals
3530

3631
steps:
3732
- name: Checkout
3833
uses: actions/checkout@v2
34+
with:
35+
fetch-depth: 0
3936

4037
- name: Setup Conda Environment
41-
uses: goanpeca/setup-miniconda@v1
38+
uses: conda-incubator/setup-miniconda@v2
4239
with:
43-
miniconda-version: latest
44-
auto-update-conda: true
40+
miniforge-variant: Mambaforge
41+
miniforge-version: latest
42+
condarc-file: ci/condarc
43+
use-mamba: true
4544
python-version: ${{ matrix.python-version }}
4645
environment-file: ci/requirements-${{ matrix.requirements }}.yml
4746
activate-environment: recursive_diff
48-
auto-activate-base: false
4947

5048
- name: conda info
5149
shell: bash -l {0}

.pre-commit-config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
repos:
2+
- repo: https://github.com/MarcoGorelli/absolufy-imports
3+
rev: v0.3.1
4+
hooks:
5+
- id: absolufy-imports
6+
name: absolufy-imports
7+
- repo: https://github.com/pycqa/isort
8+
rev: 5.10.1
9+
hooks:
10+
- id: isort
11+
language_version: python3
12+
- repo: https://github.com/asottile/pyupgrade
13+
rev: v2.31.1
14+
hooks:
15+
- id: pyupgrade
16+
args:
17+
- --py38-plus
18+
- repo: https://github.com/psf/black
19+
rev: 22.1.0
20+
hooks:
21+
- id: black
22+
language_version: python3
23+
exclude: versioneer.py
24+
args:
25+
- --target-version=py38
26+
- repo: https://gitlab.com/pycqa/flake8
27+
rev: 4.0.1
28+
hooks:
29+
- id: flake8
30+
language_version: python3
31+
- repo: https://github.com/pre-commit/mirrors-mypy
32+
rev: v0.942
33+
hooks:
34+
- id: mypy
35+
additional_dependencies:
36+
# Typed libraries
37+
- numpy
38+
- pandas
39+
- xarray

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
recursive_diff
22
=============
33
[![doc-badge](https://github.com/crusaderky/recursive_diff/workflows/Documentation/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
4-
[![lint-badge](https://github.com/crusaderky/recursive_diff/workflows/Lint/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
4+
[![lint-badge](https://github.com/crusaderky/recursive_diff/workflows/Linting/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
55
[![pytest-badge](https://github.com/crusaderky/recursive_diff/workflows/pytest/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
66
[![codecov-badge](https://codecov.io/gh/crusaderky/recursive_diff/branch/master/graph/badge.svg)](https://codecov.io/gh/crusaderky/recursive_diff/branch/master)
77

ci/condarc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
channels:
2+
- conda-forge
3+
- defaults
4+
channel_priority: true
5+
auto_activate_base: false
6+
remote_backoff_factor: 20
7+
remote_connect_timeout_secs: 20.0
8+
remote_max_retries: 10
9+
remote_read_timeout_secs: 60.0

ci/requirements-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- python=3.7
6+
- python=3.8
77
- dask
8-
- sphinx=2
8+
- sphinx
99
- sphinx_rtd_theme
1010
- xarray

ci/requirements-latest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ channels:
44
- defaults
55
dependencies:
66
- pytest
7+
- packaging
78
- coverage
9+
810
- xarray
911
- dask
1012
- h5netcdf # NetCDF engine

0 commit comments

Comments
 (0)