Skip to content

Commit

Permalink
Update dependencies; Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbirchard committed Apr 24, 2022
1 parent 9f5645f commit d7d2e5a
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 289 deletions.
40 changes: 27 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,39 @@ VIRTUAL_ENVIRONMENT := $(CURDIR)/.venv
LOCAL_PYTHON := $(VIRTUAL_ENVIRONMENT)/bin/python3

define HELP
Manage $(PROJECTNAME). Usage:
Manage $(PROJECT_NAME). Usage:

make run - Run $(PROJECT_NAME).
make install - Create virtual env, & install dependencies.
make update - Update pip dependencies via Poetry and output requirements.txt.
make format - Format code with Python's `Black` library.
make lint - Check code formatting with flake8.
make install - Create virtual env, install dependencies, and run project.
make deploy - Install and run script by running `make install` and `make run` in succession.
make update - Update pip dependencies via Poetry and export output to requirements.txt.
make format - Format code with Pythons `Black` library.
make lint - Check code formatting with `flake8`.
make clean - Remove cached files and lock files.

endef
export HELP

.PHONY: run install update format lint clean help

.PHONY: run install deploy update format lint clean help

requirements: .requirements.txt
env: ./.venv/bin/activate


env: .venv/bin/python3
.requirements.txt: requirements.txt
$(shell . .venv/bin/activate && pip install -r requirements.txt)


all help:
@echo "$$HELP"


.PHONY: run
run: env
flask run


.PHONY: install
install:
if [ ! -d "./.venv" ]; then python3 -m venv $(VIRTUAL_ENVIRONMENT); fi
Expand All @@ -32,9 +44,10 @@ install:
$(LOCAL_PYTHON) -m pip install -r requirements.txt


.PHONY: run
run: env
$(shell . .venv/bin/activate && flask run)
.PHONY: deploy
deploy:
make install
make run


.PHONY: update
Expand Down Expand Up @@ -65,11 +78,12 @@ clean:
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
find . -name 'poetry.lock' -delete
find . -name 'Pipefile.lock' -delete
find . -name '*.log' -delete
find . -name '.DS_Store' -delete
find . -wholename 'logs/*.json' -delete
find . -wholename '.pytest_cache' -delete
find . -wholename '**/.pytest_cache' -delete
find . -wholename './logs/*.json' -delete
find . -wholename '**/.webassets-cache/' -delete
find . -wholename './logs' -delete
find . -wholename './logs' -delete
find . -wholename '*.html' -delete
find . -wholename '**/.webassets-cache' -delete
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Flask Blueprint Tutorial

![Python](https://img.shields.io/badge/Python-v^3.8-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
![Flask](https://img.shields.io/badge/Flask-v1.1.2-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
![Flask](https://img.shields.io/badge/Flask-v2.1.1-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
![Flask-Assets](https://img.shields.io/badge/Flask--Assets-v2.0-blue.svg?longCache=true&logo=flask&style=flat-square&logoColor=white&colorB=5e81ac&colorA=4c566a)
![GitHub Last Commit](https://img.shields.io/github/last-commit/google/skia.svg?style=flat-square&colorA=4c566a&colorB=a3be8c&logo=GitHub)
[![GitHub Issues](https://img.shields.io/github/issues/hackersandslackers/flask-blueprint-tutorial.svg?style=flat-square&colorA=4c566a&logo=GitHub&colorB=ebcb8b)](https://github.com/hackersandslackers/flask-blueprint-tutorial/issues)
Expand Down
4 changes: 0 additions & 4 deletions flask_blueprint_tutorial/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
"""Initialize Flask app."""
from ddtrace import patch_all
from flask import Flask
from flask_assets import Environment

from config import Config

if Config.FLASK_ENV == "production" and Config.DD_SERVICE:
patch_all()


def init_app():
"""Create Flask application."""
Expand Down
Loading

0 comments on commit d7d2e5a

Please sign in to comment.