Skip to content

Commit

Permalink
MOAR Improvements: Cross-OS testing, .gitignore updates, supporting…
Browse files Browse the repository at this point in the history
… only `pylint<3`, supporting Python 3.12, coverage at Codecov

Signed-off-by: Stavros Ntentos <[email protected]>
  • Loading branch information
stdedos committed Oct 13, 2023
1 parent 189fe40 commit 7b667e9
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 106 deletions.
48 changes: 26 additions & 22 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,32 @@ name: Python package

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
# - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3
include:
- python-version: 3.6
os: ubuntu-20.04
- python-version: 3.6
os: windows-latest
- python-version: 3.6
os: macos-latest

steps:
- uses: actions/checkout@v3
Expand All @@ -30,20 +43,11 @@ jobs:
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox

test-36:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.6
uses: actions/setup-python@v4
- name: Debugging
run: ls -lah test_artifacts/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
python-version: 3.6
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Test with tox
run: tox -e py36
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: test_artifacts/cobertura.xml
171 changes: 166 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,169 @@
*.pyc
sandbox/**/*.py
/test_artifacts/

## Mostly complete version from https://github.com/github/gitignore/blob/e5323759e387ba347a9d50f8b0ddd16502eb71d4/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
.tox/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
sandbox/**/*.py
Pipfile*
develop-eggs/
dist/
Makefile
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
cache/*

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# VS code
.vscode/launch.json
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pylint-pytest

[![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)
[![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)
[![PyPI version fury.io](https://badge.fury.io/py/pylint-pytest.svg)](https://pypi.python.org/pypi/pylint-pytest/)
[![Travis CI](https://travis-ci.org/reverbc/pylint-pytest.svg?branch=master)](https://travis-ci.org/reverbc/pylint-pytest)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/reverbc/pylint-pytest?branch=master&svg=true)](https://ci.appveyor.com/project/reverbc/pylint-pytest)
Expand Down
36 changes: 0 additions & 36 deletions appveyor.yml

This file was deleted.

43 changes: 43 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,46 @@ python_files = tests/test_*.py

[bdist_wheel]
universal = 1

[coverage:run]
branch = True

[coverage:paths]
source =
pylint_pytest/

[coverage:report]
; Regexes for lines to exclude from consideration
exclude_also =
; Have to re-enable the standard pragma
pragma: no cover

; Don't complain about missing debug-only code:
def __repr__
if self\.debug
if settings.DEBUG

; Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

; Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

; Don't complain about abstract methods, they aren't run:
@(abc\.)?abstractmethod
class .*\bProtocol\):

; Ignore type-checking blocks
if TYPE_CHECKING:
; Defensive programming does not need to be covered
raise UnreachableCodeException

ignore_errors = True

[coverage:xml]
output = test_artifacts/cobertura.xml

[coverage:html]
directory = test_artifacts/htmlcov
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
long_description_content_type='text/markdown',
packages=find_packages(exclude=['tests', 'sandbox']),
install_requires=[
'pylint',
'pylint<3',
'pytest>=4.6',
],
python_requires='>=3.6',
Expand All @@ -41,10 +41,11 @@
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
],
tests_require=['pytest', 'pylint'],
tests_require=['pytest', 'pytest-cov', 'pylint'],
keywords=['pylint', 'pytest', 'plugin'],
)
Loading

0 comments on commit 7b667e9

Please sign in to comment.