File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,4 +185,9 @@ pyrightconfig.json
185185pyvenv.cfg
186186pip-selfcheck.json
187187
188+ # Ignore dynamically generated version files
189+ ** /_version.py
190+ ** /_version.pyi
191+ ** /.version
192+
188193# End of https://www.toptal.com/developers/gitignore/api/python,venv
Original file line number Diff line number Diff line change 11[build-system ]
2- requires = [" setuptools>=61.0" ]
2+ requires = [" setuptools>=61.0" , " setuptools_scm>=8 " ]
33build-backend = " setuptools.build_meta"
44
55[project ]
66name = " robopipe-api"
7- version = " 0.1.0"
87description = " API for the Robopipe application"
98authors = [
109 { name = " Adam Berkes" , email = " adam.berkes@koala42.com" },
@@ -24,7 +23,7 @@ keywords = [
2423 " industrial-machine-vision" ,
2524]
2625requires-python = " >=3.11"
27- dynamic = [" dependencies" ]
26+ dynamic = [" dependencies" , " version " ]
2827
2928[project .urls ]
3029Homepage = " https://robopipe.io"
@@ -33,6 +32,12 @@ Repository = "https://github.com/Robopipe/API"
3332
3433[tool .setuptools .dynamic ]
3534dependencies = { file = [" requirements.txt" ] }
35+ version = { attr = " robopipe_api._version.__version__" }
36+
37+ [tool .setuptools_scm ]
38+ version_file = " robopipe_api/_version.py"
39+ local_scheme = " no-local-version"
40+
3641
3742[project .scripts ]
3843robopipe-api = " robopipe_api.robopipe:main"
Original file line number Diff line number Diff line change 66import uvicorn
77
88from contextlib import asynccontextmanager
9+ from importlib .metadata import version
910import os
1011
1112from .camera .camera_manager import camera_manager_factory
@@ -66,6 +67,7 @@ async def lifespan(app: FastAPI):
6667app = FastAPI (
6768 lifespan = lifespan ,
6869 title = "Robopipe API" ,
70+ version = version ("robopipe_api" ),
6971 description = "API for the Robopipe application" ,
7072 servers = [
7173 {
You can’t perform that action at this time.
0 commit comments