diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa408e6e..4d14b18e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -21,7 +21,7 @@ repos: - id: sort-simple-yaml - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.1 hooks: - id: black additional_dependencies: [".[jupyter]"] @@ -37,7 +37,7 @@ repos: additional_dependencies: ["tomli"] - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.0.292' + rev: 'v0.1.3' hooks: - id: ruff args: ['--fix'] diff --git a/tests/conftest.py b/tests/conftest.py index 57115e11..0fae30eb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,6 +3,7 @@ ---------- https://docs.pytest.org/en/6.2.x/fixture.html#scope-sharing-fixtures-across-classes-modules-packages-or-session """ + import os import pathlib import shutil diff --git a/tests/integration/test_example_01.py b/tests/integration/test_example_01.py index 74ff06aa..521ba41a 100644 --- a/tests/integration/test_example_01.py +++ b/tests/integration/test_example_01.py @@ -1,4 +1,5 @@ """""" + from pathlib import Path import zntrack diff --git a/tests/integration/test_list_deps.py b/tests/integration/test_list_deps.py index 712f5293..e2eefa13 100644 --- a/tests/integration/test_list_deps.py +++ b/tests/integration/test_list_deps.py @@ -1,4 +1,5 @@ """Test for [NodeAttribute] as 'zn.deps'.""" + import dvc.cli import zntrack.examples diff --git a/tests/integration/test_post_methods.py b/tests/integration/test_post_methods.py index f302af5d..72ebc704 100644 --- a/tests/integration/test_post_methods.py +++ b/tests/integration/test_post_methods.py @@ -4,6 +4,7 @@ _post_init_ is called after the node is initialized (loaded values are not available). _post_init_ is NOT called after Node.from_rev(). """ + import pathlib import pytest diff --git a/tests/test_zntrack.py b/tests/test_zntrack.py index c18a5002..340620f3 100644 --- a/tests/test_zntrack.py +++ b/tests/test_zntrack.py @@ -1,4 +1,5 @@ """Test 'ZnTrack' version.""" + from zntrack import __version__ diff --git a/zntrack/__init__.py b/zntrack/__init__.py index 9c79bfbe..1a5a72d9 100644 --- a/zntrack/__init__.py +++ b/zntrack/__init__.py @@ -2,6 +2,7 @@ GitHub: https://github.com/zincware/ZnTrack """ + import importlib.metadata from zntrack import exceptions, tools diff --git a/zntrack/cli/__init__.py b/zntrack/cli/__init__.py index 95a0cc3a..9cde2cdc 100644 --- a/zntrack/cli/__init__.py +++ b/zntrack/cli/__init__.py @@ -1,4 +1,5 @@ """The ZnTrack CLI.""" + import contextlib import importlib.metadata import os diff --git a/zntrack/core/node.py b/zntrack/core/node.py index 12472a80..cabef41f 100644 --- a/zntrack/core/node.py +++ b/zntrack/core/node.py @@ -1,4 +1,5 @@ """The ZnTrack Node class.""" + from __future__ import annotations import contextlib diff --git a/zntrack/core/nodify.py b/zntrack/core/nodify.py index 5590594b..201869a2 100644 --- a/zntrack/core/nodify.py +++ b/zntrack/core/nodify.py @@ -1,4 +1,5 @@ """The @nodify decorator.""" + import copy import dataclasses import json diff --git a/zntrack/examples/__init__.py b/zntrack/examples/__init__.py index 722581b2..38fe359a 100644 --- a/zntrack/examples/__init__.py +++ b/zntrack/examples/__init__.py @@ -2,6 +2,7 @@ These nodes are primarily used for testing and demonstration purposes. """ + import json import pathlib import random diff --git a/zntrack/exceptions/__init__.py b/zntrack/exceptions/__init__.py index ac06962f..5bd5877d 100644 --- a/zntrack/exceptions/__init__.py +++ b/zntrack/exceptions/__init__.py @@ -1,6 +1,5 @@ """All ZnTrack exceptions.""" - class NodeNotAvailableError(Exception): """Raised when a node is not available.""" diff --git a/zntrack/fields/dvc/__init__.py b/zntrack/fields/dvc/__init__.py index ff9724be..cbf202db 100644 --- a/zntrack/fields/dvc/__init__.py +++ b/zntrack/fields/dvc/__init__.py @@ -3,7 +3,6 @@ All relevant code has been moved to 'zntrack.fields.dvc.options' """ - import typing_extensions as tyex from zntrack.fields import fields diff --git a/zntrack/fields/field.py b/zntrack/fields/field.py index 61c160ac..3650a895 100644 --- a/zntrack/fields/field.py +++ b/zntrack/fields/field.py @@ -1,4 +1,5 @@ """The base class for all fields.""" + import abc import contextlib import enum diff --git a/zntrack/fields/fields.py b/zntrack/fields/fields.py index 6d35a9f1..ab235a80 100644 --- a/zntrack/fields/fields.py +++ b/zntrack/fields/fields.py @@ -1,4 +1,5 @@ """Fields that are used to define Nodes.""" + from zntrack.fields.dependency import Dependency from zntrack.fields.dvc.options import DVCOption, PlotsOption from zntrack.fields.zn.options import Output, Params, Plots diff --git a/zntrack/fields/meta/__init__.py b/zntrack/fields/meta/__init__.py index 9d96db30..dfd5250e 100644 --- a/zntrack/fields/meta/__init__.py +++ b/zntrack/fields/meta/__init__.py @@ -1,4 +1,5 @@ """Additional fields that are neither dvc/zn i/o fields.""" + import json import pathlib import typing diff --git a/zntrack/notebooks/jupyter.py b/zntrack/notebooks/jupyter.py index 66992991..09869a8b 100644 --- a/zntrack/notebooks/jupyter.py +++ b/zntrack/notebooks/jupyter.py @@ -1,4 +1,5 @@ """ZnTrack Jupyer Notebook interface.""" + import logging import pathlib import re diff --git a/zntrack/project/__init__.py b/zntrack/project/__init__.py index 37020012..5328ec10 100644 --- a/zntrack/project/__init__.py +++ b/zntrack/project/__init__.py @@ -1,4 +1,5 @@ """Providing a project class that can run experiments.""" + from zntrack.project.zntrack_project import Experiment, Project __all__ = ["Project", "Experiment"] diff --git a/zntrack/project/zntrack_project.py b/zntrack/project/zntrack_project.py index 713b1e04..e51b0433 100644 --- a/zntrack/project/zntrack_project.py +++ b/zntrack/project/zntrack_project.py @@ -1,4 +1,5 @@ """The class for the ZnTrackProject.""" + from __future__ import annotations import contextlib diff --git a/zntrack/tools/__init__.py b/zntrack/tools/__init__.py index 44560491..c0ed6439 100644 --- a/zntrack/tools/__init__.py +++ b/zntrack/tools/__init__.py @@ -3,6 +3,7 @@ This module provides additional tools for ZnTrack. This includes decorators to time method runtimes. """ + import functools from time import time diff --git a/zntrack/utils/__init__.py b/zntrack/utils/__init__.py index 678049a5..25f88d8b 100644 --- a/zntrack/utils/__init__.py +++ b/zntrack/utils/__init__.py @@ -1,4 +1,5 @@ """Standard python init file for the utils directory.""" + import dataclasses import enum import json diff --git a/zntrack/utils/cli.py b/zntrack/utils/cli.py index 655e73e4..eb76370e 100644 --- a/zntrack/utils/cli.py +++ b/zntrack/utils/cli.py @@ -1,4 +1,5 @@ """CLI Helpers.""" + import dataclasses import pathlib import subprocess diff --git a/zntrack/utils/config.py b/zntrack/utils/config.py index ab5f15f8..40458bf8 100644 --- a/zntrack/utils/config.py +++ b/zntrack/utils/config.py @@ -1,4 +1,5 @@ """Description: Configuration File for ZnTrack.""" + import contextlib import dataclasses import logging diff --git a/zntrack/utils/file_io.py b/zntrack/utils/file_io.py index 1dbd8ff3..9fb89c5a 100644 --- a/zntrack/utils/file_io.py +++ b/zntrack/utils/file_io.py @@ -1,4 +1,5 @@ """ZnTrack file I/O.""" + import json import logging import pathlib