Skip to content

Commit 937b154

Browse files
authored
[ENH] Implement Github workflow (#25)
* add ci workflow * add pre-commit-config * add flake8 * fix newline * specify python version * fix test fixtures; add missing reqs in testing env; misc edits in setup * fix pre-commit error * update rtd env reqs * fix rtd & testing envs * add codecov action * publish to pypi
1 parent 2d6d749 commit 937b154

35 files changed

+174
-37
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 88
3+
ignore=E203,W503

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: continuous-integration
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python 3.8
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.8
18+
- uses: pre-commit/action@v2.0.0
19+
20+
tests:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python-version: [3.6, 3.7, 3.8]
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v1
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install dependencies
32+
run : |
33+
python -m pip install --upgrade pip
34+
pip install -e.[testing]
35+
- name: Run pytest
36+
run: |
37+
pytest --duration=10 --cov=sphinxcontrib --cov-report=xml --cov-report=term-missing
38+
- name: Create cov
39+
run: coverage xml
40+
- name: Upload to Codecov
41+
if: matrix.python-version == 3.7
42+
uses: codecov/codecov-action@v1
43+
with:
44+
name: sphinxcontrib-prettyproof-pytest-py3.7
45+
flags: pytests
46+
file: ./coverage.xml
47+
fail_ci_if_error: true
48+
49+
docs:
50+
name: Documentation build
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v2
54+
- name: Set up Python 3.8
55+
uses: actions/setup-python@v1
56+
with:
57+
python-version: 3.8
58+
- name: Install dependencies
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install -e .[rtd]
62+
- name: Build docs
63+
run: |
64+
cd docs
65+
make clean
66+
make html
67+
68+
publish:
69+
name: Publish to PyPi
70+
needs: [pre-commit, tests, docs]
71+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout source
75+
uses: actions/checkout@v2
76+
- name: Set up Python 3.7
77+
uses: actions/setup-python@v1
78+
with:
79+
python-version: 3.7
80+
- name: Build package
81+
run: |
82+
pip install wheel
83+
python setup.py bdist_wheel sdist
84+
- name: Publish
85+
uses: pypa/gh-action-pypi-publish@v1.3.1
86+
with:
87+
user: __token__
88+
password: ${{ secrets.PYPI_KEY }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@ __pycache__
55
.DS_Store
66
.vscode/
77
build/
8-
dist/
8+
dist/
9+
10+
# Unit test / coverage reports
11+
12+
.coverage
13+
coverage.*
14+
coverage.xml

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Install pre-commit hooks via
2+
# pre-commit install
3+
4+
repos:
5+
6+
- repo: git://github.com/pre-commit/pre-commit-hooks
7+
rev: v2.2.3
8+
hooks:
9+
- id: check-yaml
10+
- id: end-of-file-fixer
11+
- id: trailing-whitespace
12+
- id: flake8
13+
14+
- repo: https://github.com/psf/black
15+
rev: 20.8b1
16+
hooks:
17+
- id: black

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
- [x] reference target ```{proof:ref}`target` ```
2020
- [x] reference w/ text ```{proof:ref}`text <target>` ```
2121
- [x] admonition nonumber
22-
- [x] admonition notitle
22+
- [x] admonition notitle

codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 85%
6+
threshold: 0.5%
7+
patch:
8+
default:
9+
target: 80%
10+
threshold: 0.5%

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ help:
1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/runtime.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.7

docs/source/install.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Installation
22

33
The **recommended** method of installation for most users is via `pip` as detailed
4-
in {ref}`getting-started`.
4+
in {ref}`getting-started`.
55

66
You can also install directly from the repository to get the latest `development` version
77

@@ -18,4 +18,3 @@ then run:
1818
```bash
1919
python setup.py install
2020
```
21-

0 commit comments

Comments
 (0)