Skip to content

Commit 4b11e63

Browse files
Remove pytz dependency in favor of stdlib datetime.timezone
pytz was only used for utc.localize() in one place. Since the project requires Python >= 3.10, datetime.timezone.utc is a direct stdlib replacement. Also removes the overly restrictive <2021.0 version pin. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1eb473f commit 4b11e63

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
[project]
22
name = "keboola.component"
3-
version = "0.0.0" # replaced by the actual version based on the release tag in github actions
3+
version = "1.9.0" # replaced by the actual version based on the release tag in github actions
44
dependencies = [
55
"pygelf",
6-
"pytz<2021.0",
76
"deprecated",
8-
"keboola.vcr",
7+
"keboola.vcr>=0.1.1",
98
]
109
requires-python = ">=3.10"
1110

@@ -40,7 +39,7 @@ Repository = "https://github.com/keboola/python-component"
4039
[dependency-groups]
4140
dev = [
4241
"pytest>=8.3.5",
43-
"ruff>=0.13.2",
42+
"ruff>=0.15.2",
4443
"pdoc3",
4544
]
4645

@@ -55,4 +54,4 @@ line-length = 120
5554
target-version = "py310"
5655

5756
[tool.ruff.lint]
58-
extend-select = ["I", "UP"]
57+
extend-select = ["I", "UP"]

src/keboola/component/interface.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
import sys
1010
import warnings
1111
from collections import OrderedDict
12-
from datetime import datetime
12+
from datetime import datetime, timezone
1313
from pathlib import Path
1414

1515
from deprecated import deprecated
1616
from pygelf import GelfTcpHandler, GelfUdpHandler
17-
from pytz import utc
1817

1918
from . import dao
2019
from .dao import ColumnDefinition, TableDefinition
@@ -595,7 +594,7 @@ def __filter_filedefs_by_latest(self, file_definitions: list[dao.FileDefinition]
595594
files_per_name = self.__group_files_by_name(file_definitions)
596595
for group in files_per_name:
597596
max_file = None
598-
max_timestamp = utc.localize(datetime(1900, 5, 17))
597+
max_timestamp = datetime(1900, 5, 17, tzinfo=timezone.utc)
599598
for f in files_per_name[group]:
600599
creation_date = f.created
601600
# if date not present ignore and add anyway

uv.lock

Lines changed: 3 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)