A template repo for python projects that is set up using pixi.
This has basic setup for
- pylint
- ruff
- black
- pytest
- codecov
- git-lfs
- basic github actions ci
- pulling updates from this template
There are two methods of using this project.
- Use github to use this project as a template
- Clone the project and run,
scripts/update_from_template.sh
and then run the "rename project" task to rename the project.
If you want to use docker you may want to run the scripts/setup_host.sh
script. It will set up docker and nvidia-docker (assuming you are on ubuntu22.04).
If you are using pixi, you can either follow the instructions on the pixi website or run scripts/install_pixi.sh
There are currently two ways of running code. The legacy docker way and the work in progress pixi way.
run the scripts/launch_vscode.sh
script to build and connect to a docker container. The docker container is dynamically generated using rocker and deps rocker. deps rocker looks at the leetcode_rerun.deps.yaml file to install any required apt, pip or shell scripts and launches a container that vscode attaches to.
If you have pixi installed on your host machine you can run any of the tasks defined in pyproject.toml. The legacy method also installs pixi in the container so you have access to pixi there.
The main pixi tasks are related to ci. Github actions runs the pixi task "ci". The ci is mostly likey to fail from a lockfile mismatch. Use the "fix" task to fix any lockfile related problems.
There are two core tasks.
-
set <cfg> from active file
This sets <cfg> to the currently opened file in the editor
-
run <cfg>
This runs python with the file set in <cfg>