Skip to content

Commit

Permalink
Merge pull request #39 from jGaboardi/update_workflows_etc
Browse files Browse the repository at this point in the history
modernize workflows, etc
  • Loading branch information
knaaptime authored Feb 6, 2023
2 parents a5b711f + 08f5e05 commit 0a4719f
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 141 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
include=PACKAGE_NAME/*
disable_warnings=include-ignored
[report]
omit =
docs/conf.py
setup.py
*/tests/*
versioneer.py
*_version.py

84 changes: 45 additions & 39 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,59 @@
# - Uncomment evertything below the following line to enable the workflow.
#---------------------------------------------------------------------------

#name: Build Docs
#on:
# push:
# branches:
# - main
#jobs:
# docs:
# name: CI (${{ matrix.os }}-${{ matrix.environment-file }})
# runs-on: ${{ matrix.os }}
# continue-on-error: ${{ matrix.experimental }}
# timeout-minutes: 90
# strategy:
# matrix:
# os: ['ubuntu-latest']
# environment-file: [.ci/39.yaml]
# experimental: [false]
# defaults:
# run:
# shell: bash -l {0}
# steps:
# - uses: actions/checkout@v2
# - uses: conda-incubator/setup-miniconda@v2
# with:
# miniconda-version: 'latest'
# channels: conda-forge
# channel-priority: true
# auto-update-conda: false
# auto-activate-base: false
# name: Build Docs
#
# on:
# push:
# # Sequence of patterns matched against refs/tags
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# workflow_dispatch:
# inputs:
# version:
# description: Manual Doc Build
# default: test
# required: false
# jobs:
# docs:
# name: build & push docs
# runs-on: ${{ matrix.os }}
# timeout-minutes: 90
# strategy:
# matrix:
# os: ['ubuntu-latest']
# environment-file: [ci/311-BASE.yaml]
# experimental: [false]
# defaults:
# run:
# shell: bash -l {0}
#
# steps:
# - name: checkout repo
# uses: actions/checkout@v3
#
# - name: setup micromamba
# uses: mamba-org/provision-with-micromamba@main
# with:
# environment-file: ${{ matrix.environment-file }}
# activate-environment: test
# - run: conda info --all
# - run: conda list
# - run: conda config --show-sources
# - run: conda config --show
# - run: cd docs; make html
# - name: Commit documentation changes
# micromamba-version: 'latest'
#
# - name: make docs
# run: cd docs; make html
#
# - name: commit docs
# run: |
# git clone https://github.com/ammaraskar/sphinx-action-test.git --branch #gh-pages --single-branch gh-pages
# git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
# cp -r docs/_build/html/* gh-pages/
# cd gh-pages
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git add .
# git commit -m "Update documentation" -a || true
# # The above command will fail if no changes were present, so we ignore
# # the return code.
# - name: Push changes
# # The above command will fail if no changes were present,
# # so we ignore the return code.
#
# - name: push to gh-pages
# uses: ad-m/github-push-action@master
# with:
# branch: gh-pages
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Continuous Integration for PACKAGE_NAME
#
# Notes:
# - `timeout-minutes` may need to be updated depanding on how long the tests should take.
# - Additional environments can be defined in the ./ci/ directory and added to the `environment-file` list.
# - Swap PACKAGE_NAME for the actual package name.
# - Codecov must be enabled for the repo.
# - Within the project repo, navigate to Setting/Secrets to set `secrets.CODECOV_TOKEN`.
# - Uncomment evertything below the following line to enable the workflow.
#---------------------------------------------------------------------------

#name: Continuous Integration

#on:
# push:
# branches:
# - '*'
# pull_request:
# branches:
# - '*'
# schedule:
# - cron: '59 11 * * *'
# workflow_dispatch:
# inputs:
# version:
# description: Manual Unittest Run
# default: test
# required: false
#
#jobs:
# linting:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# - uses: pre-commit/[email protected]

# testing:
# needs: linting
# env:
# RUN_TEST: pytest PACKAGE_NAME -v -r a -n auto --cov PACKAGE_NAME --doctest-modules --cov-config .coveragerc --cov-report xml --color yes --cov-append --cov-report term-missing
# name: conda (${{ matrix.os }}, ${{ matrix.environment-file }})
# runs-on: ${{ matrix.os }}
# timeout-minutes: 30
# strategy:
# matrix:
# os: [ubuntu-latest]
# environment-file:
# - ci/38.yaml
# - ci/39.yaml
# - ci/310.yaml
# - ci/310.yaml
# - ci/311.yaml
# include:
# - environment-file: ci/311.yaml
# os: macos-latest
# - environment-file: ci/311.yaml
# os: windows-latest
# fail-fast: false
# steps:
# - name: checkout repo
# uses: actions/checkout@v3
#
# - name: setup micromamba
# uses: mamba-org/provision-with-micromamba@main
# with:
# environment-file: ${{ matrix.environment-file }}
# micromamba-version: 'latest'
# channel-priority: 'flexible'
#
# - name: environment info
# shell: bash -l {0}
# run: |
# micromamba info
# micromamba list
#
# - name: spatial versions (if geopandas is installed)
# shell: bash -l {0}
# run: 'python -c "import geopandas; geopandas.show_versions();"'
#
# - name: run tests - bash
# shell: bash -l {0}
# run: ${{ env.RUN_TEST }}
# if: matrix.os != 'windows-latest'
#
# - name: run tests - powershell
# shell: powershell
# run: ${{ env.RUN_TEST }}
# if: matrix.os == 'windows-latest'
#
# - name: codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./coverage.xml
# name: PACKAGE_NAME-codecov
63 changes: 0 additions & 63 deletions .github/workflows/unittests.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
language_version: python3
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
disable=
fixme
6 changes: 5 additions & 1 deletion ci/37.yaml → ci/310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ name: test
channels:
- conda-forge
dependencies:
- python=3.7
- python=3.10
# testing
- pytest
- pytest-cov
- codecov
# formatting / linting
- black
- flake8
- isort
13 changes: 13 additions & 0 deletions ci/311.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.11
# testing
- pytest
- pytest-cov
- codecov
# formatting / linting
- black
- flake8
- isort
4 changes: 4 additions & 0 deletions ci/38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ dependencies:
- pytest
- pytest-cov
- codecov
# formatting / linting
- black
- flake8
- isort
4 changes: 4 additions & 0 deletions ci/39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ dependencies:
- pytest
- pytest-cov
- codecov
# formatting / linting
- black
- flake8
- isort
22 changes: 22 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
codecov:
notify:
after_n_builds: 5
coverage:
range: 50..95
round: nearest
precision: 1
status:
project:
default:
threshold: 2%
patch:
default:
threshold: 2%
target: 80%
ignore:
- "tests/*"
comment:
layout: "reach, diff, files"
behavior: once
after_n_builds: 5
require_changes: true
32 changes: 0 additions & 32 deletions notebooks/.ipynb_checkpoints/example-checkpoint.ipynb

This file was deleted.

Loading

0 comments on commit 0a4719f

Please sign in to comment.