Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: Add Github Action for testing (#660)
Also add .pre-commit-config.yaml
- Loading branch information
1 parent
2dc1293
commit f5ab1a3
Showing
9 changed files
with
166 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[run] | ||
source = PyPDF2 | ||
branch = True | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
@overload | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
def __str__ | ||
if self\.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__.: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/ci.txt | ||
pip install . | ||
- name: Test with flake8 | ||
run: | | ||
flake8 . --ignore E,F,I,SIM,C,PT,N,ASS,A,P,R,W | ||
- name: Test with pytest | ||
run: | | ||
pytest Tests/tests.py --cov --cov-report term-missing -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
.tox | ||
build | ||
.idea/* | ||
|
||
.coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# pre-commit run --all-files | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-byte-order-marker | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
- id: check-added-large-files | ||
args: ['--maxkb=1000'] | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
args: ["--ignore", "E,W,F"] | ||
# - repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: v0.942 | ||
# hooks: | ||
# - id: mypy | ||
# - repo: https://github.com/psf/black | ||
# rev: 22.3.0 | ||
# hooks: | ||
# - id: black | ||
# - repo: https://github.com/asottile/pyupgrade | ||
# rev: v2.31.1 | ||
# hooks: | ||
# - id: pyupgrade | ||
# args: [--py36-plus] | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: v1.12.1 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==22.1.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pytest | ||
flake8 | ||
flake8-bugbear | ||
pytest-cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.10 | ||
# To update, run: | ||
# | ||
# pip-compile ci.in | ||
# | ||
attrs==21.4.0 | ||
# via | ||
# flake8-bugbear | ||
# pytest | ||
coverage[toml]==6.3.2 | ||
# via pytest-cov | ||
flake8==4.0.1 | ||
# via | ||
# -r ci.in | ||
# flake8-bugbear | ||
flake8-bugbear==22.3.23 | ||
# via -r ci.in | ||
iniconfig==1.1.1 | ||
# via pytest | ||
mccabe==0.6.1 | ||
# via flake8 | ||
packaging==21.3 | ||
# via pytest | ||
pluggy==1.0.0 | ||
# via pytest | ||
py==1.11.0 | ||
# via pytest | ||
pycodestyle==2.8.0 | ||
# via flake8 | ||
pyflakes==2.4.0 | ||
# via flake8 | ||
pyparsing==3.0.7 | ||
# via packaging | ||
pytest==7.1.1 | ||
# via | ||
# -r ci.in | ||
# pytest-cov | ||
pytest-cov==3.0.0 | ||
# via -r ci.in | ||
tomli==2.0.1 | ||
# via | ||
# coverage | ||
# pytest |