Skip to content

Commit abe0d16

Browse files
committed
Linting.
1 parent 5121271 commit abe0d16

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

domdf_python_tools/utils.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@
5353
import itertools
5454
import sys
5555
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Sequence, Tuple, Union
56-
from domdf_python_tools import __version__
56+
57+
# 3rd party
5758
import deprecation # type: ignore
58-
import domdf_python_tools.words
5959

60+
# this package
61+
import domdf_python_tools.words
62+
from domdf_python_tools import __version__
6063

6164
__all__ = [
6265
"pyversion",
@@ -396,13 +399,19 @@ def convert_indents(text: str, tab_width: int = 4, from_: str = "\t", to: str =
396399

397400

398401
as_text = deprecation.deprecated(
399-
deprecated_in="0.8.0", removed_in="1.0.0",
402+
deprecated_in="0.8.0",
403+
removed_in="1.0.0",
400404
current_version=__version__,
401405
details="Import from 'domdf_python_tools.words' instead.",
402-
)(domdf_python_tools.words.as_text)
406+
)(
407+
domdf_python_tools.words.as_text
408+
)
403409

404410
word_join = deprecation.deprecated(
405-
deprecated_in="0.8.0", removed_in="1.0.0",
411+
deprecated_in="0.8.0",
412+
removed_in="1.0.0",
406413
current_version=__version__,
407414
details="Import from 'domdf_python_tools.words' instead.",
408-
)(domdf_python_tools.words.word_join)
415+
)(
416+
domdf_python_tools.words.word_join
417+
)

domdf_python_tools/words.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def get_words_list(min_length: int = 0, max_length: int = -1) -> List[str]:
107107
.. versionadded:: 0.4.5
108108
"""
109109

110+
# this package
110111
from domdf_python_tools.paths import PathPlus
111112

112113
with importlib_resources.path(domdf_python_tools, "google-10000-english-no-swears.txt") as words_file_:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
colorama>=0.4.3
2+
deprecation>=2.1.0
23
importlib_resources>=3.0.0
34
pydash>=4.7.4
45
typing_extensions>=3.7.4.3
5-
deprecation>=2.1.0

tests/test_words.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
import pytest
99

1010
# this package
11+
from domdf_python_tools import words
1112
from domdf_python_tools.paths import PathPlus
1213
from domdf_python_tools.stringlist import StringList
1314
from domdf_python_tools.words import DOUBLESTRUCK_LETTERS, alpha_sort, get_random_word, get_words_list
14-
from domdf_python_tools import words
1515

1616

1717
@pytest.mark.parametrize(
@@ -99,7 +99,7 @@ def test_alpha_sort():
9999
(123.45, "123.45"),
100100
([123.45], "[123.45]"),
101101
({123.45}, "{123.45}"),
102-
((123.45,), "(123.45,)"),
102+
((123.45, ), "(123.45,)"),
103103
(None, ''),
104104
(pathlib.Path('.'), '.'),
105105
(PathPlus('.'), '.'),
@@ -128,14 +128,14 @@ def test_word_join():
128128

129129
assert words.word_join(()) == ''
130130

131-
assert words.word_join(("bob",)) == "bob"
131+
assert words.word_join(("bob", )) == "bob"
132132
assert words.word_join(("bob", "alice")) == "bob and alice"
133133
assert words.word_join(("bob", "alice", "fred")) == "bob, alice and fred"
134134

135-
assert words.word_join(("bob",), use_repr=True) == "'bob'"
135+
assert words.word_join(("bob", ), use_repr=True) == "'bob'"
136136
assert words.word_join(("bob", "alice"), use_repr=True) == "'bob' and 'alice'"
137137
assert words.word_join(("bob", "alice", "fred"), use_repr=True) == "'bob', 'alice' and 'fred'"
138138

139-
assert words.word_join(("bob",), use_repr=True, oxford=True) == "'bob'"
139+
assert words.word_join(("bob", ), use_repr=True, oxford=True) == "'bob'"
140140
assert words.word_join(("bob", "alice"), use_repr=True, oxford=True) == "'bob' and 'alice'"
141141
assert words.word_join(("bob", "alice", "fred"), use_repr=True, oxford=True) == "'bob', 'alice', and 'fred'"

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ ignore_errors = true
113113
changedir = {toxinidir}
114114
deps =
115115
mypy==0.782
116+
lxml
116117
-r{toxinidir}/tests/requirements.txt
117118
commands = mypy domdf_python_tools tests {posargs}
118119

@@ -166,13 +167,18 @@ rst-roles =
166167
meth
167168
exc
168169
attr
170+
wikipedia
171+
rst:role
172+
rst:dir
169173
rst-directives =
170174
envvar
171175
exception
172176
seealso
173177
TODO
174178
versionadded
175179
versionchanged
180+
rest-example
181+
extras-require
176182
per-file-ignores =
177183
tests/*: D100 D101 D102 D103 D104 D106 D201 D204 D207 D208 D209 D210 D211 D212 D213 D214 D215 D300 D301 D400 D402 D403 D404 D415 D417 DALL000
178184
pytest-parametrize-names-type = csv

0 commit comments

Comments
 (0)