Skip to content

Commit 46c6ad8

Browse files
authored
Merge pull request #1 from pritam001/v1
Base structure and requirements handling
2 parents d9386c6 + e002ddb commit 46c6ad8

22 files changed

+338
-3
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FLASK_ENV=development
2+
ENV_FOR_DYNACONF=development

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ instance/
6969
.scrapy
7070

7171
# Sphinx documentation
72-
docs/_build/
72+
documentation/_build/
7373

7474
# PyBuilder
7575
target/
@@ -127,3 +127,10 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
# Intellij
132+
.idea/
133+
*.iml
134+
135+
# MacOS
136+
DS_Store

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1-
# pyflask-base
2-
An opinionated basic flask project structure for ideal development
1+
pyflask-microservice-base
2+
------------------------------------------------------------------------------
3+
An "optionally opinionated and structured" flask boilerplate microservice for ideal development
4+
5+
![WIP](https://img.shields.io/badge/%20%F0%9F%9A%A7%20-Work%20in%20progress-important)
6+
7+
Usage Guide
8+
------------------------------------------------------------------------------
9+
This is a template project hosted on GitHub which can be used to create new repositories.
10+
11+
![GitHub Guide: Creating a repository from a template](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template)
12+
13+

base_constructor.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Welcome to pyflask base constructor"
4+
5+
# Check for venv, conda else exit
6+
7+
echo "Installing pip-tools . . ."
8+
pip install pip-tools
9+
10+
echo "Generating requirements"
11+
pip-compile --output-file=requirements/requirements.txt requirements/requirements.in
12+
13+
echo "Generating dev requirements"
14+
pip-compile --output-file=requirements/dev-requirements.txt requirements/dev-requirements.in
15+
16+
echo "Installing requirements"
17+
pip install -r requirements/requirements.txt
18+
19+
echo "Installing dev requirements"
20+
pip install -r requirements/dev-requirements.txt

documentation/conda.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Conda documentation
2+
3+
### 1. Install Pip
4+
### 2. Install Anaconda
5+
##### Linux
6+
`wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh`
7+
8+
`bash ./Miniconda3-latest-Linux-x86_64.sh`
9+
10+
##### MacOS
11+
`brew cask install anaconda`
12+
13+
`export PATH="/usr/local/anaconda3/bin:$PATH"`
14+
15+
##### Create conda virtual env
16+
`conda create -n pyflask-base python=3.8`
17+
18+
```
19+
#
20+
# To activate this environment, use
21+
#
22+
# $ conda activate pyflask-base
23+
#
24+
# To deactivate an active environment, use
25+
#
26+
# $ conda deactivate
27+
```
28+
29+
##### Run conda virtual env
30+
`conda activate pyflask-base`
31+
32+

documentation/flask.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Introduction to Flask
2+
3+
Flask [Homepage](https://flask.palletsprojects.com/en/1.1.x/)
4+
5+
# Tutorial
6+
7+
Follow [The Flask Mega-Tutorial Part I: Hello, World!](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world)

requirements/dev-requirements.in

Whitespace-only changes.

requirements/dev-requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --output-file=requirements/dev-requirements.txt requirements/dev-requirements.in
6+
#

requirements/requirements.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Flask
2+
dynaconf
3+
flask_apispec
4+
flask_cors

requirements/requirements.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --output-file=requirements/requirements.txt requirements/requirements.in
6+
#
7+
apispec==3.3.1 # via flask-apispec
8+
click==7.1.2 # via flask
9+
dynaconf==3.0.0 # via -r requirements/requirements.in
10+
flask-apispec==0.9.0 # via -r requirements/requirements.in
11+
flask-cors==3.0.8 # via -r requirements/requirements.in
12+
flask==1.1.2 # via -r requirements/requirements.in, flask-apispec, flask-cors
13+
itsdangerous==1.1.0 # via flask
14+
jinja2==2.11.2 # via flask
15+
markupsafe==1.1.1 # via jinja2
16+
marshmallow==3.7.1 # via flask-apispec, webargs
17+
six==1.15.0 # via flask-apispec, flask-cors
18+
webargs==5.5.3 # via flask-apispec
19+
werkzeug==1.0.1 # via flask

0 commit comments

Comments
 (0)