Skip to content

Commit 5195e30

Browse files
committed
Update pre-commit and isort
1 parent cb0ac59 commit 5195e30

8 files changed

Lines changed: 33 additions & 22 deletions

File tree

.pre-commit-config.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ repos:
1111
- id: black
1212
args: ["--target-version", "py36"]
1313

14+
- repo: https://github.com/PyCQA/isort
15+
rev: 5.6.4
16+
hooks:
17+
- id: isort
18+
1419
- repo: https://gitlab.com/pycqa/flake8
1520
rev: 3.8.4
1621
hooks:
1722
- id: flake8
1823
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
1924

20-
- repo: https://github.com/timothycrosley/isort
21-
rev: 5.6.4
22-
hooks:
23-
- id: isort
24-
2525
- repo: https://github.com/pre-commit/pygrep-hooks
2626
rev: v1.7.0
2727
hooks:
@@ -33,6 +33,7 @@ repos:
3333
- id: check-merge-conflict
3434
- id: check-toml
3535
- id: check-yaml
36+
- id: end-of-file-fixer
3637

3738
- repo: https://github.com/PyCQA/pydocstyle
3839
rev: 5.1.1
@@ -41,6 +42,11 @@ repos:
4142
args: ["--convention", "google"]
4243
files: "src/"
4344

45+
- repo: https://github.com/tox-dev/tox-ini-fmt
46+
rev: 0.5.0
47+
hooks:
48+
- id: tox-ini-fmt
49+
4450
- repo: https://github.com/asottile/setup-cfg-fmt
4551
rev: v1.15.1
4652
hooks:

setup.cfg

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,7 @@ max_line_length = 88
5656
convention = google
5757

5858
[tool:isort]
59-
known_third_party = freezegun,humanize,pkg_resources,pytest,setuptools
60-
force_grid_wrap = 0
61-
include_trailing_comma = True
62-
line_length = 88
63-
multi_line_output = 3
64-
use_parentheses = True
59+
profile = black
6560

6661
[tool:pytest]
6762
addopts = --color=yes

src/humanize/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Main package for humanize."""
22
import pkg_resources
3+
34
from humanize.filesize import naturalsize
45
from humanize.i18n import activate, deactivate, thousands_separator
56
from humanize.number import apnumber, fractional, intcomma, intword, ordinal, scientific

tests/test_filesize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
"""Tests for filesize humanizing."""
44

5-
import humanize
65
import pytest
76

7+
import humanize
8+
89

910
@pytest.mark.parametrize(
1011
"test_args, expected",

tests/test_i18n.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import datetime as dt
22
import importlib
33

4-
import humanize
54
import pytest
65

6+
import humanize
7+
78

89
def test_i18n():
910
three_seconds = dt.timedelta(seconds=3)

tests/test_number.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
"""Number tests."""
44

5-
import humanize
65
import pytest
6+
7+
import humanize
78
from humanize import number
89

910

tests/test_time.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
import datetime as dt
66

7-
import humanize
87
import pytest
98
from freezegun import freeze_time
9+
10+
import humanize
1011
from humanize import time
1112

1213
ONE_DAY_DELTA = dt.timedelta(days=1)

tox.ini

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{36, 37, 38, 39, py3}
3+
py{py3, 39, 38, 37, 36}
44

55
[testenv]
66
extras =
@@ -9,14 +9,19 @@ commands =
99
{envpython} -m pytest --cov humanize --cov tests --cov-report xml {posargs}
1010

1111
[testenv:docs]
12-
deps = -r docs/requirements.txt
13-
commands = mkdocs build
12+
deps =
13+
-r
14+
commands =
15+
mkdocs build
1416

1517
[testenv:lint]
16-
deps = pre-commit
17-
commands = pre-commit run --all-files --show-diff-on-failure
18+
passenv =
19+
PRE_COMMIT_COLOR
1820
skip_install = true
19-
passenv = PRE_COMMIT_COLOR
21+
deps =
22+
pre-commit
23+
commands =
24+
pre-commit run --all-files --show-diff-on-failure
2025

2126
[pytest]
22-
addopts = --doctest-modules
27+
addopts = --doctest-modules

0 commit comments

Comments
 (0)