Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use keyword arguments everywhere #252

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def make_linux_binaries(repo_root: Path) -> None:
raise ValueError(msg)

code_mount = Mount(
source=str(repo_root.absolute()),
source=str(object=repo_root.absolute()),
target="/" + uuid.uuid4().hex,
type="bind",
)
Expand Down
6 changes: 3 additions & 3 deletions admin/create_pyinstaller_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def remove_existing_files(scripts: set[Path]) -> None:
build_dir = Path() / "build"

with contextlib.suppress(FileNotFoundError):
shutil.rmtree(path=str(dist_dir))
shutil.rmtree(path=str(object=dist_dir))

with contextlib.suppress(FileNotFoundError):
shutil.rmtree(path=str(build_dir))
shutil.rmtree(path=str(object=build_dir))

for script in scripts:
path = Path(script.name + ".spec")
Expand All @@ -41,7 +41,7 @@ def create_binary(script: Path) -> None:
"""
pyinstaller_command = [
"pyinstaller",
str(script.resolve()),
str(object=script.resolve()),
"--onefile",
"--name",
script.name + "-" + sys.platform,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# This method of getting the release from the version goes hand in hand with
# the ``post-release`` versioning scheme chosen in the ``setuptools-scm``
# configuration.
release = version.split(".post")[0]
release = version.split(sep=".post")[0]

project_metadata = importlib.metadata.metadata(distribution_name=project)
requires_python = project_metadata["Requires-Python"]
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ optional-dependencies.dev = [
"furo==2024.8.6",
"interrogate==1.7.0",
"mypy[faster-cache]==1.14.0",
"mypy-strict-kwargs==2024.12.25",
"pre-commit==4.0.1",
"pydocstyle==6.3",
"pyenchant==3.3.0rc1",
Expand Down Expand Up @@ -355,6 +356,9 @@ strict = true
files = [ "." ]
exclude = [ "build" ]
follow_untyped_imports = true
plugins = [
"mypy_strict_kwargs",
]

[tool.pyright]

Expand Down
8 changes: 4 additions & 4 deletions src/doccmd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from sybil.typing import Parser

try:
__version__ = version(__name__)
__version__ = version(distribution_name=__name__)
except PackageNotFoundError: # pragma: no cover
# When pkg_resources and git tags are not available,
# for example in a PyInstaller binary,
Expand Down Expand Up @@ -126,7 +126,7 @@ def _get_file_paths(
for file_suffix in file_suffixes:
new_file_paths = (
path_part
for path_part in path.rglob(f"*{file_suffix}")
for path_part in path.rglob(pattern=f"*{file_suffix}")
if len(path_part.relative_to(path).parts) <= max_depth
)
for new_file_path in new_file_paths:
Expand Down Expand Up @@ -179,7 +179,7 @@ def _validate_files_are_known_markup_types(
rst_suffixes=rst_suffixes,
)
except UnknownMarkupLanguageError as exc:
raise click.UsageError(message=str(exc)) from exc
raise click.UsageError(message=str(object=exc)) from exc


@unique
Expand Down Expand Up @@ -369,7 +369,7 @@ def _run_args_against_docs(
)
):
command_str = shlex.join(
split_command=[str(item) for item in args],
split_command=[str(object=item) for item in args],
)
running_command_message = (
f"Running '{command_str}' on code block at "
Expand Down
12 changes: 6 additions & 6 deletions tests/test_admin/test_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ def test_linux_binaries(request: pytest.FixtureRequest) -> None:

mounts = [
Mount(
source=str(repo_root),
target=str(remote_repo_dir),
source=str(object=repo_root),
target=str(object=remote_repo_dir),
type="bind",
),
]

remote_paths: list[Path] = []
for path in dist_dir.iterdir():
relative_path = path.relative_to(repo_root)
remote_path = remote_repo_dir / str(relative_path)
remote_path = remote_repo_dir / str(object=relative_path)
remote_paths.append(remote_path)

client = docker.from_env()
Expand All @@ -67,14 +67,14 @@ def test_linux_binaries(request: pytest.FixtureRequest) -> None:
cmd_in_container = [
"chmod",
"+x",
str(remote_path),
str(object=remote_path),
"&&",
str(remote_path),
str(object=remote_path),
"--version",
"&&",
"rm",
"-rf",
str(remote_path),
str(object=remote_path),
]
joined_cmd = " ".join(cmd_in_container)
command = f'bash -c "{joined_cmd}"'
Expand Down
Loading
Loading