diff --git a/agipack/cli.py b/agipack/cli.py index 7e4b99b..ececb55 100644 --- a/agipack/cli.py +++ b/agipack/cli.py @@ -1,4 +1,3 @@ -import importlib from pathlib import Path import typer @@ -21,7 +20,9 @@ def main(ctx: typer.Context): @app.command() def version(): """Print the version number.""" - print(importlib.metadata.version("agi-pack")) + from agipack.version import __version__ + + print(__version__) @app.command() diff --git a/agipack/config.py b/agipack/config.py index e2fa818..5f27175 100644 --- a/agipack/config.py +++ b/agipack/config.py @@ -4,7 +4,7 @@ from typing import Dict, List, Optional, Union import yaml -from pydantic import field_validator +from pydantic import validator from pydantic.dataclasses import dataclass logger = logging.getLogger(__name__) @@ -113,7 +113,7 @@ def is_base_image(self) -> bool: """Check if the base target is root / does not have a parent.""" return ":" in self.base - @field_validator("python", mode="before") + @validator("python", pre=True) def validate_python_version(cls, python): """Validate the python version.""" python = str(python) @@ -121,7 +121,7 @@ def validate_python_version(cls, python): raise ValueError(f"Python version must be >= 3.6 (found {python})") return python - @field_validator("command", mode="before") + @validator("command", pre=True) def validate_command_version(cls, cmd): """Validate the command.""" if isinstance(cmd, str): @@ -175,7 +175,7 @@ def is_prod(self) -> bool: """Check if the configuration is for production.""" return self.prod - @field_validator("images") + @validator("images") def validate_python_dependencies_for_nonbase_images(cls, images): """Validate that all images have the same python dependency as the base image.""" version = None diff --git a/agipack/version.py b/agipack/version.py index 0c5c300..74acd0e 100644 --- a/agipack/version.py +++ b/agipack/version.py @@ -1 +1 @@ -__version__ = "0.1.11" +__version__ = "0.1.12" diff --git a/examples/generated/Dockerfile-base-cpu b/examples/generated/Dockerfile-base-cpu index a89db7b..d93e832 100644 --- a/examples/generated/Dockerfile-base-cpu +++ b/examples/generated/Dockerfile-base-cpu @@ -1,5 +1,5 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>> -# Auto-generated by agi-pack (version=0.1.11). +# Auto-generated by agi-pack (version=0.1.12). FROM debian:buster-slim AS base-cpu # Setup environment variables diff --git a/examples/generated/Dockerfile-base-cu118 b/examples/generated/Dockerfile-base-cu118 index 5a614a3..f64bde3 100644 --- a/examples/generated/Dockerfile-base-cu118 +++ b/examples/generated/Dockerfile-base-cu118 @@ -1,5 +1,5 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>> -# Auto-generated by agi-pack (version=0.1.11). +# Auto-generated by agi-pack (version=0.1.12). FROM nvidia/cuda:11.8.0-base-ubuntu22.04 AS base-gpu # Setup environment variables diff --git a/examples/generated/Dockerfile-builder b/examples/generated/Dockerfile-builder index 151f8d6..4d181ba 100644 --- a/examples/generated/Dockerfile-builder +++ b/examples/generated/Dockerfile-builder @@ -1,5 +1,5 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>> -# Auto-generated by agi-pack (version=0.1.11). +# Auto-generated by agi-pack (version=0.1.12). FROM debian:buster-slim AS agipack-builder # Setup environment variables diff --git a/pyproject.toml b/pyproject.toml index 7e83789..63a09fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ dynamic = ["version"] dependencies = [ "jinja2", - "pydantic>=2", + "pydantic<2", "pyyaml", "typer[all]" ]