-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (81 loc) · 2.86 KB
/
Copy pathMakefile
File metadata and controls
93 lines (81 loc) · 2.86 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SHELL := /bin/bash
all:
@echo "There's no default Makefile target right now. Try:"
@echo ""
@echo "make clean - reset the project and remove auto-generated assets."
@echo "make tidy - tidy up the code with the 'black' formatter."
@echo "make lint - check the code for obvious errors with flake8."
@echo "make lint-all - check all code for obvious errors with flake8."
@echo "make serve - serve the project at: http://0.0.0.0:8000/"
@echo "make widgets - generate the JSON definition of available widgets."
@echo "make test - while serving the app, run the test suite in browser."
@echo "make dist - build the module as a package."
@echo "make publish-test - upload the package to the PyPI test instance."
@echo "make publish-live - upload the package to the PyPI LIVE instance."
@echo "make package - create an archive of the framework and test suite."
clean:
rm -rf .pytest_cache
rm -rf dist
rm -rf invent.tar.gz
rm -rf invent.min.tar.gz
rm -rf test_suite.tar.gz
rm -rf static/*.tar.gz
rm -rf static/*.zip
rm -rf static/*.css
rm -rf site
rm -rf temp
rm -rf test_suite
find . | grep -E "(__pycache__)" | xargs rm -rf
tidy:
black -l 79 examples src/invent tests utils
lint:
flake8 --extend-ignore=E203,E701 src/invent/*
lint-all:
flake8 --extend-ignore=E203,E701 src/invent tests/*
serve: clean tidy package minify
python utils/serve.py
test:
python -m webbrowser http://localhost:8000/index.html
dist: clean
@echo "Packaging module..."
python -m pip install --upgrade build
python -m build
publish-test: dist
@echo "Packaging complete... Uploading to TEST instance of PyPi..."
python3 -m pip install --upgrade twine
python3 -m twine upload --repository test --sign dist/*
publish-live: dist
@echo "Packaging complete... Uploading to LIVE instance of PyPi..."
python3 -m pip install --upgrade twine
python3 -m twine upload --sign dist/*
package:
cd src && tar --no-xattrs -czvf ../invent.tar.gz invent/*
cd src && zip -r ../invent.zip invent
mkdir test_suite
cp -r src/invent test_suite
cp -r tests test_suite
cd test_suite && tar --no-xattrs -czvf ../test_suite.tar.gz tests/* invent/*
cd test_suite && zip -r ../test_suite.zip tests invent
rm -rf test_suite
cp invent.tar.gz static/
cp test_suite.tar.gz static/
cp invent.zip static/
cp test_suite.zip static/
rm invent.tar.gz
rm test_suite.tar.gz
rm invent.zip
rm test_suite.zip
minify:
mkdir -p temp/invent
cp -r src/invent/* temp/invent/
cp src/invent/themes/default.css static/default.css
python -m rcssmin <src/invent/themes/default.css > temp/invent/themes/default.css
cp temp/invent/themes/default.css static/default.min.css
pyminify -i --remove-literal-statements temp/invent/
cd temp && tar --no-xattrs -czvf ../invent.min.tar.gz invent
cd temp && zip -r ../invent.min.zip invent
cp invent.min.tar.gz static/
cp invent.min.zip static/
rm invent.min.tar.gz
rm invent.min.zip
rm -rf temp/