Skip to content

Commit 129afe5

Browse files
shchekleinpre-commit-ci[bot]daavoo
authored
chore(setup): migrate to pyproject, add version (#589)
* chore(setup): migrate to pyproject, add version * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Delete version.py * Update .gitignore * Update src/dvclive/__init__.py * Update pyproject.toml --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: David de la Iglesia Castro <[email protected]>
1 parent 3c47caa commit 129afe5

File tree

5 files changed

+89
-108
lines changed

5 files changed

+89
-108
lines changed

pyproject.toml

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,92 @@
11
[build-system]
2-
requires = ["setuptools>=48", "setuptools_scm[toml]>=6.3.1"]
2+
requires = ["setuptools>=61", "setuptools_scm[toml]>=7"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
description = "Experiments logger for ML projects."
7+
name = "dvclive"
8+
readme = "README.md"
9+
keywords = [
10+
"ai",
11+
"metrics",
12+
"collaboration",
13+
"data-science",
14+
"data-version-control",
15+
"developer-tools",
16+
"git",
17+
"machine-learning",
18+
"reproducibility",
19+
]
20+
license = { text = "Apache License 2.0" }
21+
maintainers = [{ name = "Iterative", email = "[email protected]" }]
22+
authors = [{ name = "Iterative", email = "[email protected]" }]
23+
requires-python = ">=3.8"
24+
classifiers = [
25+
"Development Status :: 4 - Beta",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
]
32+
dynamic = ["version"]
33+
dependencies = [
34+
"dvc>=2.58.0,<3",
35+
"dvc-render>=0.5.0,<1.0",
36+
"dvc-studio-client>=0.10.0,<1",
37+
"funcy",
38+
"ruamel.yaml",
39+
"scmrepo",
40+
]
41+
[project.optional-dependencies]
42+
image = ["numpy", "pillow"]
43+
sklearn = ["scikit-learn"]
44+
plots = ["dvclive[sklearn]"]
45+
markdown = ["matplotlib"]
46+
tests = [
47+
"pytest>=7.2.0,<8.0",
48+
"pytest-sugar>=0.9.6,<1.0",
49+
"pytest-cov>=3.0.0,<4.0",
50+
"pytest-mock>=3.8.2,<4.0",
51+
"dvclive[image,plots,markdown]",
52+
"ipython",
53+
]
54+
dev = [
55+
"dvclive[all,tests]",
56+
"mypy>=1.1.1"
57+
]
58+
mmcv = ["mmcv"]
59+
tf = ["tensorflow"]
60+
xgb = ["xgboost"]
61+
lgbm = ["lightgbm"]
62+
huggingface = ["transformers", "datasets"]
63+
catalyst = ["catalyst>22"]
64+
fastai = ["fastai"]
65+
pytorch_lightning = ["pytorch-lightning>=1.9", "torch<2.1"] # for backward compatibility
66+
lightning = ["lightning>=1.9", "torch<2.1"]
67+
optuna = ["optuna"]
68+
all = [
69+
"dvclive[image,mmcv,tf,xgb,lgbm,huggingface,catalyst,fastai,pytorch-lightning,optuna,plots,markdown]"
70+
]
71+
72+
[project.urls]
73+
Homepage = "https://github.com/iterative/dvclive"
74+
Documentation = "https://dvc.org/doc/dvclive"
75+
Repository = "https://github.com/iterative/dvclive"
76+
Changelog = "https://github.com/iterative/dvclive/releases"
77+
Issues = "https://github.com/iterative/dvclive/issues"
78+
79+
[tool.setuptools.packages.find]
80+
exclude = ["tests", "tests.*"]
81+
where = ["src"]
82+
namespaces = false
83+
84+
[tool.setuptools]
85+
license-files = ["LICENSE"]
86+
platforms = ["any"]
87+
588
[tool.setuptools_scm]
89+
write_to = "src/dvclive/_dvclive_version.py"
690

791
[tool.black]
892
line-length = 88

setup.cfg

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

setup.py

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

src/dvclive/huggingface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def on_log(
2424
args: TrainingArguments,
2525
state: TrainerState,
2626
control: TrainerControl,
27-
**kwargs
27+
**kwargs,
2828
):
2929
logs = kwargs["logs"]
3030
for key, value in logs.items():
@@ -36,7 +36,7 @@ def on_epoch_end(
3636
args: TrainingArguments,
3737
state: TrainerState,
3838
control: TrainerControl,
39-
**kwargs
39+
**kwargs,
4040
):
4141
if self.model_file:
4242
model = kwargs["model"]
@@ -51,7 +51,7 @@ def on_train_end(
5151
args: TrainingArguments,
5252
state: TrainerState,
5353
control: TrainerControl,
54-
**kwargs
54+
**kwargs,
5555
):
5656
if args.load_best_model_at_end:
5757
trainer = Trainer(

src/dvclive/keras.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(
1515
model_file=None,
1616
save_weights_only: bool = False,
1717
live: Optional[Live] = None,
18-
**kwargs
18+
**kwargs,
1919
):
2020
super().__init__()
2121
self.model_file = model_file

0 commit comments

Comments
 (0)