@@ -6,11 +6,13 @@ SHELL = /bin/bash
66NAME := pydpkg
77PYMAJOR := 3
88PYREV := 10
9- PYPATCH := 0
9+ PYPATCH := 7
1010PYVERSION := ${PYMAJOR}.${PYREV}.${PYPATCH}
1111PYENV := ${HOME}/.pyenv/versions/${PYVERSION}
1212VENV_NAME := ${NAME}-${PYVERSION}
1313VENV := ${PYENV}/envs/${VENV_NAME}
14+ PYTHON_BIN := ${VENV}/bin/python
15+ POETRY_BIN := ${VENV}/bin/poetry
1416EGGLINK := ${VENV}/lib/python${PYMAJOR}.${PYREV}/site-packages/${NAME}.egg-link
1517export VIRTUAL_ENV := ${VENV}
1618export PYENV_VERSION := ${VENV_NAME}
4547endif
4648
4749${PYENV} : ${BREW_SSL} ${BREW_READLINE} ${PYENV_BIN}
48- ${ARCH_PREFIX} pyenv install -s ${PYVERSION}
50+ ${ARCH_PREFIX} ${PYENV_BIN} install -s ${PYVERSION}
4951
5052${VENV} : ${PYENV}
5153 ${ARCH_PREFIX} ${PYENV_BIN} virtualenv ${PYVERSION} ${VENV_NAME}
52- ${ARCH_PREFIX} python -m pip install -U pip setuptools wheel
53- ${ARCH_PREFIX} python -m pip install -U poetry
54- ${ARCH_PREFIX} poetry config virtualenvs.create false --local
55- ${ARCH_PREFIX} poetry config virtualenvs.in-project false --local
54+ ${ARCH_PREFIX} ${PYTHON_BIN} -m pip install -U pip setuptools wheel
55+ ${ARCH_PREFIX} ${PYTHON_BIN} -m pip install -U poetry
56+ ${ARCH_PREFIX} ${POETRY_BIN} config virtualenvs.create false --local
57+ ${ARCH_PREFIX} ${POETRY_BIN} config virtualenvs.in-project false --local
5658
5759.python-version : ${VENV}
58- echo ${VENV_NAME} > .python-version
60+ echo ${PYVERSION} /envs/ ${ VENV_NAME} > .python-version
5961
6062poetry.lock :
61- poetry lock
63+ ${ARCH_PREFIX} ${POETRY_BIN} lock
6264
6365${EGGLINK} : poetry.lock
64- poetry install
66+ ${ARCH_PREFIX} ${POETRY_BIN} install
6567 touch ${EGGLINK}
6668
6769setup : .python-version ${EGGLINK}
@@ -72,41 +74,42 @@ clean:
7274nuke :
7375 git clean -fdx -e ' *.ipynb'
7476 rm -f .python-version
75- pyenv uninstall -f ${VENV_NAME}
77+ ${ARCH_PREFIX} ${PYENV_BIN} uninstall -f ${PYVERSION} /envs/ ${VENV_NAME}
7678
7779update : pyproject.toml
78- poetry install
79- poetry update
80+ ${ARCH_PREFIX} ${POETRY_BIN} lock
81+ ${ARCH_PREFIX} ${POETRY_BIN} install
82+ ${ARCH_PREFIX} ${POETRY_BIN} update
8083
8184format : setup
82- poetry run isort . && poetry run black .
85+ ${ARCH_PREFIX} ${POETRY_BIN} run isort . && poetry run black .
8386
8487format-check : setup
85- poetry run isort --check . && poetry run black --check .
88+ ${ARCH_PREFIX} ${POETRY_BIN} run isort --check . && poetry run black --check .
8689
87- test : black pylint flakehell pycodestyle pytest
90+ test : black pylint flakeheaven pycodestyle pytest
8891 @echo " Running all tests"
8992
9093pytest : setup
9194 @echo " Running unit tests"
92- poetry run pytest -p no:warnings tests
95+ ${ARCH_PREFIX} ${POETRY_BIN} run pytest -p no:warnings tests
9396
9497black : setup
9598 @echo " Checking code formatting and imports..."
96- poetry run black --check .
99+ ${ARCH_PREFIX} ${POETRY_BIN} run black --check .
97100
98101pylint : setup
99102 @echo " Linting code style with pylint..."
100- poetry run pylint -d R0912 -d W0511 ${NAME}
103+ ${ARCH_PREFIX} ${POETRY_BIN} run pylint -d R0912 -d W0511 ${NAME}
101104
102- flakehell : setup
103- @echo " Linting code style with flakehell ..."
104- poetry run flakehell lint ${NAME} test
105+ flakeheaven : setup
106+ @echo " Linting code style with flakeheaven ..."
107+ ${ARCH_PREFIX} ${POETRY_BIN} run flakeheaven lint ${NAME} test
105108
106109pycodestyle : setup
107110 @echo " Linting codestyle with pycodestyle (formerly pep8)"
108111 @# ignore E203 because pep8 and black disagree about whitespace before ':'
109- poetry run pycodestyle --max-line-length=120 --ignore=E203 ${NAME}
112+ ${ARCH_PREFIX} ${POETRY_BIN} run pycodestyle --max-line-length=120 --ignore=E203 ${NAME}
110113
111114install : setup
112115
0 commit comments