Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# .coveragerc to control coverage.py

[report]
# Regexes for lines to exclude from consideration
exclude_also =
# Don't complain if non-runnable code isn't run:
if __name__ == .__main__.:
28 changes: 19 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,33 @@ jobs:
exclude:
# TODO Add Windows when regex wheel available for 3.13
- {os: windows-latest, python-version: "3.13"}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: .github/workflows/tests.yml
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install pytest
run: python -m pip install --upgrade pytest
- name: Install sphinx-lint to pull dependencies
run: python -m pip install -v .

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install -U tox

- name: Download more tests from friend projects
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
run: sh download-more-tests.sh
- name: run tests
run: python -m pytest
- name: Tox tests
run: |
tox -e py

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ build/
dist/
__pycache__/
*.egg-info/
.coverage
.envrc
.tox/
.venv/
tests/fixtures/friends/
coverage.xml
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ dependencies = [
dynamic = ["version"]


[project.optional-dependencies]
tests = [
"pytest",
"pytest-cov",
]
[project.urls]
Repository = "https://github.com/sphinx-contrib/sphinx-lint"
Changelog = "https://github.com/sphinx-contrib/sphinx-lint/releases"
Expand Down
19 changes: 19 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tox]
requires =
tox>=4.2
env_list =
py{py3, 313, 312, 311, 310, 39, 38}

[testenv]
extras =
tests
pass_env =
FORCE_COLOR
commands =
{envpython} -m pytest \
--cov sphinxlint \
--cov tests \
--cov-report html \
--cov-report term \
--cov-report xml \
{posargs}