Note
- Read TEMPLATE.md and update github settings like it explains.
- Update this readme/delete this note.
- To use this template, select 'Use this template' option and create a new repository from it.
test2
Write something useful about the app/script you are making, what it does/solves.
- todo 1
- todo 2
- todo 3
- See gitops repo for link to deployment/vault etc
- See
pyproject.toml
for contact info/open api tag info - See
action_config.toml
for gitops/docker config
Common:
Test:
Prod:
This project uses protected main branch. So all updates have to go through pull request.
This project also forces Squash merge
, so all your commits in a branch will only be 1 commit on main, so please try and stick to 1 fix or feature per pull request if possible.
All pull request will need to start with fix/feat/chore, and you need to label it with a release label. We also run pylint and a few other checks on you code.
If you use vscode
then go under under extension tab, search @recommended
and install them
- Create virtual environment:
python -m venv ./venv
- Activate virtual environment:
./venv/Scripts/activate
- Install dependencies:
pip install -r requirements.txt
- Add
.env
file (see own section) - Start application:
python ./src/main.py
- ... open webpage ?
Install vscode extension ms-vscode-remote.remote-containers
- click bottom left corner
Open a Remote Window
, looks like 2 arrows - select
repository
- select
Open Repository from github
. - sign inn if needed
- search for
python-app-template
and open it - when its loaded, click button left corner again
- now select
Continue Working in Container Volume
Next time only run
- Activate virtual environment:
./venv/Scripts/activate
- Start application:
python ./src/main.py
- ...open web page ?
If you are not able to debug, do this:
- use keys SHIFT + CONTROL + P
- select
Python: Select interpreter
- then select
venv
(you might need restart..)
Now be able to start debug of main.py
If you add new dependencies remember to update requirements.txt
Option 1:(will add all in virtual env)
pip freeze > requirements.txt
Option 2: (only whats needed)
pip install pipreqs
pipreqs ./ --force
ofc, you need to run you application to make sure after..
This is how you can run local linting if needed.
pip install ruff black isort
ruff ./src --fix
isort .
black ./src --config pyproject.toml
You should run this before you do any pull request, and make sure you score 10 of 10
- add
.env
file
Add important:
ENV_VARIABLE_01="Fill out something..."
There is more you can use, but project is setup with correct defaults, to save time.
# DATABASE
ENV_VARIABLE_02="hello2" # default: something
# AZURE
ENV_VARIABLE_02="hello2" # default: something
# SOMETHING ELSE
ENV_VARIABLE_03="hello3" # default: something