Skip to content

Commit f4d19d8

Browse files
authored
Merge pull request #139 from pllim/last-actions-hero
MNT: Bump Python and Sphinx, use Actions, new matrix
2 parents 90b314e + 0efa1b4 commit f4d19d8

File tree

9 files changed

+159
-88
lines changed

9 files changed

+159
-88
lines changed

.coveragerc

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
[run]
22
source = sphinx_automodapi
3-
omit = */tests/*
4-
5-
[paths]
6-
source =
7-
sphinx_automodapi/
8-
*/site-packages/sphinx_automodapi
9-
*\site-packages\sphinx_automodapi
3+
omit =
4+
sphinx_automodapi/tests/*
5+
*/sphinx_automodapi/tests/*
106

117
[report]
12-
omit = */tests/*
8+
exclude_lines =
9+
# Have to re-enable the standard pragma
10+
pragma: no cover
11+
# Don't complain about packages we have installed
12+
except ImportError
13+
# Don't complain if tests don't hit assertions
14+
raise AssertionError
15+
raise NotImplementedError
16+
# Don't complain about script hooks
17+
def main\(.*\):
18+
# Ignore branches that don't pertain to this version of Python
19+
pragma: py{ignore_python_version}
20+
# Don't complain about IPython completion helper
21+
def _ipython_key_completions_

.github/workflows/ci_workflows.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
tags:
8+
workflow_dispatch:
9+
schedule:
10+
# Monthly cron
11+
- cron: '0 8 1 * *'
12+
13+
jobs:
14+
tests:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
include:
20+
- name: Code style checks
21+
os: ubuntu-latest
22+
python-version: 3.x
23+
toxenv: codestyle
24+
25+
# Linux - test different Sphinx versions
26+
- os: ubuntu-latest
27+
python-version: 3.7
28+
toxenv: py37-test-sphinx24
29+
- os: ubuntu-latest
30+
python-version: 3.8
31+
toxenv: py38-test-sphinx35
32+
- os: ubuntu-latest
33+
python-version: 3.8
34+
toxenv: py38-test-sphinx40
35+
- os: ubuntu-latest
36+
python-version: 3.9
37+
toxenv: py39-test-sphinx41
38+
- os: ubuntu-latest
39+
python-version: 3.9
40+
toxenv: py39-test-sphinx42
41+
- os: ubuntu-latest
42+
python-version: '3.10'
43+
toxenv: py310-test-sphinx43-cov-clocale
44+
- os: ubuntu-latest
45+
python-version: '3.10'
46+
toxenv: py310-test-sphinxdev
47+
48+
# MacOS X - just the oldest, stable, and dev
49+
- os: macos-latest
50+
python-version: 3.7
51+
toxenv: py37-test-sphinx24
52+
- os: macos-latest
53+
python-version: 3.8
54+
toxenv: py38-test-sphinx43-clocale
55+
- os: macos-latest
56+
python-version: 3.9
57+
toxenv: py39-test-sphinxdev
58+
59+
# Windows - just the oldest, stable, and dev
60+
- os: windows-latest
61+
python-version: 3.7
62+
toxenv: py37-test-sphinx24
63+
- os: windows-latest
64+
python-version: 3.8
65+
toxenv: py38-test-sphinx43-clocale
66+
- os: windows-latest
67+
python-version: 3.9
68+
toxenv: py39-test-sphinxdev
69+
70+
steps:
71+
- uses: actions/checkout@v2
72+
with:
73+
fetch-depth: 0
74+
- name: Set up Python ${{ matrix.python-version }}
75+
uses: actions/setup-python@v2
76+
with:
77+
python-version: ${{ matrix.python-version }}
78+
- name: Install graphviz on Linux
79+
if: startsWith(matrix.os, 'ubuntu')
80+
run: |
81+
sudo apt-get update
82+
sudo apt-get install graphviz
83+
- name: Install graphviz on OSX
84+
if: startsWith(matrix.os, 'macos')
85+
run: |
86+
brew update
87+
brew install graphviz
88+
- name: Install graphviz on Windows
89+
if: startsWith(matrix.os, 'windows')
90+
run: choco install graphviz
91+
- name: Install tox
92+
run: python -m pip install tox
93+
- name: Install codecov
94+
if: ${{ contains(matrix.toxenv,'-cov') }}
95+
run: python -m pip install codecov
96+
- name: Run tox
97+
run: tox ${{ matrix.toxargs }} -v -e ${{ matrix.toxenv }}
98+
- name: Upload coverage to codecov
99+
if: ${{ contains(matrix.toxenv,'-cov') }}
100+
uses: codecov/codecov-action@v2
101+
with:
102+
file: ./coverage.xml

.github/workflows/publish.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ jobs:
2020
with:
2121
python-version: 3.8
2222

23-
- name: Install python-build and twine
24-
run: python -m pip install pip build "twine>=3.3" -U
23+
- name: Install dependencies
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install graphviz
27+
python -m pip install pip build "twine>=3.3" -U
2528
2629
- name: Build package
2730
run: python -m build --sdist --wheel .
@@ -36,8 +39,9 @@ jobs:
3639
run: |
3740
cd ..
3841
python -m venv testenv
39-
testenv/bin/pip install pytest sphinx_automodapi/dist/*.whl
40-
testenv/bin/pytest sphinx_automodapi
42+
testenv/bin/pip install pip -U
43+
testenv/bin/pip install pytest cython sphinx-automodapi/dist/*.whl
44+
testenv/bin/pytest sphinx-automodapi/sphinx_automodapi/tests
4145
4246
- name: Publish distribution 📦 to PyPI
4347
if: startsWith(github.ref, 'refs/tags')

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Changes in sphinx-automodapi
1111
- Add ``:include:`` option to do the opposite of ``:skip:``. [#127]
1212

1313
- Various infrastructure/packaging updates and code clean-ups.
14-
[#120, #124, #126, #133]
14+
Minimum supported Python version is now 3.7 and Sphinx 2.
15+
[#120, #124, #126, #133, #139]
1516

1617
0.13 (2020-09-24)
1718
-----------------

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|Azure Status| |Coverage Status| |PyPI|
1+
|CI Status| |Coverage Status| |PyPI|
22

33
About
44
=====
@@ -20,12 +20,12 @@ or if you have `tox <https://tox.readthedocs.io/en/latest/>`_ installed::
2020

2121
tox -e test
2222

23-
.. |Azure Status| image:: https://dev.azure.com/astropy-project/sphinx-automodapi/_apis/build/status/astropy.sphinx-automodapi?branchName=main
24-
:target: https://dev.azure.com/astropy-project/sphinx-automodapi/_build/latest?definitionId=2&branchName=main
23+
.. |CI Status| image:: https://github.com/astropy/sphinx-automodapi/workflows/CI/badge.svg
24+
:target: https://github.com/astropy/sphinx-automodapi/actions
2525
.. |Coverage Status| image:: https://codecov.io/gh/astropy/sphinx-automodapi/branch/main/graph/badge.svg
2626
:target: https://codecov.io/gh/astropy/sphinx-automodapi
2727
.. |PyPI| image:: https://img.shields.io/pypi/v/sphinx-automodapi.svg
28-
:target: https://pypi.python.org/pypi/sphinx-automodapi
28+
:target: https://pypi.python.org/pypi/sphinx-automodapi
2929

3030
Development status
3131
------------------

azure-pipelines.yml

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

setup.cfg

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ classifiers =
1818
[options]
1919
zip_safe = False
2020
packages = find:
21-
python_requires = >=3.6
21+
python_requires = >=3.7
2222
install_requires =
23-
sphinx>=1.7
23+
sphinx>=2
2424

2525
[options.extras_require]
2626
test =
2727
pytest
2828
pytest-cov
2929
cython
3030
codecov
31-
coverage < 5.0
31+
coverage
3232

3333
[options.package_data]
3434
sphinx_automodapi = templates/*/*.rst
@@ -45,4 +45,5 @@ filterwarnings =
4545
ignore:'environmentfilter' is renamed to 'pass_environment':DeprecationWarning
4646

