diff --git a/pyproject.toml b/pyproject.toml index e242adda..2410f640 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,92 @@ [build-system] -requires = ["setuptools>=48", "setuptools_scm[toml]>=6.3.1"] +requires = ["setuptools>=61", "setuptools_scm[toml]>=7"] build-backend = "setuptools.build_meta" +[project] +description = "Experiments logger for ML projects." +name = "dvclive" +readme = "README.md" +keywords = [ + "ai", + "metrics", + "collaboration", + "data-science", + "data-version-control", + "developer-tools", + "git", + "machine-learning", + "reproducibility", +] +license = { text = "Apache License 2.0" } +maintainers = [{ name = "Iterative", email = "support@dvc.org" }] +authors = [{ name = "Iterative", email = "support@dvc.org" }] +requires-python = ">=3.8" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +dynamic = ["version"] +dependencies = [ + "dvc>=2.58.0,<3", + "dvc-render>=0.5.0,<1.0", + "dvc-studio-client>=0.10.0,<1", + "funcy", + "ruamel.yaml", + "scmrepo", +] +[project.optional-dependencies] +image = ["numpy", "pillow"] +sklearn = ["scikit-learn"] +plots = ["dvclive[sklearn]"] +markdown = ["matplotlib"] +tests = [ + "pytest>=7.2.0,<8.0", + "pytest-sugar>=0.9.6,<1.0", + "pytest-cov>=3.0.0,<4.0", + "pytest-mock>=3.8.2,<4.0", + "dvclive[image,plots,markdown]", + "ipython", +] +dev = [ + "dvclive[all,tests]", + "mypy>=1.1.1" +] +mmcv = ["mmcv"] +tf = ["tensorflow"] +xgb = ["xgboost"] +lgbm = ["lightgbm"] +huggingface = ["transformers", "datasets"] +catalyst = ["catalyst>22"] +fastai = ["fastai"] +pytorch_lightning = ["pytorch-lightning>=1.9", "torch<2.1"] # for backward compatibility +lightning = ["lightning>=1.9", "torch<2.1"] +optuna = ["optuna"] +all = [ + "dvclive[image,mmcv,tf,xgb,lgbm,huggingface,catalyst,fastai,pytorch-lightning,optuna,plots,markdown]" +] + +[project.urls] +Homepage = "https://github.com/iterative/dvclive" +Documentation = "https://dvc.org/doc/dvclive" +Repository = "https://github.com/iterative/dvclive" +Changelog = "https://github.com/iterative/dvclive/releases" +Issues = "https://github.com/iterative/dvclive/issues" + +[tool.setuptools.packages.find] +exclude = ["tests", "tests.*"] +where = ["src"] +namespaces = false + +[tool.setuptools] +license-files = ["LICENSE"] +platforms = ["any"] + [tool.setuptools_scm] +write_to = "src/dvclive/_dvclive_version.py" [tool.black] line-length = 88 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8b98ed23..00000000 --- a/setup.cfg +++ /dev/null @@ -1,100 +0,0 @@ -[metadata] -description = Metric logger for ML projects. -name = dvclive -long_description = file: README.md -long_description_content_type = text/markdown -license = Apache-2.0 -license_files = LICENSE -url = https://github.com/iterative/dvclive -project_urls = - Documentation = https://dvc.org/doc/dvclive - Source = https://github.com/iterative/dvclive -platforms=any -authors = Iterative -maintainer_email = support@dvc.org -keywords=data-science, metrics, machine-learning, developer-tools, ai -classifiers = - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Development Status :: 4 - Beta - -[options] -python_requires = >=3.8 -zip_safe = False -package_dir= - =src -packages = find: -install_requires= - dvc>=2.58.0,<3 - dvc-render>=0.5.0,<1.0 - dvc-studio-client>=0.10.0,<1 - funcy - ruamel.yaml - scmrepo -[options.extras_require] -image = - numpy - pillow -sklearn = - scikit-learn -plots = - %(sklearn)s -markdown = - matplotlib -tests = - pytest>=7.2.0,<8.0 - pytest-sugar>=0.9.6,<1.0 - pytest-cov>=3.0.0,<4.0 - pytest-mock>=3.8.2,<4.0 - %(image)s - %(plots)s - %(markdown)s - ipython -dev = - %(tests)s - %(all)s - mypy>=1.1.1 -mmcv = - mmcv -tf = - tensorflow -xgb = - xgboost -lgbm = - lightgbm -huggingface = - transformers - datasets -catalyst = - catalyst>22 -fastai = - fastai -pytorch_lightning = - pytorch_lightning>=1.9 - torch<2.1 -optuna = - optuna -all = - %(image)s - %(mmcv)s - %(tf)s - %(xgb)s - %(lgbm)s - %(huggingface)s - %(catalyst)s - %(fastai)s - %(pytorch_lightning)s - %(optuna)s - %(plots)s - %(image)s - %(plots)s - %(markdown)s - -[options.packages.find] -exclude = - tests - tests.* -where=src diff --git a/setup.py b/setup.py deleted file mode 100644 index 1428f6b8..00000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup(name="dvclive") diff --git a/src/dvclive/huggingface.py b/src/dvclive/huggingface.py index 442357fa..e026643f 100644 --- a/src/dvclive/huggingface.py +++ b/src/dvclive/huggingface.py @@ -24,7 +24,7 @@ def on_log( args: TrainingArguments, state: TrainerState, control: TrainerControl, - **kwargs + **kwargs, ): logs = kwargs["logs"] for key, value in logs.items(): @@ -36,7 +36,7 @@ def on_epoch_end( args: TrainingArguments, state: TrainerState, control: TrainerControl, - **kwargs + **kwargs, ): if self.model_file: model = kwargs["model"] @@ -51,7 +51,7 @@ def on_train_end( args: TrainingArguments, state: TrainerState, control: TrainerControl, - **kwargs + **kwargs, ): if args.load_best_model_at_end: trainer = Trainer( diff --git a/src/dvclive/keras.py b/src/dvclive/keras.py index 3773fed5..d74b4f5d 100644 --- a/src/dvclive/keras.py +++ b/src/dvclive/keras.py @@ -15,7 +15,7 @@ def __init__( model_file=None, save_weights_only: bool = False, live: Optional[Live] = None, - **kwargs + **kwargs, ): super().__init__() self.model_file = model_file