-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67fba43
commit 7fdbffa
Showing
5 changed files
with
95 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
SRCPATH := $(CURDIR) | ||
PROJECTNAME := $(shell basename $(CURDIR)) | ||
|
||
define HELP | ||
Manage $(PROJECTNAME). Usage: | ||
|
||
make run - Run $(PROJECTNAME). | ||
make deploy - Install requirements and run app for the first time. | ||
make update - Update pip dependencies via Python Poetry. | ||
make format - Format code with Python's `Black` library. | ||
make clean - Remove cached files and lock files. | ||
endef | ||
export HELP | ||
|
||
.PHONY: run deploy update format clean help | ||
|
||
|
||
requirements: .requirements.txt | ||
|
||
|
||
.requirements.txt: requirements.txt | ||
$(shell . .venv/bin/activate && pip install -r requirements.txt) | ||
|
||
|
||
all help: | ||
@echo "$$HELP" | ||
|
||
|
||
.PHONY: run | ||
run: | ||
$(shell . .venv/bin/activate && python3 wsgi.py) | ||
|
||
|
||
.PHONY: deploy | ||
deploy: | ||
$(shell . ./deploy.sh) | ||
|
||
|
||
.PHONY: update | ||
update: | ||
poetry shell && poetry update | ||
pip freeze > requirements.txt | ||
exit | ||
|
||
|
||
.PHONY: format | ||
format: requirements | ||
$(shell . .venv/bin/activate) | ||
$(shell isort -rc ./) | ||
$(shell black ./) | ||
|
||
|
||
.PHONY: clean | ||
clean: | ||
find . -name '*.pyc' -delete | ||
find . -name '__pycache__' -delete | ||
find . -name 'poetry.lock' -delete | ||
find . -name 'Pipefile.lock' -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
if [ -d ".venv" ] | ||
then | ||
source .venv/bin/activate | ||
pip install -r requirements.txt | ||
python3 wsgi.py | ||
else | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
python3 -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
python3 wsgi.py | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
attrs==20.2.0 | ||
click==7.1.2 | ||
cssmin==0.2.0 | ||
Flask==1.1.2 | ||
Flask-Assets==2.0 | ||
iniconfig==1.1.1 | ||
itsdangerous==1.1.0 | ||
Jinja2==2.11.2 | ||
jsmin==2.2.2 | ||
lesscpy==0.14.0 | ||
MarkupSafe==1.1.1 | ||
packaging==20.4 | ||
pluggy==0.13.1 | ||
ply==3.11 | ||
py==1.9.0 | ||
pyparsing==2.4.7 | ||
pytest==6.1.1 | ||
python-dotenv==0.14.0 | ||
six==1.15.0 | ||
toml==0.10.1 | ||
webassets==2.0 | ||
Werkzeug==1.0.1 |