Skip to content

Commit

Permalink
rename PYTHON_UV_GLOBAL to MXENV_UV_GLOBAL
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Feb 27, 2024
1 parent 915f945 commit c519b59
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ PYTHON_PACKAGE_INSTALLER?=uv
# Flag whether to use a global installed 'uv' or install
# it in the virtual environment.
# Default: false
PYTHON_UV_GLOBAL?=false
MXENV_UV_GLOBAL?=false

# Flag whether to use virtual environment. If `false`, the
# interpreter according to `PRIMARY_PYTHON` found in `PATH` is used.
Expand Down Expand Up @@ -233,15 +233,15 @@ MXENV_TARGET:=$(SENTINEL_FOLDER)/mxenv.sentinel
$(MXENV_TARGET): $(SENTINEL)
ifeq ("$(VENV_ENABLED)", "true")
ifeq ("$(VENV_CREATE)", "true")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(PYTHON_UV_GLOBAL)", "uvtrue")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(MXENV_UV_GLOBAL)", "uvtrue")
@echo "Setup Python Virtual Environment using package 'uv' at '$(VENV_FOLDER)'"
@uv venv -p $(PRIMARY_PYTHON) --seed $(VENV_FOLDER)
else
@echo "Setup Python Virtual Environment using module 'venv' at '$(VENV_FOLDER)'"
@$(MXENV_PYTHON) -m venv $(VENV_FOLDER)
@$(MXENV_PYTHON) -m ensurepip -U
endif
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(PYTHON_UV_GLOBAL)", "uvfalse")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(MXENV_UV_GLOBAL)", "uvfalse")
@echo "Install uv"
@$(MXENV_PYTHON) -m pip install uv
endif
Expand Down
4 changes: 2 additions & 2 deletions src/mxmake/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_MakefileParser(self, tempdir):
"core.mxenv.PRIMARY_PYTHON": "python3",
"core.mxenv.PYTHON_MIN_VERSION": "3.7",
"core.mxenv.PYTHON_PACKAGE_INSTALLER": "pip",
"core.mxenv.PYTHON_UV_GLOBAL": "false",
"core.mxenv.MXENV_UV_GLOBAL": "false",
"core.mxenv.VENV_ENABLED": "true",
"core.mxenv.VENV_CREATE": "true",
"core.mxenv.VENV_FOLDER": "venv",
Expand Down Expand Up @@ -68,7 +68,7 @@ def test_MakefileParser(self, tempdir):
"core.mxenv.PRIMARY_PYTHON": "python3",
"core.mxenv.PYTHON_MIN_VERSION": "3.7",
"core.mxenv.PYTHON_PACKAGE_INSTALLER": "pip",
"core.mxenv.PYTHON_UV_GLOBAL": "false",
"core.mxenv.MXENV_UV_GLOBAL": "false",
"core.mxenv.VENV_ENABLED": "true",
"core.mxenv.VENV_CREATE": "true",
"core.mxenv.VENV_FOLDER": "venv",
Expand Down
8 changes: 4 additions & 4 deletions src/mxmake/tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def test_Makefile(self, tempdir):
"core.mxenv.PRIMARY_PYTHON": "python3",
"core.mxenv.PYTHON_MIN_VERSION": "3.7",
"core.mxenv.PYTHON_PACKAGE_INSTALLER": "pip",
"core.mxenv.PYTHON_UV_GLOBAL": "false",
"core.mxenv.MXENV_UV_GLOBAL": "false",
"core.mxenv.VENV_ENABLED": "true",
"core.mxenv.VENV_CREATE": "true",
"core.mxenv.VENV_FOLDER": "venv",
Expand Down Expand Up @@ -601,7 +601,7 @@ def test_Makefile(self, tempdir):
# Flag whether to use a global installed 'uv' or install
# it in the virtual environment.
# Default: false
PYTHON_UV_GLOBAL?=false
MXENV_UV_GLOBAL?=false
# Flag whether to use virtual environment. If `false`, the
# interpreter according to `PRIMARY_PYTHON` found in `PATH` is used.
Expand Down Expand Up @@ -701,15 +701,15 @@ def test_Makefile(self, tempdir):
$(MXENV_TARGET): $(SENTINEL)
ifeq ("$(VENV_ENABLED)", "true")
ifeq ("$(VENV_CREATE)", "true")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(PYTHON_UV_GLOBAL)", "uvtrue")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(MXENV_UV_GLOBAL)", "uvtrue")
@echo "Setup Python Virtual Environment using package 'uv' at '$(VENV_FOLDER)'"
@uv venv -p $(PRIMARY_PYTHON) --seed $(VENV_FOLDER)
else
@echo "Setup Python Virtual Environment using module 'venv' at '$(VENV_FOLDER)'"
@$(MXENV_PYTHON) -m venv $(VENV_FOLDER)
@$(MXENV_PYTHON) -m ensurepip -U
endif
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(PYTHON_UV_GLOBAL)", "uvfalse")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(MXENV_UV_GLOBAL)", "uvfalse")
@echo "Install uv"
@$(MXENV_PYTHON) -m pip install uv
endif
Expand Down
6 changes: 3 additions & 3 deletions src/mxmake/topics/core/mxenv.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#: environment.
#:default = pip
#:
#:[setting.PYTHON_UV_GLOBAL]
#:[setting.MXENV_UV_GLOBAL]
#:description = Flag whether to use a global installed 'uv' or install
#: it in the virtual environment.
#:default = false
Expand Down Expand Up @@ -111,15 +111,15 @@ MXENV_TARGET:=$(SENTINEL_FOLDER)/mxenv.sentinel
$(MXENV_TARGET): $(SENTINEL)
ifeq ("$(VENV_ENABLED)", "true")
ifeq ("$(VENV_CREATE)", "true")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(PYTHON_UV_GLOBAL)", "uvtrue")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(MXENV_UV_GLOBAL)", "uvtrue")
@echo "Setup Python Virtual Environment using package 'uv' at '$(VENV_FOLDER)'"
@uv venv -p $(PRIMARY_PYTHON) --seed $(VENV_FOLDER)
else
@echo "Setup Python Virtual Environment using module 'venv' at '$(VENV_FOLDER)'"
@$(MXENV_PYTHON) -m venv $(VENV_FOLDER)
@$(MXENV_PYTHON) -m ensurepip -U
endif
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(PYTHON_UV_GLOBAL)", "uvfalse")
ifeq ("$(PYTHON_PACKAGE_INSTALLER)$(MXENV_UV_GLOBAL)", "uvfalse")
@echo "Install uv"
@$(MXENV_PYTHON) -m pip install uv
endif
Expand Down

0 comments on commit c519b59

Please sign in to comment.