Skip to content

Commit fe2585a

Browse files
committed
fix(monorepo): attempt to fix versioning with setuptools_scm in api
1 parent 61fb0e5 commit fe2585a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

api/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[tool.setuptools_scm]
2-
root = ".."
2+
write_to = "src/app/_version.py"
3+
search_parent_directories = "true"
34

45
[tool.black]
56
line-length = 88

api/src/app/core/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import os
22

33
from pydantic_settings import BaseSettings
4-
from setuptools_scm import get_version
54
from starlette.config import Config
65

6+
from .._version import version as __version__
7+
78
from ..utils.cdktf_utils import create_cdktf_dir
89

910
current_file_dir = os.path.dirname(os.path.realpath(__file__))
@@ -19,7 +20,7 @@ class AppSettings(BaseSettings):
1920
"APP_DESCRIPTION", default="OpenLabs backend API."
2021
)
2122
APP_VERSION: str | None = config(
22-
"APP_VERSION", default=get_version()
23+
"APP_VERSION", default=__version__
2324
) # Latest tagged release
2425
LICENSE_NAME: str | None = config("LICENSE", default="GPLv3")
2526
LICENSE_URL: str | None = config(

0 commit comments

Comments
 (0)