-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from sondrelg/pre-commit
Pre-commit config, linting, and type hints
- Loading branch information
Showing
10 changed files
with
140 additions
and
29 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,49 @@ | ||
name: test | ||
|
||
on: | ||
pull_request_target: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cache/pip | ||
~/.cache/pre-commit | ||
key: ${{ runner.os }}-pip-2 | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
- run: python -m pip install pre-commit | ||
- run: pre-commit run --all-files | ||
test: | ||
needs: linting | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.6", "3.7", "3.8", "3.9", ] # "3.10.0-beta.1" | ||
pytest-version: [ "4", "5", "6" ] | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Set up python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Pytest ${{ matrix.pytest-version }} | ||
run: pip install pytest==${{ matrix.pytest-version }} | ||
- name: Install package | ||
run: pip install -e . | ||
- name: Run tests | ||
run: pytest --verbose --assert=plain |
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 |
---|---|---|
|
@@ -43,4 +43,4 @@ venv.bak/ | |
|
||
.idea/ | ||
|
||
/src/*/_version.py | ||
/src/*/_version.py |
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 |
---|---|---|
@@ -1,10 +1,36 @@ | ||
- repo: https://github.com/ambv/black | ||
rev: stable | ||
repos: | ||
- repo: https://github.com/ambv/black | ||
rev: 20.8b1 | ||
hooks: | ||
- id: black | ||
language_version: python3.7 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.4.0 | ||
- id: black | ||
args: ['--quiet'] | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: debug-statements | ||
- id: flake8 | ||
- id: check-ast | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-json | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.8.4 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [ | ||
'flake8-bugbear', | ||
'flake8-comprehensions', | ||
'flake8-deprecated', | ||
'flake8-print', | ||
'flake8-type-checking', | ||
] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: 'v0.812' | ||
hooks: | ||
- id: mypy |
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,3 @@ | ||
[tool.black] | ||
line-length = 88 | ||
include = '\.pyi?$' |
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 |
---|---|---|
@@ -1,2 +1,21 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
max-line-length = 88 | ||
select = | ||
# B: flake8-bugbear | ||
B, | ||
# B950: opt-in flake8-bugbear check: line too long | ||
B950, | ||
# C: complexity, comprehensions, etc | ||
C, | ||
# E: pycodestyle errors | ||
E, | ||
# F: pyflakes violations | ||
F, | ||
# W: pycodestyle warnings | ||
W, | ||
# T: flake8-print, prevent prints | ||
T, | ||
# TC: flake8-type-checking | ||
TC, | ||
# TC1: flake8-type-checking, use futures imports for forward reference management(could have used TC2 instead) | ||
TC2 |
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 |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import setuptools | ||
|
||
|
||
with open("README.md", "r") as readme_file: | ||
long_description = readme_file.read() | ||
|
||
|
||
tests_require = ["pytest", "pytest-cov", "pre-commit"] | ||
|
||
|
||
setuptools.setup( | ||
name="pytest-split", | ||
use_scm_version=dict(write_to="src/pytest_split/_version.py"), | ||
use_scm_version={"write_to": "src/pytest_split/_version.py"}, | ||
author="Jerry Pussinen", | ||
author_email="[email protected]", | ||
description="Pytest plugin for splitting test suite based on test execution time", | ||
|
@@ -25,14 +22,16 @@ | |
install_requires=["pytest"], | ||
extras_require={"testing": tests_require}, | ||
classifiers=[ | ||
"Development Status :: 1 - Planning", | ||
"Intended Audience :: Developers", | ||
"Development Status :: 4 - Beta" "Intended Audience :: Developers", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Framework :: Pytest", | ||
"Typing :: Typed", | ||
], | ||
entry_points={"pytest11": ["pytest-split = pytest_split.plugin"]}, | ||
package_data={"pytest_split": ["py.typed"]}, | ||
) |
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
Empty file.