# Contributing ## Finding ways to help We label issues that would be good for a first time contributor as [`good first issue`](https://github.com/astral-sh/uv/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). These usually do not require significant experience with Rust or the uv code base. We label issues that we think are a good opportunity for subsequent contributions as [`help wanted`](https://github.com/astral-sh/uv/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). These require varying levels of experience with Rust and uv. Often, we want to accomplish these tasks but do not have the resources to do so ourselves. You don't need our permission to start on an issue we have labeled as appropriate for community contribution as described above. However, it's a good idea to indicate that you are going to work on an issue to avoid concurrent attempts to solve the same problem. Please check in with us before starting work on an issue that has not been labeled as appropriate for community contribution. We're happy to receive contributions for other issues, but it's important to make sure we have consensus on the solution to the problem first. Outside of issues with the labels above, issues labeled as [`bug`](https://github.com/astral-sh/uv/issues?q=is%3Aopen+is%3Aissue+label%3A%22bug%22) are the best candidates for contribution. In contrast, issues labeled with `needs-decision` or `needs-design` are _not_ good candidates for contribution. Please do not open pull requests for issues with these labels. Please do not open pull requests for new features without prior discussion. While we appreciate exploration of new features, we will almost always close these pull requests immediately. Adding a new feature to uv creates a long-term maintenance burden and requires strong consensus from the uv team before it is appropriate to begin work on an implementation. Do not use LLMs such as Claude Code or ChatGPT for communication. LLMs are notoriously unreliable and make up smart sounding but ultimately wrong claims. Instead, phrase issue and pull request comments in your own words. It's not important to sound perfect, but that we can follow what problem you're trying to solve and why the pull request uses a correct approach. ## Setup [Rust](https://rustup.rs/) (and a C compiler) are required to build uv. On Ubuntu and other Debian-based distributions, you can install a C compiler with: ```shell sudo apt install build-essential ``` On Fedora-based distributions, you can install a C compiler with: ```shell sudo dnf install gcc ``` ## Testing For running tests, we recommend [nextest](https://nexte.st/). To run a specific test by name: ```shell cargo nextest run -E 'test(test_name)' ``` To run all tests and accept snapshot changes: ```shell cargo insta test --accept --test-runner nextest ``` To update snapshots for a specific test: ```shell cargo insta test --accept --test-runner nextest -- ``` ### Python Testing uv requires multiple specific Python versions; they can be installed with: ```shell cargo run python install ``` The storage directory can be configured with `UV_PYTHON_INSTALL_DIR`. (It must be an absolute path.) ### Snapshot testing uv uses [insta](https://insta.rs/) for snapshot testing. It's recommended (but not necessary) to use `cargo-insta` for a better snapshot review experience. See the [installation guide](https://insta.rs/docs/cli/) for more information. In tests, you can use `uv_snapshot!` macro to simplify creating snapshots for uv commands. For example: ```rust #[test] fn test_add() { let context = TestContext::new("3.12"); uv_snapshot!(context.filters(), context.add().arg("requests"), @""); } ``` To run and review a specific snapshot test: ```shell cargo test --package --test -- -- --exact cargo insta review ``` ### Git and Git LFS A subset of uv tests require both [Git](https://git-scm.com) and [Git LFS](https://git-lfs.com/) to execute properly. These tests can be disabled by turning off either `git` or `git-lfs` uv features. ### Local testing You can invoke your development version of uv with `cargo run -- `. For example: ```shell cargo run -- venv cargo run -- pip install requests ``` ## Formatting ```shell # Rust cargo fmt --all # Python uvx ruff format . # Markdown, YAML, and other files (requires Node.js) npx prettier --write . # or in Docker docker run --rm -v .:/src/ -w /src/ node:alpine npx prettier --write . ``` ## Linting Linting requires [shellcheck](https://github.com/koalaman/shellcheck) and [cargo-shear](https://github.com/Boshen/cargo-shear) to be installed separately. ```shell # Rust cargo clippy --workspace --all-targets --all-features --locked -- -D warnings # Python uvx ruff check . # Python type checking uvx ty check python/uv # Shell scripts shellcheck