Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit c5af2e5

Browse files
committed
MOAR Improvements: Cross-OS testing, .gitignore updates, supporting only pylint<3, coverage at Codecov, drop other CI
Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
1 parent 189fe40 commit c5af2e5

File tree

8 files changed

+258
-109
lines changed

8 files changed

+258
-109
lines changed

.github/workflows/run-tests.yaml

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,62 @@
1-
name: Python package
1+
name: Testing
22

33
on:
44
push:
5-
branches:
6-
- master
75
pull_request:
8-
branches:
9-
- master
106

117
jobs:
128
test:
13-
runs-on: ubuntu-latest
9+
runs-on: ${{ matrix.os }}
1410
strategy:
1511
fail-fast: false
1612
matrix:
17-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
13+
os:
14+
- ubuntu-latest
15+
- windows-latest
16+
- macos-latest
17+
python-version:
18+
- '3.6'
19+
- '3.7'
20+
- '3.8'
21+
- '3.9'
22+
- '3.10'
23+
- '3.11'
24+
# - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3
25+
# Python 3.6 is not available in `ubuntu-latest`.
26+
exclude:
27+
- python-version: '3.6'
28+
os: ubuntu-latest
29+
include:
30+
- python-version: '3.6'
31+
os: ubuntu-20.04
32+
33+
defaults:
34+
run:
35+
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || '/bin/bash --noprofile --norc -Eeuxo pipefail {0}' }}
1836

1937
steps:
2038
- uses: actions/checkout@v3
39+
2140
- name: Set up Python ${{ matrix.python-version }}
2241
uses: actions/setup-python@v4
2342
with:
2443
python-version: ${{ matrix.python-version }}
2544
cache: 'pip'
2645
cache-dependency-path: setup.py
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
python -m pip install tox tox-gh-actions
31-
- name: Test with tox
32-
run: tox
3346

34-
test-36:
35-
runs-on: ubuntu-20.04
36-
steps:
37-
- uses: actions/checkout@v3
38-
- name: Set up Python 3.6
39-
uses: actions/setup-python@v4
40-
with:
41-
python-version: 3.6
42-
cache: 'pip'
43-
cache-dependency-path: setup.py
4447
- name: Install dependencies
4548
run: |
4649
python -m pip install --upgrade pip
4750
python -m pip install tox
51+
4852
- name: Test with tox
49-
run: tox -e py36
53+
env:
54+
FORCE_COLOR: 1
55+
run: tox ${{ matrix.python-version == '3.6' && '--skip-missing-interpreters=true' || '' }}
56+
57+
- name: Upload coverage reports to Codecov
58+
uses: codecov/codecov-action@v3
59+
with:
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
fail_ci_if_error: true
62+
files: test_artifacts/cobertura.xml

.gitignore

Lines changed: 166 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,169 @@
1-
*.pyc
1+
sandbox/**/*.py
2+
/test_artifacts/
3+
4+
## Mostly complete version from https://github.com/github/gitignore/blob/e5323759e387ba347a9d50f8b0ddd16502eb71d4/Python.gitignore
5+
6+
# Byte-compiled / optimized / DLL files
27
__pycache__/
3-
.tox/
8+
*.py[cod]
9+
*$py.class
10+
11+
# C extensions
12+
*.so
13+
14+
# Distribution / packaging
15+
.Python
416
build/
5-
sandbox/**/*.py
6-
Pipfile*
17+
develop-eggs/
718
dist/
8-
Makefile
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
*.py,cover
55+
.hypothesis/
56+
.pytest_cache/
57+
cover/
58+
cache/*
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
db.sqlite3
68+
db.sqlite3-journal
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
80+
# PyBuilder
81+
.pybuilder/
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
# For a library or package, you might want to ignore these files since the code is
93+
# intended to run in multiple environments; otherwise, check them in:
94+
# .python-version
95+
96+
# pipenv
97+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
99+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
100+
# install all needed dependencies.
101+
#Pipfile.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/#use-with-ide
116+
.pdm.toml
117+
118+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
119+
__pypackages__/
120+
121+
# Celery stuff
122+
celerybeat-schedule
123+
celerybeat.pid
124+
125+
# SageMath parsed files
126+
*.sage.py
127+
128+
# Environments
129+
.env
130+
.venv
131+
env/
132+
venv/
133+
ENV/
134+
env.bak/
135+
venv.bak/
136+
137+
# Spyder project settings
138+
.spyderproject
139+
.spyproject
140+
141+
# Rope project settings
142+
.ropeproject
143+
144+
# mkdocs documentation
145+
/site
146+
147+
# mypy
148+
.mypy_cache/
149+
.dmypy.json
150+
dmypy.json
151+
152+
# Pyre type checker
153+
.pyre/
154+
155+
# pytype static type analyzer
156+
.pytype/
157+
158+
# Cython debug symbols
159+
cython_debug/
160+
161+
# PyCharm
162+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
163+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
164+
# and can be added to the global gitignore or merged into this file. For a more nuclear
165+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
166+
#.idea/
167+
168+
# VS code
169+
.vscode/launch.json

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pylint-pytest
22

3-
[![Python package](https://github.com/stdedos/pylint-pytest/actions/workflows/run-tests.yaml/badge.svg)](https://github.com/stdedos/pylint-pytest/actions/workflows/run-tests.yaml)
3+
[![Python package](https://github.com/pylint-dev/pylint-pytest/actions/workflows/run-tests.yaml/badge.svg)](https://github.com/pylint-dev/pylint-pytest/actions/workflows/run-tests.yaml)
44
[![PyPI version fury.io](https://badge.fury.io/py/pylint-pytest.svg)](https://pypi.python.org/pypi/pylint-pytest/)
55
[![Travis CI](https://travis-ci.org/reverbc/pylint-pytest.svg?branch=master)](https://travis-ci.org/reverbc/pylint-pytest)
66
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/reverbc/pylint-pytest?branch=master&svg=true)](https://ci.appveyor.com/project/reverbc/pylint-pytest)

appveyor.yml

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

setup.cfg

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,51 @@
22
test = pytest
33

44
[tool:pytest]
5-
addopts = --verbose
5+
addopts = --verbose --cov-report=xml --cov-report=html
66
python_files = tests/test_*.py
77

88
[bdist_wheel]
99
universal = 1
10+
11+
[coverage:run]
12+
branch = True
13+
14+
[coverage:paths]
15+
source =
16+
pylint_pytest/
17+
18+
[coverage:report]
19+
; Regexes for lines to exclude from consideration
20+
exclude_also =
21+
; Have to re-enable the standard pragma
22+
pragma: no cover
23+
24+
; Don't complain about missing debug-only code:
25+
def __repr__
26+
if self\.debug
27+
if settings.DEBUG
28+
29+
; Don't complain if tests don't hit defensive assertion code:
30+
raise AssertionError
31+
raise NotImplementedError
32+
33+
; Don't complain if non-runnable code isn't run:
34+
if 0:
35+
if __name__ == .__main__.:
36+
37+
; Don't complain about abstract methods, they aren't run:
38+
@(abc\.)?abstractmethod
39+
class .*\bProtocol\):
40+
41+
; Ignore type-checking blocks
42+
if TYPE_CHECKING:
43+
; Defensive programming does not need to be covered
44+
raise UnreachableCodeException
45+
46+
ignore_errors = True
47+
48+
[coverage:xml]
49+
output = test_artifacts/cobertura.xml
50+
51+
[coverage:html]
52+
directory = test_artifacts/htmlcov

0 commit comments

Comments
 (0)