/visual-tokens

Tokenizer and token manipulation for ViT visual tokens

Primary LanguageMakefile

Python Template

Template repository for Python projects. Uses pdm as the package manager.

Usage

  1. Rename project to the desired project name
  2. Update the $PROJECT variable in Makefile to match step 1
  3. Run pdm init to configure pyproject.toml
  4. Add source code to the renamed project folder
  5. Run make init to install the project to a pdm virtual environment
  6. You can execute commands from the pdm environment with pdm run

Recipes

  • make style - Runs code style formatting
  • make quality - Tests that code complies with quality standards
  • make types - Run static type checking with pyright
  • make test - Run unit tests
  • make test-pdb-* - Run unit tests matching pattern * with fallback to pdb for debugging.
  • make deploy - Install dependencies from pdm lockfile

Optional steps

  • Setup CI - a template CircleCI config is provided in .circeci/config.yml
  • Create config.mk - secrets or per-user configuration can go here. Template config.mk.example is under version control, but config.mk is in .gitignore. Add $(CONFIG_FILE) as a make dependencies for recipes that need vars from config.mk.

Misc

  • Run make help to get a partial list of available make recipes
  • A pytest mark, ci_skip, is provided to mark tests that should be skipped during CI pipelines