From 10ece915c3ef689afe82837ace5725ae3374ab01 Mon Sep 17 00:00:00 2001 From: Olivier Le Floch Date: Sun, 18 Feb 2024 18:17:57 -0800 Subject: [PATCH] Document local testing instructions (#1672) ## Summary Provides an example of local testing usage, to make it easier for new developers who are less familiar with `cargo` / `rust` development best practices. ## Test Plan I followed the setup instructions earlier in the contributing guide, then ran these 2 commands. --- CONTRIBUTING.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index af86206c2..19dc4c5a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,7 @@ See the [Python](#python) section for instructions on installing the Python vers ### Windows -You can install CMake from the [installers](https://cmake.org/download/) or with `pipx install cmake` +You can install CMake from the [installers](https://cmake.org/download/) or with `pipx install cmake` (make sure that the pipx install path is in `PATH`, pipx complains if it isn't). ## Testing @@ -52,6 +52,15 @@ Alternatively, you can install `zstandard` from PyPI, then run: python3.12 scripts/bootstrap/install.py ``` +### Local testing + +You can invoke your development version of uv with `cargo run -- `. For example: + +```shell +cargo run -- venv +cargo run -- pip install requests +``` + ## Running inside a docker container Source distributions can run arbitrary code on build and can make unwanted modifications to your system (["Someone's Been Messing With My Subnormals!" on Blogspot](https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html), ["nvidia-pyindex" on PyPI](https://pypi.org/project/nvidia-pyindex/)), which can even occur when just resolving requirements. To prevent this, there's a Docker container you can run commands in: