This template contains most of the stuff you might need for a Python project.
- Make a new repo and use this one as a template (Follow how to marge changes section below)
- Create your project package directory
- Add project package name to the
project-packages.txt
- Set virtualenv (if you want to create directory for env inside project directory make sure to make it hidden, with
.
, like e.g..my-env
that way it won't trigger MyPy validation on dependecies). I used 3.10, but should be fine with 3.7+. - Run
make install-test
- (Optional) - Copy https://github.com/overfitted-cat/pybase/blob/main/.vscode-settings/settings.json into
.vscode/settgins.json
- (Optional) - Set env for the vscode
- (Optional) - Set github hooks, e.g. add
make docker-validate
in.git/hooks/pre-commit
- This will run docker build, ptest, isort, mypy, flake8 and safety validations.
You can synchronize all your repoes with this base by setting:
git remote add base git@github.com:overfitted-cat/pybase.git
- this need to be ran once, it sets another remote (base
) to point to this template- (Optional) -
git remote -v
- One of the outputs should bebase git@github.com:overfitted-cat/pybase.git (fetch)
git fetch base
- this will fetch all new commits from this template repogit merge --no-ff base/main --allow-unrelated-histories
git config remote.base.pushurl "Push to the template repo is not allowed"
- just to make sure you don't update the template repo from your repo
make install
- installs a project with dependeciesmake install-test
- installs dev version with dependecies to validation and testmake run-test
- Runs all tests fromtests
make validate
- Runsmypy
,flake8
,isort
andsafety
checksmake coverage
- Generates coverage HTML reportmake run-test-full
- Runs tests + validationsmake run-docker-validate
- Runs validation and tests inside the docker container