Skip to content

Commit f421e09

Browse files
update dependencies (#272)
* update dependencies * fix `report_to` * Update optimizer_config.schema.json * fix ruff * fix typing * bump uv * try to fix typing * add more python versions * up to 3.13 * up to 3.13 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent c60245c commit f421e09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+119
-112
lines changed

.github/workflows/build-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Install uv
4646
uses: astral-sh/setup-uv@v6
4747
with:
48-
version: "0.8.8"
48+
version: "0.10.0"
4949

5050
- name: Install dependencies
5151
run: |

.github/workflows/check-schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install uv
2020
uses: astral-sh/setup-uv@v6
2121
with:
22-
version: "0.8.8"
22+
version: "0.10.0"
2323

2424
- name: Install dependencies
2525
run: |

.github/workflows/reusable-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ ubuntu-latest ]
18-
python-version: [ "3.10", "3.11", "3.12" ]
18+
python-version: [ "3.10", "3.11", "3.12", "3.13", ]
1919
include:
2020
- os: windows-latest
2121
python-version: "3.10"
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install uv
3535
uses: astral-sh/setup-uv@v6
3636
with:
37-
version: "0.8.8"
37+
version: "0.10.0"
3838

3939
- name: Install dependencies for Python ${{ matrix.python-version }}
4040
run: |

.github/workflows/ruff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ jobs:
77
- uses: actions/checkout@v4
88
- uses: astral-sh/ruff-action@v2
99
with:
10-
version: "0.8.4"
10+
version: "0.15.0"

.github/workflows/typing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Install uv
1414
uses: astral-sh/setup-uv@v6
1515
with:
16-
version: "0.8.8"
16+
version: "0.10.0"
1717

1818
- name: Install dependencies
1919
run: |

docs/optimizer_config.schema.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@
393393
"enum": [
394394
"wandb",
395395
"tensorboard",
396-
"codecarbon"
396+
"codecarbon",
397+
"none"
397398
],
398399
"type": "string"
399400
},
@@ -403,7 +404,9 @@
403404
"type": "null"
404405
}
405406
],
406-
"default": null,
407+
"default": [
408+
"none"
409+
],
407410
"description": "List of callbacks to report to. If None, no callbacks will be used",
408411
"title": "Report To"
409412
},
@@ -489,7 +492,9 @@
489492
"run_name": null,
490493
"dump_modules": false,
491494
"clear_ram": false,
492-
"report_to": null,
495+
"report_to": [
496+
"none"
497+
],
493498
"log_interval_time": 0.1
494499
}
495500
},

docs/source/docs_utils/versions_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def get_sorted_versions(repo_root: Path, base_url: str) -> list[dict]:
1313
os.chdir(repo_root)
1414
# Fetch tags and branches
15-
tags_output = subprocess.check_output(["git", "tag"], text=True).strip().split("\n") # noqa: S603, S607
15+
tags_output = subprocess.check_output(["git", "tag"], text=True).strip().split("\n") # noqa: S607
1616
tag_regex = re.compile(r"^v\d+\.\d+\.\d+$") # Matches tags like v0.0.1
1717
tags = [tag for tag in tags_output if tag_regex.match(tag)]
1818

@@ -37,7 +37,7 @@ def get_sorted_versions(repo_root: Path, base_url: str) -> list[dict]:
3737
versions.append({"version": tag, "url": f"{base_url}/{tag}/"}) # noqa: PERF401
3838

3939
# Get branches
40-
branches_output = subprocess.check_output(["git", "branch", "-r"], text=True).strip().split("\n") # noqa: S603, S607
40+
branches_output = subprocess.check_output(["git", "branch", "-r"], text=True).strip().split("\n") # noqa: S607
4141
dev_branches = [
4242
branch.strip().split("/")[-1] for branch in branches_output if "origin/dev" in branch and "HEAD" not in branch
4343
]

pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ classifiers=[
2929
'Framework :: Sphinx',
3030
'Typing :: Typed',
3131
]
32-
requires-python = ">=3.10,<3.13"
32+
requires-python = ">=3.10,<3.14"
3333
dependencies = [
34-
"sentence-transformers (>=3,<4)",
34+
"sentence-transformers (>=3,<6)",
3535
"scikit-learn (>=1.5,<2.0)",
3636
"scikit-multilearn (==0.2.0)",
3737
"appdirs (>=1.4,<2.0)",
@@ -40,10 +40,10 @@ dependencies = [
4040
"pydantic (>=2.10.5,<3.0.0)",
4141
"faiss-cpu (>=1.9.0,<2.0.0)",
4242
"openai (>=1.59.6,<2.0.0)",
43-
"datasets (>=3.2.0,<4.0.0)",
43+
"datasets (>=3.2.0,<5.0.0)",
4444
"xxhash (>=3.5.0,<4.0.0)",
4545
"python-dotenv (>=1.0.1,<2.0.0)",
46-
"transformers[torch] (>=4.49.0,<5.0.0)",
46+
"transformers[torch] (>=4.49.0,<6.0.0)",
4747
"peft (>= 0.10.0, !=0.15.0, !=0.15.1, <1.0.0)",
4848
"catboost (>=1.2.8,<2.0.0)",
4949
"aiometer (>=1.0.0,<2.0.0)",
@@ -89,7 +89,7 @@ nb = [
8989
"ipywidgets (>=8.1.5,<9.0.0)",
9090
]
9191
lint = [
92-
"ruff (==0.8.4)",
92+
"ruff (==0.15.0)",
9393
]
9494
sentencepiece = [
9595
"sentencepiece (>=0.2.0,<0.3.0)",
@@ -156,6 +156,7 @@ ignore = [
156156
"ERA001", # commented code
157157
"FBT", # boolean trap
158158
"RUF001", # ambiguous unicode character
159+
"PLC0415", # import outside top-level
159160
]
160161

161162
[tool.ruff.lint.per-file-ignores]

src/autointent/_callbacks/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
REPORTERS = {cb.name: cb for cb in [WandbCallback, TensorBoardCallback, EmissionsTrackerCallback]}
1010

11-
REPORTERS_NAMES = Literal[tuple(REPORTERS.keys())] # type: ignore[valid-type]
11+
REPORTERS_NAMES = Literal[(*tuple(REPORTERS.keys()), "none")] # type: ignore[valid-type]
1212

1313

1414
def get_callbacks(reporters: list[str] | None) -> CallbackHandler:
@@ -25,6 +25,8 @@ def get_callbacks(reporters: list[str] | None) -> CallbackHandler:
2525

2626
reporters_cb = []
2727
for reporter in reporters:
28+
if reporter == "none":
29+
continue
2830
if reporter not in REPORTERS:
2931
msg = f"Reporter {reporter} not supported. Supported reporters {','.join(REPORTERS)}"
3032
raise ValueError(msg)

src/autointent/_callbacks/tensorboard.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def start_module(self, module_name: str, num: int, module_kwargs: dict[str, Any]
5353
"""
5454
module_run_name = f"{self.run_name}_{module_name}_{num}"
5555
log_dir = Path(self.dirpath) / module_run_name
56-
self.module_writer = self.writer(log_dir=log_dir) # type: ignore[no-untyped-call]
56+
self.module_writer = self.writer(log_dir=log_dir)
5757

58-
self.module_writer.add_text("module_info", f"Starting module {module_name}_{num}") # type: ignore[no-untyped-call]
58+
self.module_writer.add_text("module_info", f"Starting module {module_name}_{num}")
5959
for key, value in module_kwargs.items():
60-
self.module_writer.add_text(f"module_params/{key}", str(value)) # type: ignore[no-untyped-call]
60+
self.module_writer.add_text(f"module_params/{key}", str(value))
6161

6262
def log_value(self, **kwargs: dict[str, int | float | Any]) -> None:
6363
"""Logs scalar or text values.
@@ -69,7 +69,7 @@ def log_value(self, **kwargs: dict[str, int | float | Any]) -> None:
6969
if isinstance(value, int | float):
7070
self.module_writer.add_scalar(key, value)
7171
else:
72-
self.module_writer.add_text(key, str(value)) # type: ignore[no-untyped-call]
72+
self.module_writer.add_text(key, str(value))
7373

7474
def log_metrics(self, metrics: dict[str, Any]) -> None:
7575
"""Logs training metrics.
@@ -79,9 +79,9 @@ def log_metrics(self, metrics: dict[str, Any]) -> None:
7979
"""
8080
for key, value in metrics.items():
8181
if isinstance(value, int | float):
82-
self.module_writer.add_scalar(key, value) # type: ignore[no-untyped-call]
82+
self.module_writer.add_scalar(key, value)
8383
else:
84-
self.module_writer.add_text(key, str(value)) # type: ignore[no-untyped-call]
84+
self.module_writer.add_text(key, str(value))
8585

8686
def log_final_metrics(self, metrics: dict[str, Any]) -> None:
8787
"""Logs final metrics at the end of training.
@@ -97,13 +97,13 @@ def log_final_metrics(self, metrics: dict[str, Any]) -> None:
9797
raise RuntimeError(msg)
9898

9999
log_dir = Path(self.dirpath) / "final_metrics"
100-
self.module_writer = self.writer(log_dir=log_dir) # type: ignore[no-untyped-call]
100+
self.module_writer = self.writer(log_dir=log_dir)
101101

102102
for key, value in metrics.items():
103103
if isinstance(value, int | float):
104-
self.module_writer.add_scalar(key, value) # type: ignore[no-untyped-call]
104+
self.module_writer.add_scalar(key, value)
105105
else:
106-
self.module_writer.add_text(key, str(value)) # type: ignore[no-untyped-call]
106+
self.module_writer.add_text(key, str(value))
107107

108108
def end_module(self) -> None:
109109
"""Ends the current module and closes the TensorBoard writer.
@@ -115,8 +115,8 @@ def end_module(self) -> None:
115115
msg = "start_run must be called before end_module."
116116
raise RuntimeError(msg)
117117

118-
self.module_writer.add_text("module_info", "Ending module") # type: ignore[no-untyped-call]
119-
self.module_writer.close() # type: ignore[no-untyped-call]
118+
self.module_writer.add_text("module_info", "Ending module")
119+
self.module_writer.close()
120120

121121
def end_run(self) -> None:
122122
"""Ends the current run. This method is currently a placeholder."""

0 commit comments

Comments
 (0)