4747
[flake8]
48-
max-line-length = 100
48+
max-line-length = 125
49+
exclude = sphinx_automodapi/tests/test_autodoc_enhancements.py,sphinx_automodapi/tests/test_automodapi.py

sphinx_automodapi/automodsumm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def process_automodsumm_generation(app):
260260
if lines: # empty list means no automodsumm entry is in the file
261261
outfn = os.path.join(app.srcdir, sfn) + '.automodsumm'
262262
with open(outfn, 'w') as f:
263-
for l in lines:
263+
for l in lines: # noqa: E741
264264
f.write(l)
265265
f.write('\n')
266266

tox.ini

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
[tox]
2-
envlist = py{36,37,38}-test-sphinx{17,18,20,21,22,23,24,30,31,32,dev}{-clocale,}
2+
envlist = py{37,38,39,310}-test-sphinx{24,35,40,41,42,43,dev}{,-cov}{-clocale,}
33
requires = pip >= 18.0
44
setuptools >= 30.3.0
5+
isolated_build = true
56

67
[testenv]
78
changedir = .tmp/{envname}
89
deps =
9-
sphinx17: sphinx==1.7.*
10-
sphinx18: sphinx==1.8.*
11-
sphinx20: sphinx==2.0.*
12-
sphinx21: sphinx==2.1.*
13-
sphinx22: sphinx==2.2.*
14-
sphinx23: sphinx==2.3.*
1510
sphinx24: sphinx==2.4.*
16-
sphinx30: sphinx==3.0.*
17-
sphinx31: sphinx==3.1.*
18-
sphinx32: sphinx==3.2.*
11+
sphinx35: sphinx==3.5.*
12+
sphinx40: sphinx==4.0.*
13+
sphinx41: sphinx==4.1.*
14+
sphinx42: sphinx==4.2.*
15+
sphinx43: sphinx==4.3.*
1916
sphinxdev: git+https://github.com/sphinx-doc/sphinx.git
2017
extras =
2118
test: test
2219
commands =
23-
test: pytest --pyargs sphinx_automodapi
20+
pip freeze
21+
!cov: pytest --pyargs sphinx_automodapi
22+
cov: pytest --pyargs sphinx_automodapi --cov sphinx_automodapi --cov-config={toxinidir}/setup.cfg {posargs}
23+
cov: coverage xml -o {toxinidir}/coverage.xml
24+
passenv = HOME WINDIR LC_ALL LC_CTYPE LANG CC CI
2425
setenv =
26+
cov: CFLAGS = --coverage -fno-inline-functions -O0
2527
clocale: LC_CTYPE=C
2628
clocale: LC_ALL=C
2729
clocale: LANG=C
2830
platform =
2931
clocale: linux|darwin
32+
33+
[testenv:codestyle]
34+
skip_install = true
35+
changedir = {toxinidir}
36+
description = Run all style and file checks with pre-commit
37+
deps = flake8
38+
commands = flake8 sphinx_automodapi --count

0 commit comments

Comments
 (0)