Skip to content

miketwo/python-skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Skeleton

A sample Python module skeleton with a modern src/ layout, uv for env/package management, pytest for tests, and ruff for linting/formatting.

Hey there, Developer

Usage -- Docker

This sets up a dev environment inside of docker. Changes made on the host will be immediately reflected.

Pre-reqs: docker

# Download the repo
git clone https://github.com/miketwo/python-skeleton.git
cd python-skeleton

# Build and run the container
docker build -t my_container_name .
docker run -it -v $(pwd):/app my_container_name

# Run tests
./script/test

# Lint/format
./script/lint
./script/format

# Watch tests (rerun automatically on changes)
./script/test-watch

# Console
./script/console

# Now modify a test in `/tests` or the example code in `/src/skeleton/core.py`
# to see the unit tests rerunning. Tada! TDD.

Note about caches

Both python and pytest use caches to speed things up. If you are running the program or tests both inside and outside the container, these caches will conflict can each other. Whenever you switch environments, it's best to clear the cache by:

  • Running find . -name \*.pyc -delete
  • Using the --cache-clear option in pytest or manually deleting __pycache__

Usage -- uv (recommended)

Pre-reqs: uv

# Download the repo
git clone https://github.com/miketwo/python-skeleton.git
cd python-skeleton

# Create a virtual environment and install dev deps
./script/setup

# Run tests
./script/test

# Lint/format
./script/lint
./script/format

# Watch tests (rerun automatically on changes)
./script/test-watch

# Now modify a test in `/tests` or the example code in `/src/skeleton/core.py`
# to see the unit tests rerunning. Tada! TDD.

Contributing

Contributions are welcome! Just submit a PR.

License

Uses the MIT license.

About

A simple skeleton for developing python packages.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •