Skip to content

Commit

Permalink
Update Python version; update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbirchard committed Aug 28, 2023
1 parent 47974b6 commit a03a96d
Show file tree
Hide file tree
Showing 8 changed files with 318 additions and 307 deletions.
File renamed without changes
34 changes: 10 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,36 @@ export HELP

.PHONY: run install deploy update format lint clean help


all help:
@echo "$$HELP"


env: $(VIRTUAL_ENV)


$(VIRTUAL_ENV):
if [ ! -d $(VIRTUAL_ENV) ]; then \
echo "Creating Python virtual env in \`${VIRTUAL_ENV}\`"; \
python3 -m venv $(VIRTUAL_ENV); \
fi

.PHONY: dev
dev: env
$(LOCAL_PYTHON) -m main --reload

.PHONY: run
run: env
uwsgi --http 127.0.0.1:8081 --master --module wsgi:app --processes 4 --threads 2

$(LOCAL_PYTHON) -m main

.PHONY: install
install: env
$(LOCAL_PYTHON) -m pip install --upgrade pip setuptools wheel && \
$(LOCAL_PYTHON) -m pip install --no-cache-dir uwsgi && \
$(LOCAL_PYTHON) -m pip install -r requirements.txt && \
echo Installed dependencies in \`${VIRTUAL_ENV}\`;


.PHONY: deploy
deploy:
make install
make install && \
make run


.PHONY: test
test: env
$(LOCAL_PYTHON) -m \
Expand All @@ -61,21 +57,18 @@ test: env
coverage html --title='Coverage Report' -d .reports && \
open .reports/index.html


.PHONY: update
update: env
$(LOCAL_PYTHON) -m pip install --upgrade pip setuptools wheel && \
poetry update && \
poetry export -f requirements.txt --output requirements.txt --without-hashes && \
echo Installed dependencies in \`${VIRTUAL_ENV}\`;


.PHONY: format
format: env
$(LOCAL_PYTHON) -m isort --multi-line=3 .
$(LOCAL_PYTHON) -m isort --multi-line=3 . && \
$(LOCAL_PYTHON) -m black .


.PHONY: lint
lint: env
$(LOCAL_PYTHON) -m flake8 . --count \
Expand All @@ -84,22 +77,15 @@ lint: env
--show-source \
--statistics


.PHONY: clean
clean:
find . -name 'poetry.lock' -delete && \
find . -name '.coverage' -delete && \
find . -name '*.pyc' -delete \
find . -name '__pycache__' -delete \
find . -name 'poetry.lock' -delete \
find . -name '*.log' -delete \
find . -name '.DS_Store' -delete \
find . -name '.Pipfile.lock' -delete && \
find . -wholename '**/*.pyc' -delete && \
find . -wholename '*.html' -delete && \
find . -type d -wholename '__pycache__' -exec rm -rf {} + && \
find . -type d -wholename '.venv' -exec rm -rf {} + && \
find . -type d -wholename './.venv' -exec rm -rf {} + && \
find . -type d -wholename '.pytest_cache' -exec rm -rf {} + && \
find . -type d -wholename '**/.pytest_cache' -exec rm -rf {} + && \
find . -type d -wholename './logs/*' -exec rm -rf {} + && \
find . -type d -wholename './.reports/*' -exec rm -rf {} + && \
find . -type d -wholename '**/.webassets-cache' -exec rm -rf {} +
find . -type d -wholename './logs/*.log' -exec rm -rf {} + && \
find . -type d -wholename './.reports/*' -exec rm -rf {} +
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Flask Blueprint Tutorial

![Python](https://img.shields.io/badge/Python-v^3.9-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
![Python](https://img.shields.io/badge/Python-v^3.10-blue.svg?logo=python&longCache=true&logoColor=white&colorB=5e81ac&style=flat-square&colorA=4c566a)
![Flask](https://img.shields.io/badge/Flask-v2.2.2-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)
[![GitHub Stars](https://img.shields.io/github/stars/hackersandslackers/flask-blueprint-tutorial.svg?style=flat-square&colorA=4c566a&logo=GitHub&colorB=ebcb8b)](https://github.com/hackersandslackers/flask-blueprint-tutorial/stargazers)
[![GitHub Forks](https://img.shields.io/github/forks/hackersandslackers/flask-blueprint-tutorial.svg?style=flat-square&colorA=4c566a&logo=GitHub&colorB=ebcb8b)](https://github.com/hackersandslackers/flask-blueprint-tutorial/network)

![Flask Blueprint Tutorial](./.github/[email protected]?raw=true)
![Flask Blueprint Tutorial](./.github/img/[email protected]?raw=true)

Structure your Flask apps in a scalable and intelligent way using Blueprints.

* **Tutorial**: https://hackersandslackers.com/flask-blueprints/
* **Demo**: https://flaskblueprints.hackersandslackers.app/
* **Tutorial**: [https://hackersandslackers.com/flask-blueprints/](https://hackersandslackers.com/flask-blueprints/)
* **Demo**: [https://flaskblueprints.hackersandslackers.app/](https://flaskblueprints.hackersandslackers.app/)

## Getting Started

Expand All @@ -35,12 +35,12 @@ Replace the values in **.env.example** with your values and rename this file to

### Installation

Get up and running with `make deploy`:
Get up and running with `make run`:

```shell
git clone https://github.com/hackersandslackers/flask-blueprint-tutorial.git
cd flask-blueprint-tutorial
make deploy
make run
```

-----
Expand Down
4 changes: 2 additions & 2 deletions wsgi.py → main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

app = init_app()

if __name__ == "__wsgi__":
app.run(host="127.0.0.1")
if __name__ == "__main__":
app.run(host="127.0.0.1", port=6416, debug=True)
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[mypy]
python_version = 3.9
python_version = 3.10
warn_return_any = True
warn_unused_configs = True
Loading

0 comments on commit a03a96d

Please sign in to comment.