Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 1ef7e77

Browse files
author
staticdev
committed
Flake8 and fixes
1 parent 13da3c9 commit 1ef7e77

13 files changed

+532
-157
lines changed

.darglint

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[darglint]
2+
strictness = short

.flake8

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[flake8]
2-
select = ANN,B,B9,BLK,C,D,DAR,E,F,S,W
3-
ignore = E203,E501,W503,C901,S308
2+
select = B,B9,C,E,F,N,S,W
3+
ignore = E203,E501,W503,C901,B950
44
max-line-length = 80
55
max-complexity = 10
66
docstring-convention = google

.pre-commit-config.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ repos:
1515
rev: 19.10b0
1616
hooks:
1717
- id: black
18-
# - repo: https://gitlab.com/pycqa/flake8
19-
# rev: 3.7.9
20-
# hooks:
21-
# - id: flake8
22-
# additional_dependencies:
23-
# - flake8-bandit==2.1.2
24-
# - flake8-bugbear==20.1.4
25-
# - flake8-docstrings==1.5.0
26-
# - pep8-naming==0.10.0
27-
# - darglint==1.2.3
18+
- repo: https://gitlab.com/pycqa/flake8
19+
rev: 3.8.1
20+
hooks:
21+
- id: flake8
22+
additional_dependencies:
23+
- flake8-bandit==2.1.2
24+
- flake8-bugbear==20.1.4
25+
- flake8-docstrings==1.5.0
26+
- pep8-naming==0.10.0
27+
- darglint==1.3.0
2828
- repo: https://github.com/asottile/reorder_python_imports
2929
rev: v2.3.0
3030
hooks:

.travis.yml

+2-44
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
language: python
22

33
python:
4-
- "2.7"
5-
- "3.3"
6-
- "3.4"
7-
- "3.5"
84
- "3.6"
5+
- "3.7"
6+
- "3.8"
97

108
env:
11-
- DJANGO="Django>=1.7.0,<1.8.0"
12-
- DJANGO="Django>=1.8.0,<1.9.0"
13-
- DJANGO="Django>=1.9.0,<1.10.0"
14-
- DJANGO="Django>=1.10.0,<1.11.0"
15-
- DJANGO="Django>=1.11.0,<2.0.0"
169
- DJANGO="Django>=2.0.0,<2.1.0"
1710
- DJANGO="Django>=2.1.0,<2.2.0"
1811

@@ -25,38 +18,3 @@ script:
2518

2619
after_success:
2720
- coveralls
28-
29-
matrix:
30-
exclude:
31-
- python: "3.5"
32-
env: DJANGO="Django>=1.7.0,<1.8.0"
33-
- python: "3.6"
34-
env: DJANGO="Django>=1.7.0,<1.8.0"
35-
36-
- python: "3.6"
37-
env: DJANGO="Django>=1.8.0,<1.9.0"
38-
39-
- python: "3.3"
40-
env: DJANGO="Django>=1.9.0,<1.10.0"
41-
- python: "3.6"
42-
env: DJANGO="Django>=1.9.0,<1.10.0"
43-
44-
- python: "3.3"
45-
env: DJANGO="Django>=1.10.0,<1.11.0"
46-
- python: "3.6"
47-
env: DJANGO="Django>=1.10.0,<1.11.0"
48-
49-
- python: "3.3"
50-
env: DJANGO="Django>=1.11.0,<2.0.0"
51-
52-
- python: "2.7"
53-
env: DJANGO="Django>=2.0.0,<2.1.0"
54-
- python: "3.3"
55-
env: DJANGO="Django>=2.0.0,<2.1.0"
56-
57-
- python: "2.7"
58-
env: DJANGO="Django>=2.1.0,<2.2.0"
59-
- python: "3.3"
60-
env: DJANGO="Django>=2.1.0,<2.2.0"
61-
- python: "3.4"
62-
env: DJANGO="Django>=2.1.0,<2.2.0"

noxfile.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Nox sessions."""
22
import contextlib
3-
import shutil
43
import tempfile
54
from pathlib import Path
65
from typing import cast
@@ -12,7 +11,7 @@
1211

1312
package = "django_pagination_bootstrap"
1413
python_versions = ["3.8", "3.7", "3.6"]
15-
nox.options.sessions = "pre-commit", "safety", "mypy", "tests"
14+
nox.options.sessions = "pre-commit", "safety", "mypy" # , "tests"
1615
locations = "src", "tests", "noxfile.py"
1716

1817

@@ -141,8 +140,18 @@ def tests(session: Session) -> None:
141140
"""Run the test suite."""
142141
install_package(session)
143142
install(session, "coverage[toml]", "pytest")
144-
session.run("coverage", "run", "-m", "pytest", *session.posargs)
145-
session.run("coverage", "report")
143+
session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs)
144+
session.notify("coverage")
145+
146+
147+
@nox.session
148+
def coverage(session: Session) -> None:
149+
"""Produce the coverage report."""
150+
args = session.posargs or ["report"]
151+
install(session, "coverage[toml]")
152+
if not session.posargs and any(Path().glob(".coverage.*")):
153+
session.run("coverage", "combine")
154+
session.run("coverage", *args)
146155

147156

148157
@nox.session(python=python_versions)

0 commit comments

Comments
 (0)