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

chore: update pre-commit hooks #218

Merged
merged 1 commit into from
Dec 19, 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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ default_language_version:
repos:

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
rev: v4.1.0
hooks:
- id: commitizen
stages:
Expand All @@ -27,7 +27,7 @@ repos:
pass_filenames: false

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
rev: v0.8.3
hooks:
- id: ruff
args: [--fix]
Expand All @@ -41,7 +41,7 @@ repos:
args: ["--in-place", "--config", "./pyproject.toml"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
rev: 'v1.13.0'
hooks:
- id: mypy
additional_dependencies: [
Expand Down
16 changes: 8 additions & 8 deletions pyoda_time/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
__version__ = "0.9.3"

__all__: list[str] = [
"calendars",
"fields",
"globalization",
"testing",
"text",
"time_zones",
"utility",
"AmbiguousTimeError",
"AnnualDate",
"CalendarSystem",
Expand All @@ -26,8 +19,8 @@
"Interval",
"IsoDayOfWeek",
"LocalDate",
"LocalTime",
"LocalDateTime",
"LocalTime",
"Offset",
"OffsetDateTime",
"OffsetTime",
Expand All @@ -41,6 +34,13 @@
"YearMonth",
"ZonedClock",
"ZonedDateTime",
"calendars",
"fields",
"globalization",
"testing",
"text",
"time_zones",
"utility",
]


Expand Down
2 changes: 1 addition & 1 deletion pyoda_time/_compatibility/_culture_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def __create_culture_data(cls, culture_name: str, use_user_override: bool) -> _C
cd._iLanguage = CultureInfo._LOCALE_CUSTOM_UNSPECIFIED
return cd

if len(culture_name) == 1 and culture_name[0] == "C" or culture_name[0] == "c":
if (len(culture_name) == 1 and culture_name[0] == "C") or culture_name[0] == "c":
# Always map the "C" locale to Invariant to avoid mapping it to en_US_POSIX on Linux because POSIX
# locale collation doesn't support case insensitive comparisons.
# We do the same mapping on Windows for the sake of consistency.
Expand Down
2 changes: 1 addition & 1 deletion pyoda_time/_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Interval:
The default value of this type is an empty interval with a start and end of ``PyodaConstant.UNIX_EPOCH``.
"""

__slots__ = ("__start", "__end")
__slots__ = ("__end", "__start")

def __init__(
self, start: Instant | None = PyodaConstants.UNIX_EPOCH, end: Instant | None = PyodaConstants.UNIX_EPOCH
Expand Down
2 changes: 1 addition & 1 deletion pyoda_time/calendars/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"CalendarWeekRule",
"Era",
"HebrewMonthNumbering",
"IWeekYearRule",
"IslamicEpoch",
"IslamicLeapYearPattern",
"IWeekYearRule",
"WeekYearRules",
]

Expand Down
2 changes: 1 addition & 1 deletion pyoda_time/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# as found in the LICENSE.txt file.

__all__ = [
"time_zones",
"FakeClock",
"time_zones",
]

from . import time_zones
Expand Down
2 changes: 1 addition & 1 deletion pyoda_time/testing/_fake_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class FakeClock(IClock):
"""

__slots__ = (
"__auto_advance",
"__lock",
"__now",
"__auto_advance",
)

def __init__(self, initial: Instant, auto_advance: Duration = Duration.zero) -> None:
Expand Down
2 changes: 1 addition & 1 deletion pyoda_time/text/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# as found in the LICENSE.txt file.

__all__: list[str] = [
"patterns",
"AnnualDatePattern",
"DurationPattern",
"InstantPattern",
Expand All @@ -14,6 +13,7 @@
"OffsetPattern",
"ParseResult",
"UnparsableValueError",
"patterns",
]

from ._annual_date_pattern import AnnualDatePattern
Expand Down
2 changes: 1 addition & 1 deletion pyoda_time/text/patterns/_date_pattern_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def build_format_action(self, final_fields: _PatternFields) -> Callable[[T, Stri
text_values = self.__format_info.long_month_names

def format_action(value: T, sb: StringBuilder) -> None:
sb.append(text_values[self.__getter(value)])
sb.append(text_values[self.__getter(value)]) # type: ignore[arg-type]

return format_action

Expand Down
4 changes: 2 additions & 2 deletions pyoda_time/time_zones/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# as found in the LICENSE.txt file.

__all__ = [
"cldr",
"io",
"DateTimeZoneCache",
"DateTimeZoneNotFoundError",
"IDateTimeZoneSource",
Expand All @@ -13,6 +11,8 @@
"TzdbZoneLocation",
"ZoneInterval",
"ZoneLocalMapping",
"cldr",
"io",
]

from . import cldr, io
Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ warn_unused_ignores = true
line-length = 120

[tool.ruff.lint]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

select = [
"E", # pycodestyle (error)
"F", # pyflakes
Expand All @@ -75,4 +72,5 @@ select = [
"UP", # pyupgrade
"W", # pycodestyle (warning)
]
unfixable = []

Loading