Skip to content

Commit 0fd7484

Browse files
committed
Makefile update for python poetry
1 parent 0551946 commit 0fd7484

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

Makefile

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
#
2-
#
3-
#
1+
_targets := setup python-version pyenv-info test cover lint run clean
2+
.PHONY: help $(_targets)
3+
.DEFAULT_GOAL := help
44

5-
all:
6-
echo No default target - try ve, test, lint, run
7-
false
5+
version-python: ## Echos the version of Python in use
6+
python --version
87

8+
help:
9+
@echo Targets: $(_targets)
10+
@false
911

10-
# FIXME:
11-
# - depends on python > 3.6 (bad news for RHEL7 /and/ RHEL8)
12-
# - Add a check for correct version and fail fast
12+
setup:
13+
poetry install
1314

14-
ve: ve/pyvenv.cfg
15-
ve/pyvenv.cfg: requirements.txt
16-
python3 -m venv ve
17-
. ve/bin/activate; pip install -r requirements.txt
15+
python-version:
16+
@which python
17+
@python --version
1818

19-
test: ve
20-
. ve/bin/activate; pytest
19+
pyenv-info: setup
20+
poetry env info
2121

22-
cover: ve
23-
. ve/bin/activate; pytest \
22+
test: setup
23+
poetry run pytest
24+
25+
cover: setup
26+
poetry run pytest \
2427
--cov=pyth_observer \
2528
--cov-report=html \
2629
--cov-report=term
2730

28-
lint: lint.python
29-
#lint: lint.yaml - argh, RHEL is too old to do this by default
31+
lint: setup lint.python lint.yaml
3032

3133
lint.python:
3234
poetry run isort pyth_observer/
@@ -37,8 +39,9 @@ lint.python:
3739
lint.yaml:
3840
yamllint .
3941

40-
run: ve
41-
. ve/bin/activate; python3 ./observer.py -l debug --network devnet
42+
run: setup
43+
poetry run pyth-observer -l debug --network devnet
4244

4345
clean:
44-
rm -rf ve htmlcov
46+
poetry env remove --all
47+
rm -rf htmlcov

0 commit comments

Comments
 (0)