Skip to content

Workata/python-template

Repository files navigation

python-template

Simple template for python project

Checklist

  • Change project folder name from 'app_name' to your project slug.
  • Find and replace all occurrences of 'app_name' to your project slug and 'app-name' to project name.
  • Open pyproject.toml and update information about the project like authors, description etc.

Dev setup

Basic setup

Copy env file

cp -n .env.example .env

Create new venv

python3 -m venv ./venv

Activate venv

. ./venv/bin/activate

Install needed requirements

pip install -r requirements/dev.txt

Static checks and unit tests

Run unit tests

pytest .

Run unit tests and check coverage

coverage run -m pytest .
coverage report -m

Run linter

ruff check --fix

Run formatter

ruf format

Packaging

If you need to package your project you can use hatch.

Install hatchling

pip install hatchling==1.25.0

Build a package

hatch build

Publish (you need to define repository and credentials)

hatch publish

Containerization

Build image

docker build . --tag app-image

Create container and run it

docker run app-image

About

Simple template for python project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published