File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,9 +10,13 @@ COPY middleware ./middleware
1010# Upgrade pip and install uv
1111RUN pip install --no-cache-dir --upgrade pip==25.3 uv==0.9.27
1212
13+ # Declare build argument for versioning
14+ ARG APP_VERSION=0.0.0
15+
1316# We prefer to build a wheel for our package first. This ensures we have a clean,
1417# distributable artifact that contains only the necessary files.
15- RUN uv build --package sql_to_arc --wheel
18+ # We set SETUPTOOLS_SCM_PRETEND_VERSION so hatch-vcs can work without .git folder.
19+ RUN SETUPTOOLS_SCM_PRETEND_VERSION=${APP_VERSION#v} uv build --package sql_to_arc --wheel
1620
1721
1822# ---- Binary Build Stage ----
@@ -51,7 +55,8 @@ RUN uv sync --no-dev
5155# 4. Finally, for packages like sql_to_arc that exist both as a workspace dependency
5256# and as a pre-built wheel, we explicitly 'uv pip install' the wheel. This ensures
5357# we use our optimized, pre-built package instead of the 'editable' source install.
54- RUN uv pip install /tmp/wheels/*.whl pyinstaller
58+ ARG APP_VERSION=0.0.0
59+ RUN SETUPTOOLS_SCM_PRETEND_VERSION=${APP_VERSION#v} uv pip install /tmp/wheels/*.whl pyinstaller
5560
5661# Build standalone binary using the .venv's context.
5762RUN . .venv/bin/activate && \
Original file line number Diff line number Diff line change 11[project ]
22name = " sql_to_arc"
3- version = " 0.0.0 " # currently we disregard the version of this subpackage
3+ dynamic = [ " version" ]
44description = " The FAIRagro advanced middleware SQL-to-ARC converter"
55readme = " README.md"
66requires-python = " >=3.12"
@@ -17,9 +17,13 @@ dependencies = [
1717api_client = { git = " https://github.com/fairagro/m4.2_advanced_middleware_api.git" , branch = " main" , subdirectory = " middleware/api_client" }
1818shared = { git = " https://github.com/fairagro/m4.2_advanced_middleware_api.git" , branch = " main" , subdirectory = " middleware/shared" }
1919
20+ [tool .hatch .version ]
21+ source = " vcs"
22+ raw-options = { root = " ../.." }
23+
2024[tool .hatch .build .targets .wheel ]
2125packages = [" src/middleware" ]
2226
2327[build-system ]
24- requires = [" hatchling" ]
28+ requires = [" hatchling" , " hatch-vcs " ]
2529build-backend = " hatchling.build"
Original file line number Diff line number Diff line change 11[project ]
22name = " m4-2-sql-to-arc"
3- version = " 0.1.0 "
3+ dynamic = [ " version " ]
44description = " The FAIRagro SQL-to-ARC client"
55readme = " README.md"
66requires-python = " >=3.12"
@@ -246,3 +246,13 @@ disable = [
246246 " C0301" , # line-too-long (handled by ruff formatter)
247247 " R0801" , # duplicate-code (can be noisy in tests)
248248]
249+
250+ [tool .hatch .version ]
251+ source = " vcs"
252+
253+ [tool .hatch .build .targets .wheel ]
254+ include = [" README.md" ]
255+
256+ [build-system ]
257+ requires = [" hatchling" , " hatch-vcs" ]
258+ build-backend = " hatchling.build"
You can’t perform that action at this time.
0 commit comments