diff --git a/yard/__init__.py b/yard/__init__.py index 409f9ca..63c7433 100644 --- a/yard/__init__.py +++ b/yard/__init__.py @@ -1,4 +1,4 @@ from importlib.metadata import version __version__ = version("datatractor-yard") -__api_version__ = __version__ +__api_version__ = ".".join(__version__.split(".")[0:2]) diff --git a/yard/app.py b/yard/app.py index 0226e4a..ea5de03 100644 --- a/yard/app.py +++ b/yard/app.py @@ -12,7 +12,7 @@ from fastapi.templating import Jinja2Templates from pydantic import BaseModel -from yard import __api_version__ +from yard import __api_version__, __version__ from .models import Extractor, FileType from .utils import load_registry_collection @@ -200,7 +200,9 @@ async def load_data(): _get_info() +# Serve API under API version (vX.Y) and full API+data version (vX.Y.Z) app.mount(f"/api/v{__api_version__}", api) +app.mount(f"/api/v{__version__}", api) app.mount("/api/", api)