forked from fediverse-devnet/feditest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (45 loc) · 1.47 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# make venv
# Create a python environment for your platform and install the required dependencies int
# it. It will be in ./venv.$(uname -s)
#
# make build
# run pip install in your venv
#
# make lint
# Run several linters on the code
#
# make test
# Run unit tests
#
# NOTE: This does not add the venv to your $PATH. You have to do that yourself if you want that.
#
UNAME?=$(shell uname -s | tr [A-Z] [a-z])
BRANCH?=$(shell git branch --show-current)
VENV?=venv.$(UNAME).$(BRANCH)
PYTHON?=python3.11
build : venv
$(VENV)/bin/pip install .
venv : $(VENV)
$(VENV) :
@which $(PYTHON) || ( echo 'No executable called "python". Append your python to the make command, like "make PYTHON=your-python"' && false )
$(PYTHON) -mvenv $(VENV)
$(VENV)/bin/pip install ruff mypy pylint
lint : venv
$(VENV)/bin/ruff check src
$(VENV)/bin/mypy src
# $(VENV)/bin/pylint src
test : venv
$(VENV)/bin/pytest -v
release :
@which $(PYTHON) || ( echo 'No executable called "python". Append your python to the make command, like "make PYTHON=your-python"' && false )
[[ -d venv.release ]] && rm -rf venv.release || true
[[ -d dist ]] && rm -rf dist || true
$(PYTHON) -mvenv venv.release
venv.release/bin/pip install twine
venv.release/bin/pip install --upgrade build
venv.release/bin/python -m build
@echo WARNING: YOU ARE NOT DONE YET
@echo The actual push to pypi.org you need to do manually. Enter:
@echo venv.release/bin/twine upload dist/*
.PHONY: venv build lint test release