Skip to content
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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ dev = [
"pytest-beartype==0.3.0",
"pytest-cov==7.1.0",
"pytest-regressions==2.11.0",
"ruff==0.16.10",
"ruff==0.17.0",
"setuptools-scm==10.3.4",
# We add shellcheck-py not only for shell scripts and shell code blocks,
# but also because having it installed means that ``actionlint-py`` will
Expand Down
10 changes: 5 additions & 5 deletions src/vws_cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import calendar
import contextlib
import dataclasses
import datetime
import datetime as dt
import io
import sys
from collections.abc import Generator
Expand Down Expand Up @@ -509,7 +509,7 @@ def wait_for_target_processed(
@beartype
def _default_month() -> str:
"""Return the current month, in the form which ``--month`` takes."""
now = datetime.datetime.now(tz=ZoneInfo(key="UTC"))
now = dt.datetime.now(tz=ZoneInfo(key="UTC"))
return now.strftime(format=_MONTH_FORMAT)


Expand All @@ -518,13 +518,13 @@ def _validate_month(
ctx: click.Context,
param: click.Parameter,
value: str,
) -> datetime.date:
) -> dt.date:
"""Turn a ``YYYY-mm`` string into the first day of that month."""
# These are given by ``click``, and we do not use them.
del ctx
del param
try:
parsed = datetime.date.fromisoformat(f"{value}-01")
parsed = dt.date.fromisoformat(f"{value}-01")
except ValueError as exc:
message = f'"{value}" is not a month in the YYYY-mm form.'
raise click.BadParameter(message=message) from exc
Expand Down Expand Up @@ -594,7 +594,7 @@ def get_database_reco_counts_report(
server_access_key: str,
server_secret_key: str,
database_id: str,
month: datetime.date,
month: dt.date,
output_file_path: Path | None,
no_wait: bool,
seconds_between_requests: float,
Expand Down
8 changes: 4 additions & 4 deletions tests/query/test_timeouts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Tests for `query` timeouts commands."""

import datetime
import datetime as dt
import io
import uuid
from pathlib import Path
Expand Down Expand Up @@ -39,7 +39,7 @@ def test_default_timeout(
response_delay_seconds=response_delay_seconds,
sleep_fn=lambda seconds: (
frozen_datetime.tick(
delta=datetime.timedelta(seconds=seconds),
delta=dt.timedelta(seconds=seconds),
),
None,
)[1],
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_custom_timeout(
response_delay_seconds=5,
sleep_fn=lambda seconds: (
frozen_datetime.tick(
delta=datetime.timedelta(seconds=seconds),
delta=dt.timedelta(seconds=seconds),
),
None,
)[1],
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_custom_timeout_no_error(
response_delay_seconds=5,
sleep_fn=lambda seconds: (
frozen_datetime.tick(
delta=datetime.timedelta(seconds=seconds),
delta=dt.timedelta(seconds=seconds),
),
None,
)[1],
Expand Down
6 changes: 3 additions & 3 deletions tests/test_reco_counts_report.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Tests for the ``get-database-reco-counts-report`` command."""

import datetime
import datetime as dt
import uuid
from pathlib import Path
from zoneinfo import ZoneInfo
Expand All @@ -22,10 +22,10 @@

def _month_string(*, months_ago: int) -> str:
"""Return a ``YYYY-mm`` string for a month relative to this month."""
now = datetime.datetime.now(tz=ZoneInfo(key="UTC"))
now = dt.datetime.now(tz=ZoneInfo(key="UTC"))
first_of_month = now.replace(day=1)
for _ in range(months_ago):
first_of_month = first_of_month.replace(day=1) - datetime.timedelta(
first_of_month = first_of_month.replace(day=1) - dt.timedelta(
days=1,
)
return first_of_month.strftime(format="%Y-%m")
Expand Down
8 changes: 4 additions & 4 deletions tests/vws/test_configuration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Tests for `vws` configuration commands."""

import datetime
import datetime as dt
import io
import uuid
from pathlib import Path
Expand Down Expand Up @@ -39,7 +39,7 @@ def test_default_timeout(
response_delay_seconds=response_delay_seconds,
sleep_fn=lambda seconds: (
frozen_datetime.tick(
delta=datetime.timedelta(seconds=seconds),
delta=dt.timedelta(seconds=seconds),
),
None,
)[1],
Expand Down Expand Up @@ -97,7 +97,7 @@ def test_custom_timeout(
response_delay_seconds=5,
sleep_fn=lambda seconds: (
frozen_datetime.tick(
delta=datetime.timedelta(seconds=seconds),
delta=dt.timedelta(seconds=seconds),
),
None,
)[1],
Expand Down Expand Up @@ -148,7 +148,7 @@ def test_custom_timeout_no_error(
response_delay_seconds=5,
sleep_fn=lambda seconds: (
frozen_datetime.tick(
delta=datetime.timedelta(seconds=seconds),
delta=dt.timedelta(seconds=seconds),
),
None,
)[1],
Expand Down
46 changes: 23 additions & 23 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading