Template project for new python projects
If you're still not agreed on base development template, suggest to use this one:
- Log in to you account
- Press button to create a new project
- Choose
import project:
- Choose
Repository by URL:
- Enter https://github.com/vvpreo/python-template.git here:

- Fill your project's name and description.
- Press
Create project
- Default branch's name is
dev. So everything you develop by dafault is about to be checked on dev stand. - If you are adding a feature, call branch
f/<feature_name__or__task_id> - If you are fixing a bug, call branch
b/<bug_name__or__task_id> - If you are refactoring, call branch
r/<goal_name__or__task_id>
- Using GIT
- Using python 3.9+
- Using pytest
- Using poetry
- Using virtual environment in
<project_root>/venvfolder.
Feel free to delete folders you are not usign in your project.
srcis where ALL your *.py files located. add packages if necessary.tstis where ALL your tests are located. automated and manual.envsis where ALL *.env files locatedscriptsis where ALL .sh/.bat etc... files locatedruntimeis a place where you write your logs and other stuff generated by you application. It is not intendend to be saved for further usaage.docsis where ALL your documentation located. Recommended to use PUML + c4 modelmigrationsis where ALL your migration scripts reside.
.gitignore. Listed directories and files not for version control..gitlab-ci.yml. Gitlab's CI/CD description.Dockerfile. Steps for building your docker image. For Development and to be deployed.docker-compose. Basic compose that you may use for DEVELOPMENT purposes. Use different files for deployment.
- All scripts, and other commands must be ran from project's root directory.
- It is recommended to add 5 to service ports for avoid conflicts with services running on their default ports. Default postgres port is 5432. If you want to use the same instance for OS and docker development, simpy map hosts 55432 on container's 5432.
- It is recomended to use snake case naming for *.py files and python packages.
- It is recommended to use common library for basic functions (logging, args/envs reading, etc...).
- It is recommended to use your own base image for Dockerfile if exists.
-
When pushing to
dev, new version should be automatically deployed to appropriate stand for vevelopment purposes -
When pushing to branch or adding tag with names one of below:
tst- TEST.uat- UAT (User Acceptance Testing).cnd- Release Candidate.prd- Production.
It is recommended to automate deployment to appropriate stand.
-
It is recommended to automate CI for every new push to
dev -
It is recommended to add test stage to
devpipeline configuration. -
It is recommended to prepare CI/CD templates and use only imports in your core projects.