Skip to content

Commit 5c63d9b

Browse files
committed
update package dependencies
1 parent ae5ecd3 commit 5c63d9b

24 files changed

Lines changed: 1134 additions & 768 deletions

.github/workflows/precommit.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
with:
1717
version: "0.4.20"
1818
enable-cache: true
19+
- name: Setup virtual environment
20+
run: uv sync
1921
- name: Install pre-commit
2022
run: uv tool install pre-commit --with pre-commit-uv
2123
- name: Run pre-commit

.pre-commit-config.yaml

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
repos:
2-
- repo: local
3-
hooks:
4-
- id: sync-dependencies
5-
name: update pre-commit-config
6-
entry: uv run ci/scripts/pre_commit_sync_pyright_deps.py
7-
language: system
8-
files: "(pyproject.toml|scripts/.pre-commit-config.yaml.template|.pre-commit.config.yaml)" # the quotes are here to make sure that this stay in line for the formatter.
92
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.6.0
3+
rev: v6.0.0
114
hooks:
125
- id: check-case-conflict
136
- id: check-toml
@@ -20,7 +13,7 @@ repos:
2013
- id: check-added-large-files
2114
- id: trailing-whitespace
2215
- repo: https://github.com/asottile/pyupgrade
23-
rev: v3.17.0
16+
rev: v3.21.2
2417
hooks:
2518
- id: pyupgrade
2619
name: pyupgrade
@@ -31,47 +24,20 @@ repos:
3124
args: [--py38-plus, --keep-runtime-typing]
3225
files: .*\/__main__.py # We run ruff after pyugprade to remove unused imports
3326
- repo: https://github.com/astral-sh/ruff-pre-commit
34-
rev: v0.6.1
27+
rev: v0.14.6
3528
hooks:
3629
- id: ruff # Run the linter.
3730
args: [--fix]
3831
- id: ruff # Sort improts
3932
name: sort imports with ruff
4033
args: [--select, I, --fix]
4134
- id: ruff-format # Run the formatter.
42-
- repo: https://github.com/RobertCraigie/pyright-python
43-
rev: v1.1.377
35+
- repo: local # Run pyright type checker
4436
hooks:
4537
- id: pyright
46-
additional_dependencies: # these dependencies are synced via the first hook
47-
- numpy>=1.15; python_version < '3.13'
48-
- numpy>=2.1; python_version >= '3.13'
49-
- pymongo>=4.1
50-
- pandas>=2.2; python_version < '3.13'
51-
- pandas>=2.2.3; python_version >= '3.13'
52-
- sacred>=0.8.4
53-
- pyyaml>=5.1
54-
- jsonpickle>=2.2
55-
- munch>=4.0
56-
- debugpy>=1.2.1
57-
- requests>=2.28.1
58-
- typer>=0.12
59-
- rich>=13.0,<14.1
60-
- click>=8.0
61-
- omegaconf>=2.3.0
62-
- gitignore_parser>=0.1.11
63-
- setuptools>=69.2.0
64-
- importlib_resources>=5.7.0
65-
- typing_extensions>=4.10; python_version < '3.13'
66-
- typing_extensions>=4.12; python_version >= '3.13'
67-
- deepdiff>=7.0.1
68-
- ruff>=0.6.1
69-
- pytest>=8.3.2
70-
- pre-commit>=3.8.0
71-
- filelock>=3.15.4
72-
- sshtunnel>=0.4.0
73-
- build>=1.2.1
74-
- twine>=5.1.1
75-
- backports-tarfile>=1.2.0
76-
- tuna>=0.5.11
77-
files: src/seml/.*\.py
38+
name: pyright check
39+
entry: uv run pyright src/
40+
language: system
41+
types: [python]
42+
pass_filenames: false
43+
always_run: true

