@@ -44,11 +44,14 @@ EXTRA_PATH?=
4444
4545# Primary Python interpreter to use. It is used to create the
4646# virtual environment if `VENV_ENABLED` and `VENV_CREATE` are set to `true`.
47+ # If global `uv` is used, this value is passed as `--python VALUE` to the venv creation.
48+ # uv then downloads the Python interpreter if it is not available.
49+ # for more on this feature read the [uv python documentation](https://docs.astral.sh/uv/concepts/python-versions/)
4750# Default: python3
48- PRIMARY_PYTHON? =python3
51+ PRIMARY_PYTHON? =3.14
4952
5053# Minimum required Python version.
51- # Default: 3.7
54+ # Default: 3.9
5255PYTHON_MIN_VERSION? =3.7
5356
5457# Install packages using the given package installer method.
@@ -63,7 +66,7 @@ PYTHON_PACKAGE_INSTALLER?=uv
6366# Flag whether to use a global installed 'uv' or install
6467# it in the virtual environment.
6568# Default: false
66- MXENV_UV_GLOBAL? =false
69+ MXENV_UV_GLOBAL? =true
6770
6871# Flag whether to use virtual environment. If `false`, the
6972# interpreter according to `PRIMARY_PYTHON` found in `PATH` is used.
@@ -191,34 +194,15 @@ MXMAKE_FOLDER?=.mxmake
191194# Sentinel files
192195SENTINEL_FOLDER? =$(MXMAKE_FOLDER ) /sentinels
193196SENTINEL? =$(SENTINEL_FOLDER ) /about.txt
194- $(SENTINEL ) : Makefile
197+ $(SENTINEL ) : $( firstword $( MAKEFILE_LIST ) )
195198 @mkdir -p $(SENTINEL_FOLDER )
196199 @echo " Sentinels for the Makefile process." > $(SENTINEL )
197200
198201# #############################################################################
199202# mxenv
200203# #############################################################################
201204
202- # Check if given Python is installed
203- ifeq (,$(shell which $(PRIMARY_PYTHON ) ) )
204- $(error "PYTHON=$(PRIMARY_PYTHON) not found in $(PATH)")
205- endif
206-
207- # Check if given Python version is ok
208- PYTHON_VERSION_OK =$(shell $(PRIMARY_PYTHON ) -c "import sys; print((int(sys.version_info[0]) , int(sys.version_info[1])) >= tuple(map(int, '$(PYTHON_MIN_VERSION ) '.split('.'))))")
209- ifeq ($(PYTHON_VERSION_OK ) ,0)
210- $(error "Need Python >= $(PYTHON_MIN_VERSION)")
211- endif
212-
213- # Check if venv folder is configured if venv is enabled
214- ifeq ($(shell [[ "$(VENV_ENABLED ) " == "true" && "$(VENV_FOLDER ) " == "" ]] && echo "true") ,"true")
215- $(error "VENV_FOLDER must be configured if VENV_ENABLED is true")
216- endif
217-
218- # Check if global python is used with uv (this is not supported by uv)
219- ifeq ("$(VENV_ENABLED )$(PYTHON_PACKAGE_INSTALLER ) ","falseuv")
220- $(error "Package installer uv does not work with a global Python interpreter.")
221- endif
205+ OS? =
222206
223207# Determine the executable path
224208ifeq ("$(VENV_ENABLED ) ", "true")
@@ -243,6 +227,16 @@ endif
243227
244228MXENV_TARGET: =$(SENTINEL_FOLDER ) /mxenv.sentinel
245229$(MXENV_TARGET ) : $(SENTINEL )
230+ ifneq ("$(PYTHON_PACKAGE_INSTALLER )$(MXENV_UV_GLOBAL ) ","uvfalse")
231+ @$(PRIMARY_PYTHON) -c "import sys; vi = sys.version_info; sys.exit(1 if (int(vi[0]), int(vi[1])) >= tuple(map(int, '$(PYTHON_MIN_VERSION)'.split('.'))) else 0)" \
232+ && echo "Need Python >= $(PYTHON_MIN_VERSION)" && exit 1 || :
233+ else
234+ @echo "Use Python $(PYTHON_MIN_VERSION) over uv"
235+ endif
236+ @[[ "$(VENV_ENABLED)" == "true" && "$(VENV_FOLDER)" == "" ]] \
237+ && echo "VENV_FOLDER must be configured if VENV_ENABLED is true" && exit 1 || :
238+ @[[ "$(VENV_ENABLED)$(PYTHON_PACKAGE_INSTALLER)" == "falseuv" ]] \
239+ && echo "Package installer uv does not work with a global Python interpreter." && exit 1 || :
246240ifeq ("$(VENV_ENABLED ) ", "true")
247241ifeq ("$(VENV_CREATE ) ", "true")
248242ifeq ("$(PYTHON_PACKAGE_INSTALLER )$(MXENV_UV_GLOBAL ) ","uvtrue")
@@ -556,6 +550,10 @@ INSTALL_TARGETS+=$(ZEST_RELEASER_TARGET)
556550DIRTY_TARGETS+ =zest-releaser-dirty
557551CLEAN_TARGETS+ =zest-releaser-clean
558552
553+ # #############################################################################
554+ # Custom includes
555+ # #############################################################################
556+
559557-include $(INCLUDE_MAKEFILE )
560558
561559# #############################################################################
0 commit comments