diff --git a/.gitignore b/.gitignore index a807f4e..f3709c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ src/__pycache__/ +_build/ NewLang diff --git a/Makefile b/Makefile index 21f2ad1..c07c906 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,27 @@ +SHELL=/bin/bash + build: clean_pycache python3 -m zipapp src -p "/usr/bin/env python3" -c -m "main:main" -o NewLang clean_pycache: test ! -d src/__pycache__ || rm -r src/__pycache__ -clean: clean_pycache +clean: clean_pycache clean_build test ! -e NewLang || rm NewLang + +_build: + mkdir -p _build + +_build/.stamp_venv: _build + python3 -m venv _build/venv + source _build/venv/bin/activate && pip install -r requirements.txt + touch _build/.stamp_venv + +tidy: _build/.stamp_venv + source _build/venv/bin/activate && black src + +clean_build: + rm -rf _build/ + +venv_bash: _build/.stamp_venv + source _build/venv/bin/activate && bash diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7e66a17 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +black