-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
65 lines (54 loc) · 1.67 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
55
56
57
58
59
60
61
62
63
64
.PHONY: setup build install-build uninstall-build publish clean test lint
# Setup Constants
POETRY_VERSION = 1.0.10
PYTHON_DATASTRUCTURES_VERSION = 0.1.3
# Set up environment and install dependencies
setup:
make clean
@echo Install Poetry Version $(POETRY_VERSION)
[ -f ./poetry.lock ] && rm -r poetry.lock || echo lock file not found
pip install --upgrade --force-reinstall 'poetry==$(POETRY_VERSION)'
@echo 🧰 Installing Dependencies
poetry install
# build datastructure package localy
build:
@echo 🏗️ Initializing New Build
make -k clean
make test
make validate
make lint
@echo 🔧 Building Packages
poetry build
# install built package globaly on your computer with pip
install-build:
@echo 💿 Install build
pip install dist/*.tar.gz
# uninstall built package globaly on your computer with pip
uninstall-build:
@echo 💿 UnInstall build
pip uninstall python-datastructures
# check if package properly imports
validate:
@echo ✅ validate package
poetry run python -c 'import python_datastructures; print(python_datastructures.__package__ + " successfully imported")'
# publish to pypi
publish:
@echo ✈️ Publish build to Pypi
poetry publish
clean:
@echo 🧹 cleanup
rm -r ./dist/ || echo dir file not found
# run unit tests
test:
@echo 🧪 Running Tests
poetry run pytest tests/
@echo 🧪 Type Checks with MyPy
poetry run mypy python_datastructures/
# format code
lint:
@echo ♻️ Reformatting Code
poetry run black .
@echo ✅ Style Checks with MyPy
#poetry run pylint ./python_datastructures/*.py
@echo 📕 Generate Documentation
poetry run pdoc --html --config show_source_code=False --output-dir docs python_datastructures/ --force