Skip to content

Commit

Permalink
chore: update linting
Browse files Browse the repository at this point in the history
  • Loading branch information
wpk committed Jun 16, 2023
1 parent 7dcb7aa commit e647805
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
10 changes: 4 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,14 +893,12 @@ def testdist_pypi_venv(
if version:
install_str = f"{install_str}=={version}"

install_requirements(
session_install_pip(
session=session,
name="testdist-pypi-venv",
set_kernel=False,
install_package=False,
requirement_paths=["environment/test-extras.txt"],
reqs=[install_str],
force_reinstall=force_reinstall,
style="pip",
reqs=["-r", "environment/test-extras.txt", install_str],
install_package=False,
)

if log_session:
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,13 @@ select = [
# # flake8-2020
"YTT",
# # flake8-bugbear
# "B",
"B",
# flake8-quotes
"Q",
# # pylint
# "PLE", "PLR", "PLW",
"PLE",
"PLW",
# # misc lints
"PIE",
# # tidy imports
Expand Down
8 changes: 5 additions & 3 deletions src/module_utilities/docfiller.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def assign_param(
self,
name: str,
ptype: str = "",
desc: str | list[str] = [],
desc: str | list[str] | None = None,
key: str | None = None,
):
"""
Expand Down Expand Up @@ -432,8 +432,10 @@ def assign_param(

new = self.new_like()

# cleanup desc
if isinstance(desc, str):
if desc is None:
desc = []
elif isinstance(desc, str):
# cleanup desc
desc = dedent(desc).strip().split("\n")

key = name if key is None else key
Expand Down
12 changes: 7 additions & 5 deletions tools/noxtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def session_install_pip(
requirement_paths = requirement_paths or ()
constraint_paths = constraint_paths or ()
reqs = reqs or ()
paths = requirement_paths + constraint_paths
paths = tuple(requirement_paths) + tuple(constraint_paths)

unchanged, hashes = env_unchanged(
session,
Expand Down Expand Up @@ -448,12 +448,14 @@ def get_hashes(

other_hashes = {}
for k, v in other.items():
if not isinstance(v, str):
if isinstance(v, str):
s = v
else:
try:
v = str(sorted(v))
s = str(sorted(v))
except Exception:
v = str(v)
other_hashes[k] = hashlib.md5(v.encode("utf-8")).hexdigest()
s = str(v)
other_hashes[k] = hashlib.md5(s.encode("utf-8")).hexdigest()

out["other"] = other_hashes

Expand Down

0 comments on commit e647805

Please sign in to comment.