Skip to content

Commit 26401e4

Browse files
committed
Linting fixes for tox tests to pass.
1 parent b35830e commit 26401e4

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## unreleased v3.9dev
1+
## unreleased 0.4.0
22

33
### Add
44

lint-configs/python/.pylintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ ignored-modules=distutils,eventlet.green.subprocess
2222
max-line-length=100
2323
max-module-lines=1000
2424
indent-string=' '
25+
26+
[MASTER]
27+
init-hook='import sys; sys.path.append("./st2auth_flat_file_backend")'

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[tool.pytest.ini_options]
2+
pythonpath = [
3+
".",
4+
"st2auth_flat_file_backend"
5+
]

st2auth_flat_file_backend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
__all__ = ["FlatFileAuthenticationBackend"]
2121

22-
__version__ = "0.3.0"
22+
__version__ = "0.4.0"

st2auth_flat_file_backend/apr1.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@
6969
# bcrypt is currently the recommended algorithm.
7070

7171
import os
72-
import sys
7372

7473
from hashlib import md5
75-
from time import sleep
7674

7775

7876
def to64(data, n_out):
@@ -146,13 +144,12 @@ def hash_apr1(salt, password):
146144

147145
pw_ascii = (
148146
to64(mkint(final, 0, 6, 12), 4)
149-
+ to64(mkint(final, 1, 7, 13), 4)
150-
+ to64(mkint(final, 2, 8, 14), 4)
151-
+ to64(mkint(final, 3, 9, 15), 4)
152-
+ to64(mkint(final, 4, 10, 5), 4)
153-
+ to64(mkint(final, 11), 2)
147+
+ to64(mkint(final, 1, 7, 13), 4) # noqa: W503
148+
+ to64(mkint(final, 2, 8, 14), 4) # noqa: W503
149+
+ to64(mkint(final, 3, 9, 15), 4) # noqa: W503
150+
+ to64(mkint(final, 4, 10, 5), 4) # noqa: W503
151+
+ to64(mkint(final, 11), 2) # noqa: W503
154152
)
155-
156153
return "$apr1$%s$%s" % (salt, pw_ascii)
157154

158155

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ envlist = py38,py39,py310,py311,lint
33

44
[testenv]
55
deps = -r{toxinidir}/test-requirements.txt
6-
commands = pytest
6+
commands = python -m pytest tests
77

88
[testenv:py38]
99
basepython = python3.8

0 commit comments

Comments
 (0)