diff --git a/CHANGES.md b/CHANGES.md index ae540b2..dbd1b2b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ## 1.0a4 (unreleased) +- Export `PATH` with virtual environment and node modules bin folders. + +- Get rid of `MXENV_PATH`. + - Rename `PYTHON_BIN` to `PRIMARY_PYTHON` in `mxenv` domain. - Use `python -m pip` all over the place instead of `pip` executable. diff --git a/Makefile b/Makefile index 1a8c965..6583b29 100644 --- a/Makefile +++ b/Makefile @@ -193,10 +193,10 @@ endif # determine the executable path ifeq ("$(VENV_ENABLED)", "true") -MXENV_PATH=$(VENV_FOLDER)/bin/ -MXENV_PYTHON=$(MXENV_PATH)python +export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(PATH) +export VIRTUAL_ENV=$(VENV_FOLDER) +MXENV_PYTHON=python else -MXENV_PATH= MXENV_PYTHON=$(PRIMARY_PYTHON) endif @@ -249,12 +249,12 @@ $(RUFF_TARGET): $(MXENV_TARGET) .PHONY: ruff-check ruff-check: $(RUFF_TARGET) @echo "Run ruff check" - @$(MXENV_PATH)ruff check $(RUFF_SRC) + @ruff check $(RUFF_SRC) .PHONY: ruff-format ruff-format: $(RUFF_TARGET) @echo "Run ruff format" - @$(MXENV_PATH)ruff format $(RUFF_SRC) + @ruff format $(RUFF_SRC) .PHONY: ruff-dirty ruff-dirty: @@ -284,12 +284,12 @@ $(ISORT_TARGET): $(MXENV_TARGET) .PHONY: isort-check isort-check: $(ISORT_TARGET) @echo "Run isort check" - @$(MXENV_PATH)isort --check $(ISORT_SRC) + @isort --check $(ISORT_SRC) .PHONY: isort-format isort-format: $(ISORT_TARGET) @echo "Run isort format" - @$(MXENV_PATH)isort $(ISORT_SRC) + @isort $(ISORT_SRC) .PHONY: isort-dirty isort-dirty: @@ -312,8 +312,8 @@ CLEAN_TARGETS+=isort-clean # additional targets required for building docs. DOCS_TARGETS+= -SPHINX_BIN=$(MXENV_PATH)sphinx-build -SPHINX_AUTOBUILD_BIN=$(MXENV_PATH)sphinx-autobuild +SPHINX_BIN=sphinx-build +SPHINX_AUTOBUILD_BIN=sphinx-autobuild DOCS_TARGET:=$(SENTINEL_FOLDER)/sphinx.sentinel $(DOCS_TARGET): $(MXENV_TARGET) @@ -357,13 +357,11 @@ MXMAKE_FILES?=$(MXMAKE_FOLDER)/files # set environment variables for mxmake define set_mxfiles_env - @export MXMAKE_MXENV_PATH=$(1) - @export MXMAKE_FILES=$(2) + @export MXMAKE_FILES=$(1) endef # unset environment variables for mxmake define unset_mxfiles_env - @unset MXMAKE_MXENV_PATH @unset MXMAKE_FILES endef @@ -380,9 +378,9 @@ FILES_TARGET:=requirements-mxdev.txt $(FILES_TARGET): $(PROJECT_CONFIG) $(MXENV_TARGET) $(SOURCES_TARGET) $(LOCAL_PACKAGE_FILES) @echo "Create project files" @mkdir -p $(MXMAKE_FILES) - $(call set_mxfiles_env,$(MXENV_PATH),$(MXMAKE_FILES)) - @$(MXENV_PATH)mxdev -n -c $(PROJECT_CONFIG) - $(call unset_mxfiles_env,$(MXENV_PATH),$(MXMAKE_FILES)) + $(call set_mxfiles_env,$(MXMAKE_FILES)) + @mxdev -n -c $(PROJECT_CONFIG) + $(call unset_mxfiles_env) @test -e $(MXMAKE_FILES)/pip.conf && cp $(MXMAKE_FILES)/pip.conf $(VENV_FOLDER)/pip.conf || : @touch $(FILES_TARGET) @@ -508,7 +506,7 @@ $(MYPY_TARGET): $(MXENV_TARGET) .PHONY: mypy mypy: $(PACKAGES_TARGET) $(MYPY_TARGET) @echo "Run mypy" - @$(MXENV_PATH)mypy $(MYPY_SRC) + @mypy $(MYPY_SRC) .PHONY: mypy-dirty mypy-dirty: @@ -537,22 +535,22 @@ $(ZEST_RELEASER_TARGET): $(MXENV_TARGET) .PHONY: zest-releaser-prerelease zest-releaser-prerelease: $(ZEST_RELEASER_TARGET) @echo "Run prerelease" - @$(MXENV_PATH)prerelease + @prerelease .PHONY: zest-releaser-release zest-releaser-release: $(ZEST_RELEASER_TARGET) @echo "Run release" - @$(MXENV_PATH)release + @release .PHONY: zest-releaser-postrelease zest-releaser-postrelease: $(ZEST_RELEASER_TARGET) @echo "Run postrelease" - @$(MXENV_PATH)postrelease + @postrelease .PHONY: zest-releaser-fullrelease zest-releaser-fullrelease: $(ZEST_RELEASER_TARGET) @echo "Run fullrelease" - @$(MXENV_PATH)fullrelease + @fullrelease .PHONY: zest-releaser-dirty zest-releaser-dirty: diff --git a/src/mxmake/templates.py b/src/mxmake/templates.py index 3048e0e..df2c2e4 100644 --- a/src/mxmake/templates.py +++ b/src/mxmake/templates.py @@ -3,7 +3,6 @@ from mxmake.topics import Domain from mxmake.topics import load_topics from mxmake.utils import gh_actions_path -from mxmake.utils import mxenv_path from mxmake.utils import mxmake_files from mxmake.utils import ns_name @@ -158,7 +157,6 @@ def template_variables(self) -> typing.Dict[str, typing.Any]: return dict( description=self.description, env=self.env, - mxenv_path=mxenv_path(), testpaths=self.package_paths(ns_name("test-path")), ) diff --git a/src/mxmake/templates/pytest-run-coverage.sh b/src/mxmake/templates/pytest-run-coverage.sh index a83357d..bd02f0b 100644 --- a/src/mxmake/templates/pytest-run-coverage.sh +++ b/src/mxmake/templates/pytest-run-coverage.sh @@ -21,7 +21,7 @@ omits=$(printf ",%s" "${omits[@]}") omits=${omits:1} {%- endif %} -{{ mxenv_path }}coverage run \ +coverage run \ --source=$sources \ {% if omitpaths %} --omit=$omits \ @@ -32,6 +32,6 @@ omits=${omits:1} {% endfor %} -{{ mxenv_path }}coverage report -{{ mxenv_path }}coverage html +coverage report +coverage html {% endblock %} diff --git a/src/mxmake/templates/pytest-run-tests.sh b/src/mxmake/templates/pytest-run-tests.sh index 8a6fd6a..aa94687 100644 --- a/src/mxmake/templates/pytest-run-tests.sh +++ b/src/mxmake/templates/pytest-run-tests.sh @@ -1,7 +1,7 @@ {% extends "env.sh" %} {% block env_content %} -{{ mxenv_path }}pytest \ +pytest \ {% for path in testpaths %} {{ path }}{% if not loop.last %} \{% endif %} diff --git a/src/mxmake/templates/zope-testrunner-run-coverage.sh b/src/mxmake/templates/zope-testrunner-run-coverage.sh index 3a3e0ae..68cebba 100644 --- a/src/mxmake/templates/zope-testrunner-run-coverage.sh +++ b/src/mxmake/templates/zope-testrunner-run-coverage.sh @@ -21,7 +21,7 @@ omits=$(printf ",%s" "${omits[@]}") omits=${omits:1} {%- endif %} -{{ mxenv_path }}coverage run \ +coverage run \ --source=$sources \ {% if omitpaths %} --omit=$omits \ @@ -32,6 +32,6 @@ omits=${omits:1} {% endfor %} -{{ mxenv_path }}coverage report -{{ mxenv_path }}coverage html +coverage report +coverage html {% endblock %} diff --git a/src/mxmake/templates/zope-testrunner-run-tests.sh b/src/mxmake/templates/zope-testrunner-run-tests.sh index c4892dc..1a39799 100644 --- a/src/mxmake/templates/zope-testrunner-run-tests.sh +++ b/src/mxmake/templates/zope-testrunner-run-tests.sh @@ -1,7 +1,7 @@ {% extends "env.sh" %} {% block env_content %} -{{ mxenv_path }}zope-testrunner --auto-color --auto-progress \ +zope-testrunner --auto-color --auto-progress \ {% for path in testpaths %} --test-path={{ path }} \ {% endfor %} diff --git a/src/mxmake/testing/__init__.py b/src/mxmake/testing/__init__.py index 5732aa2..3aaa88e 100644 --- a/src/mxmake/testing/__init__.py +++ b/src/mxmake/testing/__init__.py @@ -40,7 +40,6 @@ def __call__(self, fn: typing.Callable): def wrapper(*a): tempdir = tempfile.mkdtemp() os.environ["MXMAKE_FILES"] = tempdir - os.environ["MXMAKE_MXENV_PATH"] = tempdir os.environ["MXMAKE_GH_ACTIONS_PATH"] = tempdir try: if self.reset_registry: @@ -51,7 +50,6 @@ def wrapper(*a): finally: shutil.rmtree(tempdir) del os.environ["MXMAKE_FILES"] - del os.environ["MXMAKE_MXENV_PATH"] del os.environ["MXMAKE_GH_ACTIONS_PATH"] return wrapper diff --git a/src/mxmake/tests/test_templates.py b/src/mxmake/tests/test_templates.py index 39a233c..a79e6b5 100644 --- a/src/mxmake/tests/test_templates.py +++ b/src/mxmake/tests/test_templates.py @@ -149,7 +149,6 @@ def test_TestScript(self, tempdir): "description": "Run tests", "env": {"ENV_PARAM": "env_value"}, "testpaths": ["sources/package/src", "src"], - "mxenv_path": tempdir + os.path.sep, }, ) self.assertEqual(template.package_paths("inexistent"), []) @@ -181,14 +180,11 @@ def test_TestScript(self, tempdir): trap unsetenv ERR INT setenv - - /.../zope-testrunner --auto-color --auto-progress \\ + zope-testrunner --auto-color --auto-progress \\ --test-path=sources/package/src \\ --test-path=src \\ --module=$1 - unsetenv - exit 0 """, f.read(), @@ -217,7 +213,7 @@ def test_TestScript(self, tempdir): # Run tests set -e - /.../zope-testrunner --auto-color --auto-progress \\ + zope-testrunner --auto-color --auto-progress \\ --test-path=sources/package/src \\ --module=$1 @@ -249,7 +245,7 @@ def test_TestScript(self, tempdir): # Run tests set -e - /.../pytest \\ + pytest \\ sources/package/src exit 0 @@ -303,7 +299,6 @@ def test_CoverageScript(self, tempdir): "src/local/file1.py", "src/local/file2.py", ], - "mxenv_path": tempdir + os.path.sep, }, ) self.assertEqual(template.package_paths("inexistent"), []) @@ -348,7 +343,6 @@ def test_CoverageScript(self, tempdir): trap unsetenv ERR INT setenv - sources=( sources/package/src/package src/local @@ -366,19 +360,16 @@ def test_CoverageScript(self, tempdir): omits=$(printf ",%s" "${omits[@]}") omits=${omits:1} - - /.../coverage run \\ + coverage run \\ --source=$sources \\ --omit=$omits \\ -m zope.testrunner --auto-color --auto-progress \\ --test-path=sources/package/src \\ --test-path=src - /.../coverage report - /.../coverage html - + coverage report + coverage html unsetenv - exit 0 """, f.read(), @@ -415,13 +406,14 @@ def test_CoverageScript(self, tempdir): sources=$(printf ",%s" "${sources[@]}") sources=${sources:1} - /.../coverage run \\ + + coverage run \\ --source=$sources \\ -m zope.testrunner --auto-color --auto-progress \\ --test-path=sources/package/src - /.../coverage report - /.../coverage html + coverage report + coverage html exit 0 """, @@ -459,13 +451,14 @@ def test_CoverageScript(self, tempdir): sources=$(printf ",%s" "${sources[@]}") sources=${sources:1} - /.../coverage run \\ + + coverage run \\ --source=$sources \\ -m pytest \\ sources/package/src - /.../coverage report - /.../coverage html + coverage report + coverage html exit 0 """, @@ -665,10 +658,10 @@ def test_Makefile(self, tempdir): # determine the executable path ifeq ("$(VENV_ENABLED)", "true") - MXENV_PATH=$(VENV_FOLDER)/bin/ - MXENV_PYTHON=$(MXENV_PATH)python + export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(PATH) + export VIRTUAL_ENV=$(VENV_FOLDER) + MXENV_PYTHON=python else - MXENV_PATH= MXENV_PYTHON=$(PRIMARY_PYTHON) endif diff --git a/src/mxmake/tests/test_utils.py b/src/mxmake/tests/test_utils.py index 30df07a..87e7b2e 100644 --- a/src/mxmake/tests/test_utils.py +++ b/src/mxmake/tests/test_utils.py @@ -8,14 +8,6 @@ class TestUtils(unittest.TestCase): def test_namespace(self): self.assertEqual(utils.NAMESPACE, "mxmake-") - def test_mxenv_path(self): - self.assertEqual(utils.mxenv_path(), os.path.join("venv", "bin") + os.path.sep) - os.environ["MXMAKE_MXENV_PATH"] = "other" - self.assertEqual(utils.mxenv_path(), "other" + os.path.sep) - os.environ["MXMAKE_MXENV_PATH"] = "" - self.assertEqual(utils.mxenv_path(), "") - del os.environ["MXMAKE_MXENV_PATH"] - def test_mxmake_files(self): self.assertEqual(utils.mxmake_files(), os.path.join(".mxmake", "files")) os.environ["MXMAKE_FILES"] = "other" diff --git a/src/mxmake/topics/applications/twisted.mk b/src/mxmake/topics/applications/twisted.mk index dd5cb59..6681836 100644 --- a/src/mxmake/topics/applications/twisted.mk +++ b/src/mxmake/topics/applications/twisted.mk @@ -27,7 +27,7 @@ $(TWISTED_TARGET): $(MXENV_TARGET) .PHONY: twisted-start twisted-start: $(TWISTED_TARGET) @echo "Run Twisted" - @$(MXENV_PATH)twistd $(TWISTED_TWISTD_OPTIONS) $(TWISTED_TAC_FILE) + @twistd $(TWISTED_TWISTD_OPTIONS) $(TWISTED_TAC_FILE) .PHONY: twisted-dirty twisted-dirty: diff --git a/src/mxmake/topics/applications/zest-releaser.mk b/src/mxmake/topics/applications/zest-releaser.mk index 328d895..f55bf4f 100644 --- a/src/mxmake/topics/applications/zest-releaser.mk +++ b/src/mxmake/topics/applications/zest-releaser.mk @@ -35,22 +35,22 @@ $(ZEST_RELEASER_TARGET): $(MXENV_TARGET) .PHONY: zest-releaser-prerelease zest-releaser-prerelease: $(ZEST_RELEASER_TARGET) @echo "Run prerelease" - @$(MXENV_PATH)prerelease + @prerelease .PHONY: zest-releaser-release zest-releaser-release: $(ZEST_RELEASER_TARGET) @echo "Run release" - @$(MXENV_PATH)release + @release .PHONY: zest-releaser-postrelease zest-releaser-postrelease: $(ZEST_RELEASER_TARGET) @echo "Run postrelease" - @$(MXENV_PATH)postrelease + @postrelease .PHONY: zest-releaser-fullrelease zest-releaser-fullrelease: $(ZEST_RELEASER_TARGET) @echo "Run fullrelease" - @$(MXENV_PATH)fullrelease + @fullrelease .PHONY: zest-releaser-dirty zest-releaser-dirty: diff --git a/src/mxmake/topics/applications/zope.mk b/src/mxmake/topics/applications/zope.mk index 97c3caf..99cdbd0 100644 --- a/src/mxmake/topics/applications/zope.mk +++ b/src/mxmake/topics/applications/zope.mk @@ -60,7 +60,7 @@ ${ZOPE_CONFIGURATION_FILE}: $(ZOPE_INSTANCE_TARGET): $(COOKIECUTTER_TARGET) $(ZOPE_CONFIGURATION_FILE) @echo Create Plone/Zope configuration from $(ZOPE_TEMPLATE) to $(ZOPE_INSTANCE_FOLDER) - @$(MXENV_PATH)cookiecutter -f --no-input --checkout ${ZOPE_TEMPLATE_CHECKOUT} --config-file $(ZOPE_CONFIGURATION_FILE) --output-dir $(ZOPE_BASE_FOLDER) $(ZOPE_TEMPLATE) + @cookiecutter -f --no-input --checkout ${ZOPE_TEMPLATE_CHECKOUT} --config-file $(ZOPE_CONFIGURATION_FILE) --output-dir $(ZOPE_BASE_FOLDER) $(ZOPE_TEMPLATE) .PHONY: zope-instance zope-instance: $(ZOPE_INSTANCE_TARGET) $(SOURCES) @@ -68,17 +68,17 @@ zope-instance: $(ZOPE_INSTANCE_TARGET) $(SOURCES) .PHONY: zope-start zope-start: $(ZOPE_INSTANCE_TARGET) $(PACKAGES_TARGET) @echo "Start Zope/Plone with configuration in $(ZOPE_INSTANCE_FOLDER)" - @$(MXENV_PATH)runwsgi -v "$(ZOPE_INSTANCE_FOLDER)/etc/zope.ini" + @runwsgi -v "$(ZOPE_INSTANCE_FOLDER)/etc/zope.ini" .PHONY: zope-debug zope-debug: $(ZOPE_INSTANCE_TARGET) $(PACKAGES_TARGET) @echo "Start Zope/Plone with configuration in $(ZOPE_INSTANCE_FOLDER)" - @$(MXENV_PATH)zconsole debug "$(ZOPE_INSTANCE_FOLDER)/etc/zope.ini" + @zconsole debug "$(ZOPE_INSTANCE_FOLDER)/etc/zope.ini" .PHONY: zope-runscript zope-runscript: $(ZOPE_INSTANCE_TARGET) $(PACKAGES_TARGET) @echo "Run Zope/Plone Console Script $(ZOPE_SCRIPTNAME) in $(ZOPE_INSTANCE_FOLDER)" - @$(MXENV_PATH)zconsole run "$(ZOPE_INSTANCE_FOLDER)/etc/zope.ini" $(ZOPE_SCRIPTNAME) + @zconsole run "$(ZOPE_INSTANCE_FOLDER)/etc/zope.ini" $(ZOPE_SCRIPTNAME) .PHONY: zope-dirty zope-dirty: diff --git a/src/mxmake/topics/core/mxenv.mk b/src/mxmake/topics/core/mxenv.mk index f37f733..9028c21 100644 --- a/src/mxmake/topics/core/mxenv.mk +++ b/src/mxmake/topics/core/mxenv.mk @@ -79,10 +79,10 @@ endif # determine the executable path ifeq ("$(VENV_ENABLED)", "true") -MXENV_PATH=$(VENV_FOLDER)/bin/ -MXENV_PYTHON=$(MXENV_PATH)python +export PATH:=$(shell pwd)/$(VENV_FOLDER)/bin/:$(PATH) +export VIRTUAL_ENV=$(VENV_FOLDER) +MXENV_PYTHON=python else -MXENV_PATH= MXENV_PYTHON=$(PRIMARY_PYTHON) endif diff --git a/src/mxmake/topics/core/mxfiles.mk b/src/mxmake/topics/core/mxfiles.mk index b70a3c0..694ca5d 100644 --- a/src/mxmake/topics/core/mxfiles.mk +++ b/src/mxmake/topics/core/mxfiles.mk @@ -30,13 +30,11 @@ MXMAKE_FILES?=$(MXMAKE_FOLDER)/files # set environment variables for mxmake define set_mxfiles_env - @export MXMAKE_MXENV_PATH=$(1) - @export MXMAKE_FILES=$(2) + @export MXMAKE_FILES=$(1) endef # unset environment variables for mxmake define unset_mxfiles_env - @unset MXMAKE_MXENV_PATH @unset MXMAKE_FILES endef @@ -53,9 +51,9 @@ FILES_TARGET:=requirements-mxdev.txt $(FILES_TARGET): $(PROJECT_CONFIG) $(MXENV_TARGET) $(SOURCES_TARGET) $(LOCAL_PACKAGE_FILES) @echo "Create project files" @mkdir -p $(MXMAKE_FILES) - $(call set_mxfiles_env,$(MXENV_PATH),$(MXMAKE_FILES)) - @$(MXENV_PATH)mxdev -n -c $(PROJECT_CONFIG) - $(call unset_mxfiles_env,$(MXENV_PATH),$(MXMAKE_FILES)) + $(call set_mxfiles_env,$(MXMAKE_FILES)) + @mxdev -n -c $(PROJECT_CONFIG) + $(call unset_mxfiles_env) @test -e $(MXMAKE_FILES)/pip.conf && cp $(MXMAKE_FILES)/pip.conf $(VENV_FOLDER)/pip.conf || : @touch $(FILES_TARGET) diff --git a/src/mxmake/topics/core/sources.mk b/src/mxmake/topics/core/sources.mk index 05bff39..ab4c6fd 100644 --- a/src/mxmake/topics/core/sources.mk +++ b/src/mxmake/topics/core/sources.mk @@ -20,7 +20,7 @@ SOURCES_TARGET:=$(SENTINEL_FOLDER)/sources.sentinel $(SOURCES_TARGET): $(PROJECT_CONFIG) $(MXENV_TARGET) @echo "Checkout project sources" - @$(MXENV_PATH)mxdev -o -c $(PROJECT_CONFIG) + @mxdev -o -c $(PROJECT_CONFIG) @touch $(SOURCES_TARGET) .PHONY: sources diff --git a/src/mxmake/topics/docs/jsdoc.mk b/src/mxmake/topics/docs/jsdoc.mk index 81014e0..1f2d26c 100644 --- a/src/mxmake/topics/docs/jsdoc.mk +++ b/src/mxmake/topics/docs/jsdoc.mk @@ -2,32 +2,13 @@ #:title = JSDoc Documentation #:description = JSDoc installation and integration into Sphinx. #:depends = js.npm -#: -#:[target.jsdoc] -#:description = Provide jsdoc executable on PATH. ############################################################################## # jsdoc ############################################################################## -JSDOC_PATH=$(shell pwd)/$(NPM_PREFIX)/node_modules/jsdoc - -JSDOC_TARGET:=$(SENTINEL_FOLDER)/jsdoc.sentinel -$(JSDOC_TARGET): $(NPM_TARGET) - @echo "Link jsdoc executable to name expected by Sphinx" - @ln -sf $(JSDOC_PATH)/jsdoc.js $(JSDOC_PATH)/jsdoc - @touch $(JSDOC_TARGET) - -.PHONY: jsdoc -jsdoc: $(JSDOC_TARGET) - @export PATH=$(PATH):$(JSDOC_PATH) - # extend npm dev packages NPM_DEV_PACKAGES+=jsdoc # extend sphinx requirements and docs targets DOCS_REQUIREMENTS+=sphinx_js -DOCS_TARGETS+=jsdoc - -# extend default targets -INSTALL_TARGETS+=$(JSDOC_TARGET) diff --git a/src/mxmake/topics/docs/sphinx.mk b/src/mxmake/topics/docs/sphinx.mk index e65f5f5..d83acc8 100644 --- a/src/mxmake/topics/docs/sphinx.mk +++ b/src/mxmake/topics/docs/sphinx.mk @@ -33,8 +33,8 @@ # additional targets required for building docs. DOCS_TARGETS+= -SPHINX_BIN=$(MXENV_PATH)sphinx-build -SPHINX_AUTOBUILD_BIN=$(MXENV_PATH)sphinx-autobuild +SPHINX_BIN=sphinx-build +SPHINX_AUTOBUILD_BIN=sphinx-autobuild DOCS_TARGET:=$(SENTINEL_FOLDER)/sphinx.sentinel $(DOCS_TARGET): $(MXENV_TARGET) diff --git a/src/mxmake/topics/i18n/lingua.mk b/src/mxmake/topics/i18n/lingua.mk index 94266fa..99b614f 100644 --- a/src/mxmake/topics/i18n/lingua.mk +++ b/src/mxmake/topics/i18n/lingua.mk @@ -33,7 +33,7 @@ $(LINGUA_TARGET): $(MXENV_TARGET) PHONY: lingua-extract lingua-extract: $(LINGUA_TARGET) @echo "Extract messages" - @$(MXENV_PATH)pot-create \ + @pot-create \ "$(LINGUA_SEARCH_PATH)" \ -o "$(GETTEXT_LOCALES_PATH)/$(GETTEXT_DOMAIN).pot" diff --git a/src/mxmake/topics/js/karma.mk b/src/mxmake/topics/js/karma.mk index 7c22a84..4a519d5 100644 --- a/src/mxmake/topics/js/karma.mk +++ b/src/mxmake/topics/js/karma.mk @@ -27,4 +27,4 @@ NPM_DEV_PACKAGES+=\ .PHONY: karma karma: $(NPM_TARGET) - @$(NPM_PREFIX)/node_modules/.bin/karma start $(KARMA_CONFIG) $(KARMA_OPTIONS) + @karma start $(KARMA_CONFIG) $(KARMA_OPTIONS) diff --git a/src/mxmake/topics/js/npm.mk b/src/mxmake/topics/js/npm.mk index 7873ba9..4b858aa 100644 --- a/src/mxmake/topics/js/npm.mk +++ b/src/mxmake/topics/js/npm.mk @@ -41,6 +41,8 @@ # npm ############################################################################## +export PATH:=$(shell pwd)/$(NPM_PREFIX)/node_modules/.bin/:$(PATH) + # case `system.dependencies` domain is included SYSTEM_DEPENDENCIES+=npm diff --git a/src/mxmake/topics/js/rollup.mk b/src/mxmake/topics/js/rollup.mk index 282af89..c3c163e 100644 --- a/src/mxmake/topics/js/rollup.mk +++ b/src/mxmake/topics/js/rollup.mk @@ -22,4 +22,4 @@ NPM_DEV_PACKAGES+=\ .PHONY: rollup rollup: $(NPM_TARGET) - @$(NPM_PREFIX)/node_modules/.bin/rollup --config $(ROLLUP_CONFIG) + @rollup --config $(ROLLUP_CONFIG) diff --git a/src/mxmake/topics/js/scss.mk b/src/mxmake/topics/js/scss.mk index 3f0b444..31c269f 100644 --- a/src/mxmake/topics/js/scss.mk +++ b/src/mxmake/topics/js/scss.mk @@ -31,7 +31,5 @@ NPM_DEV_PACKAGES+=sass .PHONY: scss scss: $(NPM_TARGET) - @$(NPM_PREFIX)/node_modules/.bin/sass \ - $(SCSS_OPTIONS) $(SCSS_SOURCE) $(SCSS_TARGET) - @$(NPM_PREFIX)/node_modules/.bin/sass \ - $(SCSS_OPTIONS) --style compressed $(SCSS_SOURCE) $(SCSS_MIN_TARGET) + @sass $(SCSS_OPTIONS) $(SCSS_SOURCE) $(SCSS_TARGET) + @sass $(SCSS_OPTIONS) --style compressed $(SCSS_SOURCE) $(SCSS_MIN_TARGET) diff --git a/src/mxmake/topics/js/wtr.mk b/src/mxmake/topics/js/wtr.mk index 3ef1281..8f00403 100644 --- a/src/mxmake/topics/js/wtr.mk +++ b/src/mxmake/topics/js/wtr.mk @@ -25,4 +25,4 @@ NPM_DEV_PACKAGES+=\ .PHONY: wtr wtr: $(NPM_TARGET) - @$(NPM_PREFIX)/node_modules/.bin/web-test-runner $(WTR_OPTIONS) --config $(WTR_CONFIG) + @web-test-runner $(WTR_OPTIONS) --config $(WTR_CONFIG) diff --git a/src/mxmake/topics/qa/black.mk b/src/mxmake/topics/qa/black.mk index e6066a9..ce2c363 100644 --- a/src/mxmake/topics/qa/black.mk +++ b/src/mxmake/topics/qa/black.mk @@ -29,12 +29,12 @@ $(BLACK_TARGET): $(MXENV_TARGET) .PHONY: black-check black-check: $(BLACK_TARGET) @echo "Run black checks" - @$(MXENV_PATH)black --check $(BLACK_SRC) + @black --check $(BLACK_SRC) .PHONY: black-format black-format: $(BLACK_TARGET) @echo "Run black format" - @$(MXENV_PATH)black $(BLACK_SRC) + @black $(BLACK_SRC) .PHONY: black-dirty black-dirty: diff --git a/src/mxmake/topics/qa/isort.mk b/src/mxmake/topics/qa/isort.mk index 26ab8a8..5d4fe50 100644 --- a/src/mxmake/topics/qa/isort.mk +++ b/src/mxmake/topics/qa/isort.mk @@ -29,12 +29,12 @@ $(ISORT_TARGET): $(MXENV_TARGET) .PHONY: isort-check isort-check: $(ISORT_TARGET) @echo "Run isort check" - @$(MXENV_PATH)isort --check $(ISORT_SRC) + @isort --check $(ISORT_SRC) .PHONY: isort-format isort-format: $(ISORT_TARGET) @echo "Run isort format" - @$(MXENV_PATH)isort $(ISORT_SRC) + @isort $(ISORT_SRC) .PHONY: isort-dirty isort-dirty: diff --git a/src/mxmake/topics/qa/mypy.mk b/src/mxmake/topics/qa/mypy.mk index 9394768..dcc313d 100644 --- a/src/mxmake/topics/qa/mypy.mk +++ b/src/mxmake/topics/qa/mypy.mk @@ -33,7 +33,7 @@ $(MYPY_TARGET): $(MXENV_TARGET) .PHONY: mypy mypy: $(PACKAGES_TARGET) $(MYPY_TARGET) @echo "Run mypy" - @$(MXENV_PATH)mypy $(MYPY_SRC) + @mypy $(MYPY_SRC) .PHONY: mypy-dirty mypy-dirty: diff --git a/src/mxmake/topics/qa/pyupgrade.mk b/src/mxmake/topics/qa/pyupgrade.mk index a7d99ac..eb98ad5 100644 --- a/src/mxmake/topics/qa/pyupgrade.mk +++ b/src/mxmake/topics/qa/pyupgrade.mk @@ -33,7 +33,7 @@ $(PYUPGRADE_TARGET): $(MXENV_TARGET) .PHONY: pyupgrade-format pyupgrade-format: $(PYUPGRADE_TARGET) @echo "Run pyupgrade format in: $(PYUPGRADE_SRC)" - @find $(PYUPGRADE_SRC) -name '*.py' -exec $(MXENV_PATH)pyupgrade $(PYUPGRADE_PARAMETERS) {} + + @find $(PYUPGRADE_SRC) -name '*.py' -exec pyupgrade $(PYUPGRADE_PARAMETERS) {} + .PHONY: pyupgrade-dirty pyupgrade-dirty: diff --git a/src/mxmake/topics/qa/ruff.mk b/src/mxmake/topics/qa/ruff.mk index b7dec4b..7842aae 100644 --- a/src/mxmake/topics/qa/ruff.mk +++ b/src/mxmake/topics/qa/ruff.mk @@ -29,12 +29,12 @@ $(RUFF_TARGET): $(MXENV_TARGET) .PHONY: ruff-check ruff-check: $(RUFF_TARGET) @echo "Run ruff check" - @$(MXENV_PATH)ruff check $(RUFF_SRC) + @ruff check $(RUFF_SRC) .PHONY: ruff-format ruff-format: $(RUFF_TARGET) @echo "Run ruff format" - @$(MXENV_PATH)ruff format $(RUFF_SRC) + @ruff format $(RUFF_SRC) .PHONY: ruff-dirty ruff-dirty: diff --git a/src/mxmake/topics/qa/zpretty.mk b/src/mxmake/topics/qa/zpretty.mk index 22b4ca2..0eb8c52 100644 --- a/src/mxmake/topics/qa/zpretty.mk +++ b/src/mxmake/topics/qa/zpretty.mk @@ -29,12 +29,12 @@ $(ZPRETTY_TARGET): $(MXENV_TARGET) .PHONY: zpretty-check zpretty-check: $(ZPRETTY_TARGET) @echo "Run zpretty check in: $(ZPRETTY_SRC)" - @find $(ZPRETTY_SRC) -name '*.zcml' -or -name '*.xml' -exec $(MXENV_PATH)zpretty --check {} + + @find $(ZPRETTY_SRC) -name '*.zcml' -or -name '*.xml' -exec zpretty --check {} + .PHONY: zpretty-format zpretty-format: $(ZPRETTY_TARGET) @echo "Run zpretty format in: $(ZPRETTY_SRC)" - @find $(ZPRETTY_SRC) -name '*.zcml' -or -name '*.xml' -exec $(MXENV_PATH)zpretty -i {} + + @find $(ZPRETTY_SRC) -name '*.zcml' -or -name '*.xml' -exec zpretty -i {} + .PHONY: zpretty-dirty zpretty-dirty: diff --git a/src/mxmake/utils.py b/src/mxmake/utils.py index 1dcbb43..c10ac34 100644 --- a/src/mxmake/utils.py +++ b/src/mxmake/utils.py @@ -5,14 +5,6 @@ NAMESPACE = "mxmake-" -def mxenv_path() -> str: - """MX environment path.""" - path = os.environ.get("MXMAKE_MXENV_PATH", os.path.join("venv", "bin")) - if path and not path.endswith(os.path.sep): - path = f"{path}{os.path.sep}" - return path - - def mxmake_files() -> str: """Target folder for mxmake related file generation.""" return os.environ.get("MXMAKE_FILES", os.path.join(".mxmake", "files"))