Skip to content

Commit d152666

Browse files
author
Katherine L. Bottenhorn
committed
update from master, testing actions docs
2 parents b654cd4 + 3f5acac commit d152666

File tree

21 files changed

+698
-138
lines changed

21 files changed

+698
-138
lines changed

.github/workflows/linting.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Lint Code"
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
concurrency:
12+
group: linting-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
# Determine if tests should be run based on commit message.
17+
check_skip:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
skip: ${{ steps.result_step.outputs.ci-skip }}
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
fetch-depth: 0
25+
- id: result_step
26+
uses: mstachniuk/ci-skip@master
27+
with:
28+
commit-filter: '[skip ci];[ci skip];[skip github]'
29+
commit-filter-separator: ';'
30+
31+
style_check:
32+
needs: check_skip
33+
if: ${{ needs.check_skip.outputs.skip == 'false' }}
34+
runs-on: "ubuntu-latest"
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
os: ["ubuntu-latest"]
39+
python-version: ["3.7"]
40+
name: Style check
41+
defaults:
42+
run:
43+
shell: bash
44+
steps:
45+
- uses: actions/checkout@v2
46+
- name: 'Set up python'
47+
uses: actions/setup-python@v2
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
- name: 'Install IDConn'
51+
shell: bash {0}
52+
run: pip install -e .[tests]
53+
- name: 'Run linter'
54+
shell: bash {0}
55+
run: flake8 idconn
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.7'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
run: |
30+
python setup.py sdist bdist_wheel
31+
twine upload dist/*

.github/workflows/testing.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "Run Tests"
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
concurrency:
12+
group: testing-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
# Determine if tests should be run based on commit message.
17+
check_skip:
18+
name: Determine if CI should be skipped
19+
runs-on: ubuntu-latest
20+
outputs:
21+
skip: ${{ steps.result_step.outputs.ci-skip }}
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
- id: result_step
27+
uses: mstachniuk/ci-skip@master
28+
with:
29+
commit-filter: '[skip ci];[ci skip];[skip github]'
30+
commit-filter-separator: ';'
31+
32+
run_unit_tests:
33+
name: Unit tests
34+
needs: check_skip
35+
if: ${{ needs.check_skip.outputs.skip == 'false' }}
36+
runs-on: ${{ matrix.os }}
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
os: ["ubuntu-latest", "macos-latest"]
41+
python-version: ["3.7", "3.8", "3.9", "3.10"]
42+
defaults:
43+
run:
44+
shell: bash
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: 'Set up python'
48+
uses: actions/setup-python@v2
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
- name: 'Install IDConn'
52+
shell: bash {0}
53+
run: pip install -e .[tests]
54+
- name: 'Run tests'
55+
shell: bash {0}
56+
run: py.test --cov-append --cov-report=xml --cov=idconn idconn
57+
- name: Upload artifacts
58+
uses: actions/upload-artifact@v2
59+
with:
60+
name: unit_${{ matrix.os }}_${{ matrix.python-version }}
61+
path: coverage.xml
62+
if: success()
63+
64+
upload_to_codecov:
65+
name: Upload coverage
66+
needs: [run_unit_tests]
67+
runs-on: "ubuntu-latest"
68+
steps:
69+
- name: Checkout
70+
uses: actions/checkout@v2
71+
- name: Download artifacts
72+
uses: actions/download-artifact@v2
73+
- name: Upload to CodeCov
74+
uses: codecov/codecov-action@v2
75+
with:
76+
fail_ci_if_error: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
docs/auto_examples/
12
*.ipynb_checkpoints/*
23
bad-qa.png
34
cp-corrmats.sh

.readthedocs.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/conf.py
11+
12+
python:
13+
version: 3.8
14+
install:
15+
- method: pip
16+
path: .
17+
extra_requirements:
18+
- doc
19+
system_packages: true

docs/Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@
44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
66
SPHINXOPTS ?=
7-
SPHINXBUILD ?= /Users/kbottenh/Library/Python/3.7/bin/sphinx-build
8-
SOURCEDIR = source
9-
BUILDDIR = build
7+
SPHINXBUILD ?= python -msphinx
8+
SPHINXPROJ = IDConn
9+
SOURCEDIR = .
10+
BUILDDIR = _build
1011

1112
# Put it first so that "make" without argument is like "make help".
1213
help:
1314
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1415

16+
clean:
17+
rm -r _build generated auto_examples
18+
19+
html-noplot:
20+
$(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
21+
@echo
22+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
23+
1524
.PHONY: help Makefile
1625

1726
# Catch-all target: route all unknown targets to Sphinx using the new
File renamed without changes.
File renamed without changes.

docs/_templates/class.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
:mod:`{{module}}`.{{objname}}
2+
{{ underline }}==============
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autoclass:: {{ objname }}
7+
:members:
8+
:inherited-members:
9+
:show-inheritance:
10+
11+
{% block methods %}
12+
{% if methods %}
13+
.. rubric:: Methods
14+
15+
.. autosummary::
16+
17+
{% for item in methods %}
18+
{%- if not item.startswith('_') or item in ['__call__'] %} ~{{ name }}.{{ item }}
19+
{% endif %}
20+
{%- endfor %}
21+
{% endif %}
22+
{% endblock %}
23+
24+
{% block attributes %}
25+
{% if attributes %}
26+
.. rubric:: Properties
27+
28+
.. autosummary::
29+
30+
{% for item in attributes %}
31+
{%- if not item.startswith('_') or item in ['__call__'] %} ~{{ name }}.{{ item }}
32+
{% endif %}
33+
{%- endfor %}
34+
{% endif %}
35+
{% endblock %}
36+
37+
.. include:: {{fullname}}.examples
38+
39+
.. raw:: html
40+
41+
<div class="clearer"></div>

docs/_templates/function.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:mod:`{{module}}`.{{objname}}
2+
{{ underline }}====================
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autofunction:: {{ objname }}
7+
8+
.. include:: {{fullname}}.{{item}}examples
9+
10+
.. raw:: html
11+
12+
<div class='clearer'></div>

0 commit comments

Comments
 (0)