ci/scripts/pre_commit_sync_pyright_deps.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/tutorial/intro_slides.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
"for i, exp in results.iterrows():\n",
291291
" plt.plot(\n",
292292
" exp[\"result.test_acc\"],\n",
293-
" label=f'{exp[\"config.hidden_sizes\"]} {exp[\"config.learning_rate\"]}',\n",
293+
" label=f\"{exp['config.hidden_sizes']} {exp['config.learning_rate']}\",\n",
294294
" )\n",
295295
"plt.legend()\n",
296296
"plt.show()"

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dev = [
5050
"filelock>=3.15.4",
5151
"sshtunnel>=0.4.0",
5252
]
53-
ssh_forward = ["sshtunnel>=0.4.0", "filelock>=3.13.3"]
53+
ssh_forward = ["sshtunnel>=0.4.0", "filelock>=3.13.3", "paramiko>=3.0,<4.0"]
5454

5555
[project.urls]
5656
Homepage = "https://github.com/TUM-DAML/seml"
@@ -76,6 +76,7 @@ dev-dependencies = [
7676
"twine>=5.1.1",
7777
"backports-tarfile>=1.2.0",
7878
"tuna>=0.5.11",
79+
"pyright>=1.1.407",
7980
]
8081

8182
[tool.ruff.format]
@@ -84,3 +85,5 @@ line-ending = "lf"
8485

8586
[tool.pyright]
8687
typeCheckingMode = "standard"
88+
venvPath = "."
89+
venv = ".venv"

src/seml/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
TypeVar,
1717
)
1818

19+
import typer
1920
from typing_extensions import Annotated, ParamSpec
2021

21-
import seml.cli_utils.typer as typer
2222
from seml.cli_utils import AUTOCOMPLETING, cache_to_disk
2323
from seml.cli_utils.cli_states import CliStates as States
2424
from seml.document import SBatchOptions
@@ -196,7 +196,7 @@ def parse_optional_str_list(values: Optional[Sequence[str]]) -> List[str]:
196196
typer.Option(
197197
'-n',
198198
'--num-experiments',
199-
help='Number of experiments to start. ' '0: all (staged) experiments ',
199+
help='Number of experiments to start. 0: all (staged) experiments ',
200200
),
201201
]
202202
NoFileOutputAnnotation = Annotated[

src/seml/cli_utils/typer.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/seml/commands/add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def add_configs(
113113
start_id = start_id + 1
114114

115115
logging.info(
116-
f"Adding {len(documents)} configs to the database (batch-ID {documents[0]['batch_id']})."
116+
f'Adding {len(documents)} configs to the database (batch-ID {documents[0]["batch_id"]}).'
117117
)
118118

119119
documents = [

src/seml/commands/configure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def mongodb_configure(
6565
config['ssh_config'] = prompt_ssh_forward()
6666
config_string = yaml.dump(config)
6767
logging.info(
68-
f"Saving the following configuration to {file_path}:\n"
69-
f"{config_string.replace(f'{password}', '********')}"
68+
f'Saving the following configuration to {file_path}:\n'
69+
f'{config_string.replace(f"{password}", "********")}'
7070
)
7171
file_path.parent.mkdir(parents=True, exist_ok=True)
7272
with open(file_path, 'w') as f:

src/seml/commands/manage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def cancel_experiment_by_id(
180180
# check if the job has been claimed and associated with a concrete job
181181
is_running = 'array_id' in exp['execution']
182182
if is_running:
183-
job_strings = [f"{exp['execution']['array_id']}_{exp['execution']['task_id']}"]
183+
job_strings = [f'{exp["execution"]["array_id"]}_{exp["execution"]["task_id"]}']
184184
else:
185185
job_strings = list(map(str, array_ids))
186186

@@ -710,7 +710,7 @@ def detect_killed(db_collection_name: str, print_detected: bool = True):
710710
# If the experiment is canceled before starting (e.g. when still queued), there is not output file.
711711
logging.debug(f'File {output_file} could not be read.')
712712
else:
713-
logging.debug(f"Output file not found in experiment {exp['_id']}.")
713+
logging.debug(f'Output file not found in experiment {exp["_id"]}.')
714714
updates = [
715715
UpdateMany(
716716
{'_id': {'$in': interrupted_exps}},

0 commit comments

Comments
 (0)