(ADD A DESCRIPTION FOR YOUR PROJECT) ...
- Git clone this project
- Fill in the fillers ('...') in the README above with your project specific information
- Rename the folder
src/my_package
to whatever your project name is (e.g.src/my_awesome_project
) and update thetool.poetry-exec-plugin.commands
section inpyproject.toml
and theCMD
line inruntime
stage of theDockerfile
accordingly- This adopts the
src/package
layout structure. The benefits of this layout is that it allows for independent testing of installed packaged code from local code that are still in development (i.e. import parity from a user pov). Benefits are more apparent for python packages meant for installation but let's just give this a try :)tests/
contains test for project code.src/my_package
contains code for your python project. "my_package" is usually your project's name.
- For convention and consistency, use underscores ('_') to delimit folder names
- This adopts the
- Delete this 'How to use this code template' section
- Re-initialize git
- Delete
.git
folder - Follow instructions in gitlab on how to create new projects
New Project
>Create blank project
> (Enter your project name and uncheck the 'Initialize repository with a README') >Create project
> Follow the command line instructions underPush an existing folder
section
- Delete
- Proceed with development :)
- Create new python virtual environment.
# usage: python -m venv <name of venv>
python -m venv venv
- Activate the virtual environment.
# windows
.\venv\Scripts\activate.bat
# linux
source venv/bin/activate
- Install setup setuff.
# installs setup stuff and poetry and its plugins
pip install -U pip setuptools
pip install poetry poetry-exec-plugin
# installs packages specified in `pyproject.toml` (similar to `pip install`)
poetry install
# installs precommit hooks
pre-commit install
To add packages,
# prod packages
poetry add pandas
# dev packages
poetry add pytest --group dev
To remove packages,
poetry remove pytest --group dev
To run the code,
poetry exec start
To run lint and formatter,
poetry exec lint
To run tests,
poetry exec test
To create a release,
poetry exec release
This taps on commitizen
to auto bump version numbers in pyproject.toml
based on Semantic Versioning conventions. It also updates the changelog and creates a corresponding git tag. To push the commit and tag,
git push && git push origin --tags
This project uses kustomize
to manage kube configurations across namespaces and has been tested with kubectl
version v1.29.2 which ships with kustomize
v5.0.4-0.20230601165947-6ce0bf390ce3.
To deploy to kubernetes,
kubectl apply -k kube/base
kubectl apply -k kube/overlays/production
Note that any domain name used in the ingress needs to be added to the DNS.
To delete from kubernetes,
kubectl delete -k kube/base
To generate manifests without deploying,
kubectl kustomize kube/base
kubectl kustomize kube/overlays/production