From 9c724bf7453f08567d8cfad53c3be7a4e5c252b8 Mon Sep 17 00:00:00 2001 From: LUIS NOVO Date: Fri, 3 Jan 2025 18:16:44 -0300 Subject: [PATCH] fix: Keep environment variables but remove default values This fixes a regression where environment variables were not being properly loaded. Now we: - Keep environment variables support - Remove default values - Keep proper validation --- pyproject.toml | 2 +- src/surrantic/base.py | 10 +++++----- uv.lock | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 84b8c4e..3d767de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "surrantic" -version = "0.2.1" +version = "0.2.2" description = "A simple Pydantic ORM implementation for SurrealDB" readme = "README.md" authors = [ diff --git a/src/surrantic/base.py b/src/surrantic/base.py index fe5561c..cdf2782 100644 --- a/src/surrantic/base.py +++ b/src/surrantic/base.py @@ -15,11 +15,11 @@ setup_logging(logging.DEBUG) # Default database configuration -SURREAL_ADDRESS = os.getenv("SURREAL_ADDRESS") -SURREAL_USER = os.getenv("SURREAL_USER") -SURREAL_PASS = os.getenv("SURREAL_PASS") -SURREAL_NAMESPACE = os.getenv("SURREAL_NAMESPACE") -SURREAL_DATABASE = os.getenv("SURREAL_DATABASE") +SURREAL_ADDRESS = os.getenv("SURREAL_ADDRESS", None) +SURREAL_USER = os.getenv("SURREAL_USER", None) +SURREAL_PASS = os.getenv("SURREAL_PASS", None) +SURREAL_NAMESPACE = os.getenv("SURREAL_NAMESPACE", None) +SURREAL_DATABASE = os.getenv("SURREAL_DATABASE", None) class SurranticConfig: """Configuration class for Surrantic database connection. diff --git a/uv.lock b/uv.lock index 815b52f..f78dfd7 100644 --- a/uv.lock +++ b/uv.lock @@ -898,7 +898,7 @@ wheels = [ [[package]] name = "surrantic" -version = "0.2.0" +version = "0.2.1" source = { editable = "." } dependencies = [ { name = "pydantic" },