/leetcode_rerun

Using rerun to visualise leetcode problems

Primary LanguageShellMIT LicenseMIT

leetcode_rerun

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

Continuous Integration Status

Ci Codecov GitHub issues GitHub pull-requests merged GitHub release License Python Pixi Badge

Install

There are two methods of using this project.

  1. Use github to use this project as a template
  2. 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

Usage

There are currently two ways of running code. The legacy docker way and the work in progress pixi way.

Legacy

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.

Pixi

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.

vscode tasks

There are two core tasks.

  1. set <cfg> from active file

    This sets <cfg> to the currently opened file in the editor

  2. run <cfg>

    This runs python with the file set in <cfg>