Skip to content

Commit

Permalink
General CI bump (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky committed Jan 23, 2024
1 parent 12b8e93 commit 35033eb
Show file tree
Hide file tree
Showing 22 changed files with 203 additions and 126 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,46 @@ name: Documentation

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: ['*']

defaults:
run:
shell: bash -l {0}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
uses: actions/checkout@v4

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
condarc-file: ci/condarc
use-mamba: true
python-version: '3.8'
environment-file: ci/requirements-docs.yml
activate-environment: recursive_diff-docs

- name: Show conda options
run: conda config --show

- name: conda info
shell: bash -l {0}
run: conda info

- name: conda list
shell: bash -l {0}
run: conda list

- name: Install
shell: bash -l {0}
run: python -m pip install --no-deps -e .

- name: Build docs
shell: bash -l {0}
run: sphinx-build -n -j auto -b html -d build/doctrees doc build/html

- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: recursive_diff-docs
path: build/html
8 changes: 4 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Linting

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: ['*']

Expand All @@ -11,6 +11,6 @@ jobs:
name: pre-commit hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.0
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.0
82 changes: 57 additions & 25 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,98 @@ name: pytest

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: ['*']

defaults:
run:
shell: bash -l {0}

jobs:
build:
name: ${{ matrix.python-version }} ${{ matrix.requirements }} ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.requirements }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
requirements:
- latest
- minimal
- no_optionals
os:
- ubuntu
- macos
- windows
exclude:
- python-version: '3.9'
os: [ubuntu]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
requirements: [latest]
include:
# Test on macos and windows (first and last version of python only)
- os: macos
python-version: '3.8'
requirements: latest
- os: macos
python-version: '3.12'
requirements: latest
- os: windows
python-version: '3.8'
requirements: latest
- os: windows
python-version: '3.12'
requirements: latest
# Test on minimal requirements
- os: ubuntu
python-version: '3.8'
requirements: minimal
- os: macos
python-version: '3.8'
requirements: minimal
- python-version: '3.10'
- os: windows
python-version: '3.8'
requirements: minimal
# Test without any optional dependencies
- os: ubuntu
python-version: '3.8'
requirements: no_optionals
- os: ubuntu
python-version: '3.12'
requirements: no_optionals
- os: macos
python-version: '3.8'
requirements: no_optionals
- os: macos
python-version: '3.12'
requirements: no_optionals
- os: windows
python-version: '3.8'
requirements: no_optionals
- os: windows
python-version: '3.12'
requirements: no_optionals

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
condarc-file: ci/condarc
use-mamba: true
python-version: ${{ matrix.python-version }}
environment-file: ci/requirements-${{ matrix.requirements }}.yml
activate-environment: recursive_diff

- name: Show conda options
run: conda config --show

- name: conda info
shell: bash -l {0}
run: conda info

- name: conda list
shell: bash -l {0}
run: conda list

- name: Install
shell: bash -l {0}
run: python -m pip install --no-deps -e .

- name: pytest
shell: bash -l {0}
run: |
coverage run -m pytest -v
coverage xml
run: py.test --verbose --cov=recursive_diff --cov-report=xml

- name: codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,30 @@ repos:
- id: absolufy-imports
name: absolufy-imports
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
language_version: python3
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py38-plus
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 23.12.1
hooks:
- id: black
language_version: python3
exclude: versioneer.py
args:
- --target-version=py38
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: mambaforge-22.9

conda:
environment: ci/requirements-docs.yml

python:
install:
- method: pip
path: .

sphinx:
builder: html
configuration: doc/conf.py
fail_on_warning: false
29 changes: 14 additions & 15 deletions HOW_TO_RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ How to issue a release in 15 easy steps

Time required: about an hour.

