Skip to content

Commit 0fad46f

Browse files
committed
move linter config to setup.cdf
1 parent 9e7e91a commit 0fad46f

4 files changed

Lines changed: 69 additions & 71 deletions

File tree

.pre-commit-config.yaml

Lines changed: 28 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,30 @@
11
repos:
2-
-
3-
repo: https://github.com/pre-commit/mirrors-isort
4-
rev: v4.3.21
5-
hooks:
6-
- id: isort
7-
language_version: python3.7
8-
-
9-
repo: 'https://github.com/psf/black'
10-
rev: stable
11-
hooks:
12-
- id: black
13-
args: ['--safe']
14-
language_version: python3.7
15-
-
16-
repo: https://gitlab.com/PyCQA/flake8
17-
rev: 3.8.3
18-
hooks:
19-
- id: flake8
20-
language_version: python3.7
21-
args: [
22-
# E501 let black handle all line length decisions
23-
# W503 black conflicts with "line break before operator" rule
24-
# E203 black conflicts with "whitespace before ':'" rule
25-
'--ignore=E501,W503,E203']
26-
-
27-
repo: 'https://github.com/chewse/pre-commit-mirrors-pydocstyle'
28-
# 2.1.1
29-
rev: 22d3ccf6cf91ffce3b16caa946c155778f0cb20f
30-
hooks:
31-
- id: pydocstyle
32-
language_version: python3.7
33-
args: [
34-
# Check for docstring presence only
35-
'--select=D1',
36-
# Don't require docstrings for tests
37-
'--match=(?!test).*\.py']
2+
- repo: https://github.com/psf/black
3+
rev: 19.10b0
4+
hooks:
5+
- id: black
6+
language_version: python
387

39-
-
40-
repo: https://github.com/pre-commit/mirrors-mypy
41-
rev: 'v0.782'
42-
hooks:
43-
- id: mypy
44-
exclude: ^python_seed/template
45-
args: [--no-strict-optional, --ignore-missing-imports]
8+
- repo: https://github.com/PyCQA/isort
9+
rev: 5.4.2
10+
hooks:
11+
- id: isort
12+
language_version: python
13+
14+
- repo: https://github.com/PyCQA/flake8
15+
rev: 3.8.3
16+
hooks:
17+
- id: flake8
18+
language_version: python
19+
20+
- repo: https://github.com/PyCQA/pydocstyle
21+
rev: 5.1.1
22+
hooks:
23+
- id: pydocstyle
24+
language_version: python
25+
26+
- repo: https://github.com/pre-commit/mirrors-mypy
27+
rev: v0.812
28+
hooks:
29+
- id: mypy
30+
language_version: python

setup.cfg

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[bumpversion]
2+
current_version = 1.0.1
3+
commit = True
4+
tag = True
5+
tag_name = {new_version}
6+
7+
[bumpversion:file:setup.py]
8+
search = version="{current_version}"
9+
replace = version="{new_version}"
10+
11+
[bumpversion:file:python_seed/__init__.py]
12+
search = __version__ = "{current_version}"
13+
replace = __version__ = "{new_version}"
14+
15+
[isort]
16+
profile = black
17+
known_first_party = python_seed
18+
known_third_party = click
19+
default_section = THIRDPARTY
20+
21+
[flake8]
22+
ignore = E501,W503,E203
23+
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
24+
max-complexity = 12
25+
max-line-length = 90
26+
27+
[mypy]
28+
no_strict_optional = True
29+
ignore_missing_imports = True
30+
exclude = ^python_seed/template
31+
32+
[pydocstyle]
33+
select = D1
34+
match = (?!test).*\.py

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
readme = f.read()
77

88
# Runtime requirements.
9-
inst_reqs = ["click"]
9+
inst_reqs = [
10+
"click",
11+
"importlib_resources>=1.1.0;python_version<'3.9'",
12+
]
1013

1114
extra_reqs = {
1215
"test": ["pytest", "pytest-cov"],
@@ -31,9 +34,10 @@
3134
"Programming Language :: Python :: 3.6",
3235
"Programming Language :: Python :: 3.7",
3336
"Programming Language :: Python :: 3.8",
37+
"Programming Language :: Python :: 3.9",
3438
],
3539
keywords="Python Generator tox pre-commit",
36-
packages=find_packages(exclude=["ez_setup", "examples", "tests"]),
40+
packages=find_packages(exclude=["tests"]),
3741
include_package_data=True,
3842
zip_safe=False,
3943
install_requires=inst_reqs,

tox.ini

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,11 @@
11
[tox]
2-
envlist = py36,py37,py38
2+
envlist = py36,py37,py38,py39
33

44
[testenv]
55
extras = test
66
commands=
77
python -m pytest --cov python_seed --cov-report xml --cov-report term-missing --ignore=python_seed/template/
88

9-
# Lint
10-
[flake8]
11-
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
12-
max-line-length = 90
13-
14-
[mypy]
15-
no_strict_optional = True
16-
ignore_missing_imports = True
17-
18-
[tool:isort]
19-
include_trailing_comma = True
20-
multi_line_output = 3
21-
line_length = 90
22-
known_first_party = python_seed
23-
default_section = THIRDPARTY
24-
25-
# Autoformatter
26-
[testenv:black]
27-
basepython = python3
28-
skip_install = true
29-
deps =
30-
black
31-
commands =
32-
black
33-
349
# Release tooling
3510
[testenv:build]
3611
basepython = python3

0 commit comments

Comments
 (0)