From 5369ed747ff966fab12b3922273392a429919d96 Mon Sep 17 00:00:00 2001 From: Dominic Ricottone Date: Fri, 20 Dec 2024 15:34:40 -0600 Subject: [PATCH] Minor cleanup --- .gitignore | 4 +--- Makefile | 43 ++++++++++++++++++++----------------------- gap/__main__.py | 2 +- 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index e540304..8a5d4f5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ **/__mypycache__ **/*.pyc tests/generated_syntax/* -build - -# `make build` deletes these but the files can persist if it hits an error +dist *.egg-info diff --git a/Makefile b/Makefile index 2ab0f26..ceef771 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ VERSION=1.0.3 -PY_COMPILE_BIN=python -m py_compile +#INSTALLER=pip +INSTALLER=pipx -#BUILD_BIN=python -m build -BUILD_BIN=pyproject-build +# If using system build module +#BUILDER=python -m build +# If using module installed by pipx +BUILDER=pyproject-build #UNITTEST_FILE_BIN=python -m unittest #UNITTEST_DIR_BIN=python -m unittest discover --top-level-directory . @@ -13,9 +16,6 @@ UNITTEST_DIR_BIN=unittest --color --working-directory . #MYPY_BIN=python -m mypy MYPY_BIN=MYPY_CACHE_DIR=gap/__mypycache__ mypy -#PIPX_BIN=python -m pipx -PIPX_BIN=pipx - .PHONY: clean clean: rm -rf **/__pycache__ **/__mypycache__ **/*.pyc build *.egg-info @@ -36,9 +36,9 @@ TEST_FILES=tests/__init__.py tests/generated_syntax tests/generated_syntax/__ini .PHONY: test test: $(TEST_FILES) - $(PY_COMPILE_BIN) gap/*.py + python -m py_compile gap/*.py $(UNITTEST_DIR_BIN) tests - $(PY_COMPILE_BIN) tests/generated_syntax/*.py + python -m py_compile tests/generated_syntax/*.py $(UNITTEST_FILE_BIN) tests/generated_syntax_tests.py $(MYPY_BIN) -p gap @@ -51,25 +51,22 @@ unittest: $(TEST_FILES) PY_FILES=gap/cli.py gap/generator.py gap/__main__.py gap/toml_parser.py PYBUILD_FILES=pyproject.toml LICENSE.md README.md -build/gap-$(VERSION)-py3-none-any.whl: $(PY_FILES) $(PYBUILD_FILES) - mkdir -p build - $(BUILD_BIN) --wheel --no-isolation --outdir build/ +dist: + mkdir -p dist -.PHONY: build -build: build/gap-$(VERSION)-py3-none-any.whl +dist/gap-$(VERSION)-py3-none-any.whl: dist $(PY_FILES) $(PYBUILD_FILES) + $(BUILDER) --wheel --no-isolation --outdir build/ -.PHONY: reinstall -reinstall: uninstall install +build: dist/gap-$(VERSION)-py3-none-any.whl -.PHONY: install -install: build/gap-$(VERSION)-py3-none-any.whl - $(PIPX_BIN) install build/gap-$(VERSION)-py3-none-any.whl +install: dist/gap-$(VERSION)-py3-none-any.whl + $(INSTALLER) install dist/gap-$(VERSION)-py3-none-any.whl -.PHONY: uninstall uninstall: - $(PIPX_BIN) uninstall gap + $(INSTALLER) uninstall gap -.PHONY: rc -rc: - docker run --interactive --tty --rm --name pytest --mount type=bind,src=$(pwd),dst=/code python:3.11-rc sh +reinstall: + make uninstall + make install +.PHONY: clean build install uninstall reinstall diff --git a/gap/__main__.py b/gap/__main__.py index b979811..13a7455 100644 --- a/gap/__main__.py +++ b/gap/__main__.py @@ -5,7 +5,7 @@ import sys from . import generator from . import cli -VERSION = (1,0,1,) +VERSION = (1,0,3,) def _msg(content, quiet): if not quiet: -- 2.45.2