1. Ensure your master branch is synced to origin:
git pull origin master
1. Ensure your main branch is synced to origin:
git pull origin main
2. Look over whats-new.rst and the docs. Make sure "What's New" is complete
(check the date!) and add a brief summary note describing the release at the
top.
3. If you have any doubts, run the full test suite one final time!
py.test
4. On the master branch, commit the release in git:
4. On the main branch, commit the release in git:
git commit -a -m 'Release vX.Y.Z'
5. Tag the release:
git tag -a vX.Y.Z -m 'vX.Y.Z'
Expand All @@ -20,26 +20,25 @@ Time required: about an hour.
twine upload dist/recursive_diff-X.Y.Z*
You will need to be listed as a package owner at
https://pypi.python.org/pypi/recursive_diff for this to work.
8. Push your changes to master:
git push origin master
8. Push your changes to main:
git push origin main
git push origin --tags
9. Update the stable branch (used by ReadTheDocs) and switch back to master:
9. Update the stable branch (used by ReadTheDocs) and switch back to main:
git checkout stable
git rebase master
git rebase main
git push origin stable
git checkout master
git checkout main
It's OK to force push to 'stable' if necessary.
We also update the stable branch with `git cherrypick` for documentation
only fixes that apply the current released version.
10. Add a section for the next release (v.X.(Y+1)) to doc/whats-new.rst.
11. Commit your changes and push to master again:
11. Commit your changes and push to main again:
git commit -a -m 'Revert to dev version'
git push origin master
You're done pushing to master!
12. Issue the release on GitHub. Open
https://github.com/crusaderky/recursive_diff/releases; the new release should have
automatically appeared. Otherwise, click on "Draft a new release" and paste in the
latest from whats-new.rst.
git push origin main
You're done pushing to main!
12. Issue the release on GitHub. Open https://github.com/crusaderky/recursive_diff/releases;
the new release should have automatically appeared. Otherwise, click on
"Draft a new release" and paste in the latest from whats-new.rst.
13. Update the docs. Login to https://readthedocs.org/projects/recursive_diff/versions/
and switch your new release tag (at the bottom) from "Inactive" to "Active".
It should now build automatically.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
recursive_diff
=============
[![doc-badge](https://github.com/crusaderky/recursive_diff/workflows/Documentation/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
[![lint-badge](https://github.com/crusaderky/recursive_diff/workflows/Linting/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
[![pytest-badge](https://github.com/crusaderky/recursive_diff/workflows/pytest/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
[![codecov-badge](https://codecov.io/gh/crusaderky/recursive_diff/branch/master/graph/badge.svg)](https://codecov.io/gh/crusaderky/recursive_diff/branch/master)
[![doc-badge](https://github.com/crusaderky/recursive_diff/actions/workflows/docs.yml/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
[![pre-commit-badge](https://github.com/crusaderky/recursive_diff/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
[![pytest-badge](https://github.com/crusaderky/recursive_diff/actions/workflows/pytest.yml/badge.svg)](https://github.com/crusaderky/recursive_diff/actions)
[![codecov-badge](https://codecov.io/gh/crusaderky/recursive_diff/branch/main/graph/badge.svg)](https://codecov.io/gh/crusaderky/recursive_diff/branch/main)

Recursively compare two Python data structures

Expand Down
9 changes: 0 additions & 9 deletions ci/condarc

This file was deleted.

6 changes: 3 additions & 3 deletions ci/requirements-docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: recursive_diff-docs
channels:
- conda-forge
- defaults
dependencies:
- python=3.8
- dask
- python=3.12
- sphinx
- sphinx_rtd_theme

- dask
- xarray
3 changes: 1 addition & 2 deletions ci/requirements-latest.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: recursive_diff
channels:
- conda-forge
- defaults
dependencies:
- pytest
- pytest-cov
- packaging
- coverage

- xarray
- dask
Expand Down
3 changes: 1 addition & 2 deletions ci/requirements-minimal.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: recursive_diff
channels:
- conda-forge
- defaults
dependencies:
- pytest
- pytest-cov
- packaging
- coverage

- dask=2.0
- numpy=1.16
Expand Down
3 changes: 1 addition & 2 deletions ci/requirements-no_optionals.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: recursive_diff
channels:
- conda-forge
- defaults
dependencies:
- pytest
- pytest-cov
- packaging
- coverage

- xarray
Loading

0 comments on commit 35033eb

Please sign in to comment.