This is a template repository to build on top of:
- Can be packaged with
poetry
- Working
pytest
tests intests
directory - Environment installed inside a Docker Container
README.md
file with repeatable instructions- Uses Python 3.12
- Create a new Python virtual environment, make sure the version matches the Dockerfile
- Install
poetry
python -m pip install --upgrade pip python -m pip install poetry
- Build and install
python -m poetry install --with dev
- Test things
poetry run ruff check poetry run ruff format poetry run mypy . poetry run pytest
Code development is in a Docker image, use these steps to spin up the image
- Download and install Docker
- Clone this repository
- Build the
dev
development image and connect to the container hostingdev
docker-compose build dev && docker-compose run --rm dev
- Edit code either in your local (host) file system or in the container hosting
dev
. Either way, the container will sync the code base. Code must be run in the container hostingdev
. - (Optional) Before pushing changes to
git
, make sure unit and style tests pass in the container- Dev tests with
pre-commit
poetry run ruff check poetry run ruff format poetry run mypy .
- Unit tests with
pytest
poetry run pytest
- Dev tests with
- Quit the running container. This will also shut down and delete the container
exit
- Use
poetry
poetry update
- If using Docker, rebuild the container using the commands above.
exit
- Change the python version across config files
- Change the Docker image names
- Docker GitHub Actions will fail until certain Secrets are uploaded
REPO_NAME
: The name of the Docker repositoryDOCKERHUB_USERNAME
: The DockerHub usernameDOCKERHUB_TOKEN
: A token for access to the repository