File tree 5 files changed +95
-29
lines changed
5 files changed +95
-29
lines changed Original file line number Diff line number Diff line change
1
+ SRCPATH := $(CURDIR )
2
+ PROJECTNAME := $(shell basename $(CURDIR ) )
3
+
4
+ define HELP
5
+ Manage $(PROJECTNAME ) . Usage:
6
+
7
+ make run - Run $(PROJECTNAME ) .
8
+ make deploy - Install requirements and run app for the first time.
9
+ make update - Update pip dependencies via Python Poetry.
10
+ make format - Format code with Python's `Black` library.
11
+ make clean - Remove cached files and lock files.
12
+ endef
13
+ export HELP
14
+
15
+ .PHONY : run deploy update format clean help
16
+
17
+
18
+ requirements : .requirements.txt
19
+
20
+
21
+ .requirements.txt : requirements.txt
22
+ $(shell . .venv/bin/activate && pip install -r requirements.txt)
23
+
24
+
25
+ all help :
26
+ @echo " $$ HELP"
27
+
28
+
29
+ .PHONY : run
30
+ run :
31
+ $(shell . .venv/bin/activate && python3 wsgi.py)
32
+
33
+
34
+ .PHONY : deploy
35
+ deploy :
36
+ $(shell . ./deploy.sh)
37
+
38
+
39
+ .PHONY : update
40
+ update :
41
+ poetry shell && poetry update
42
+ pip freeze > requirements.txt
43
+ exit
44
+
45
+
46
+ .PHONY : format
47
+ format : requirements
48
+ $(shell . .venv/bin/activate)
49
+ $(shell isort -rc ./)
50
+ $(shell black ./)
51
+
52
+
53
+ .PHONY : clean
54
+ clean :
55
+ find . -name ' *.pyc' -delete
56
+ find . -name ' __pycache__' -delete
57
+ find . -name ' poetry.lock' -delete
58
+ find . -name ' Pipefile.lock' -delete
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ -d " .venv" ]
4
+ then
5
+ source .venv/bin/activate
6
+ pip install -r requirements.txt
7
+ python3 wsgi.py
8
+ else
9
+ python3 -m venv .venv
10
+ source .venv/bin/activate
11
+ python3 -m pip install --upgrade pip
12
+ pip install -r requirements.txt
13
+ python3 wsgi.py
14
+ fi
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def compile_static_assets(assets):
27
27
assets .register ('main_styles' , main_style_bundle )
28
28
assets .register ('main_js' , main_js_bundle )
29
29
assets .register ('admin_styles' , admin_style_bundle )
30
- if app .config ['FLASK_ENV' ] == 'development ' :
30
+ if app .config ['FLASK_ENV' ] != 'production ' :
31
31
main_style_bundle .build ()
32
32
main_js_bundle .build ()
33
33
admin_style_bundle .build ()
Original file line number Diff line number Diff line change
1
+ attrs == 20.2.0
1
2
click == 7.1.2
2
3
cssmin == 0.2.0
3
4
Flask == 1.1.2
4
5
Flask-Assets == 2.0
6
+ iniconfig == 1.1.1
5
7
itsdangerous == 1.1.0
6
8
Jinja2 == 2.11.2
7
9
jsmin == 2.2.2
8
10
lesscpy == 0.14.0
9
11
MarkupSafe == 1.1.1
12
+ packaging == 20.4
13
+ pluggy == 0.13.1
10
14
ply == 3.11
15
+ py == 1.9.0
16
+ pyparsing == 2.4.7
17
+ pytest == 6.1.1
11
18
python-dotenv == 0.14.0
12
19
six == 1.15.0
20
+ toml == 0.10.1
13
21
webassets == 2.0
14
22
Werkzeug == 1.0.1
You can’t perform that action at this time.
0 commit comments