Skip to content

Commit 6be0547

Browse files
authored
Merge pull request #1 from pylint-dev/ci/improve/use-gh-actions
CI: Use GH-Actions, drop the rest, MOAR Pythons, MOAR OSes, coverage at Codecov Additionally: * Update `.gitignore` * Mark the plugin supporting only `pylint<3`
2 parents 6267638 + c5af2e5 commit 6be0547

File tree

8 files changed

+285
-80
lines changed

8 files changed

+285
-80
lines changed

.github/workflows/run-tests.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
fail-fast: false
12+
matrix:
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}' }}
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
40+
- name: Set up Python ${{ matrix.python-version }}
41+
uses: actions/setup-python@v4
42+
with:
43+
python-version: ${{ matrix.python-version }}
44+
cache: 'pip'
45+
cache-dependency-path: setup.py
46+
47+
- name: Install dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
python -m pip install tox
51+
52+
- name: Test with tox
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 & 33 deletions
This file was deleted.

README.md

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

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)
34
[![PyPI version fury.io](https://badge.fury.io/py/pylint-pytest.svg)](https://pypi.python.org/pypi/pylint-pytest/)
45
[![Travis CI](https://travis-ci.org/reverbc/pylint-pytest.svg?branch=master)](https://travis-ci.org/reverbc/pylint-pytest)
56
[![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

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
long_description_content_type='text/markdown',
2525
packages=find_packages(exclude=['tests', 'sandbox']),
2626
install_requires=[
27-
'pylint',
27+
'pylint<3',
2828
'pytest>=4.6',
2929
],
3030
python_requires='>=3.6',
@@ -39,10 +39,12 @@
3939
'Programming Language :: Python :: 3.7',
4040
'Programming Language :: Python :: 3.8',
4141
'Programming Language :: Python :: 3.9',
42+
'Programming Language :: Python :: 3.10',
43+
'Programming Language :: Python :: 3.11',
4244
'Programming Language :: Python :: Implementation :: CPython',
4345
'Operating System :: OS Independent',
4446
'License :: OSI Approved :: MIT License',
4547
],
46-
tests_require=['pytest', 'pylint'],
48+
tests_require=['pytest', 'pytest-cov', 'pylint'],
4749
keywords=['pylint', 'pytest', 'plugin'],
4850
)

0 commit comments

Comments
 (0)