-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathMakefile
73 lines (62 loc) · 1.4 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
65
66
67
68
69
70
71
72
73
# Variables
SOURCE = minet
# Functions
define clean
rm -rf .ruff_cache
rm -rf *.egg-info .pytest_cache build dist
find . -name "*.pyc" | xargs rm -f
find . -name "*.pyo" | xargs rm -f
find . -name __pycache__ | xargs rm -rf
find . -name .ipynb_checkpoints | xargs rm -rf
rm -f *.spec
endef
# Targets
all: lint test
compile: clean pyinstaller
test: unit
publish: clean lint test upload
$(call clean)
clean:
$(call clean)
deps:
pip3 install -U pip
pip3 install -r requirements.txt
lint:
@echo Linting source code...
ruff check $(SOURCE) test
@echo
format:
@echo Formatting source code
ruff format $(SOURCE) ftest hooks scripts test
@echo
ua:
@echo Upgrading internals...
python -m minet.cli ua update
ruff format minet/user_agents/data.py
@echo
readme:
python -m scripts.generate_readme > docs/cli.md
unit:
@echo Running unit tests...
pytest -svvv
@echo
upload:
python setup.py sdist bdist_wheel
twine upload dist/*
pyinstaller: clean
pyinstaller \
--additional-hooks-dir=./hooks \
--name minet \
--clean \
--exclude-module IPython \
--exclude-module ipykernel \
--exclude-module ipywidgets \
--exclude-module jedi \
--exclude-module jupyter \
--exclude-module jupyter_client \
--exclude-module jupyter_core \
--exclude-module jupyter-server \
--exclude-module jupyterlab \
--exclude-module jupyterlab_server \
--exclude-module jupyterlab-widgets \
minet/cli/__main__.py