From c8bd26726d9d0afb6246f0a3b3c475d3063e815c Mon Sep 17 00:00:00 2001 From: Aron Carroll Date: Wed, 11 Sep 2024 12:24:27 +0100 Subject: [PATCH 1/4] Update CONTRIBUTING.md to document rye usage --- CONTRIBUTING.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 74a1509e..c95605b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,17 +86,18 @@ git interpret-trailers --if-exists doNothing --trailer \ ## Development -To run the tests: +The Python project is managed using [`rye`](https://rye.astral.sh) you will need this installed and available locally. See the [installation instructions](https://rye.astral.sh/guide/installation/) for details. + +To setup the project: -```sh -pip install -r requirements-dev.txt -pytest +``` +rye sync ``` -To install the package in development: +To run the tests: ```sh -pip install -e . +rye run pytest ``` ### Environment variables From 504da83a3e069dd41697b789255c0d1316d87534 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Wed, 11 Sep 2024 10:36:30 -0700 Subject: [PATCH 2/4] Formatting Signed-off-by: Mattt Zmuda --- CONTRIBUTING.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c95605b4..a2faddf0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ You can also create a git hook which will sign off all your commits automaticall First, create the hook file and make it executable: -```sh +```console cd your/checkout/of/replicate-python touch .git/hooks/prepare-commit-msg chmod +x .git/hooks/prepare-commit-msg @@ -63,7 +63,7 @@ chmod +x .git/hooks/prepare-commit-msg Then paste the following into the file: -``` +```sh #!/bin/sh NAME=$(git config user.name) @@ -86,11 +86,13 @@ git interpret-trailers --if-exists doNothing --trailer \ ## Development -The Python project is managed using [`rye`](https://rye.astral.sh) you will need this installed and available locally. See the [installation instructions](https://rye.astral.sh/guide/installation/) for details. +The Python project is managed using [`rye`](https://rye.astral.sh). +You will need this installed and available locally. +See the [installation instructions](https://rye.astral.sh/guide/installation/) for details. To setup the project: -``` +```console rye sync ``` From 1247958099aad80a0557d5da92bde7a8ee621448 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Wed, 11 Sep 2024 10:40:02 -0700 Subject: [PATCH 3/4] Recommend setup script Signed-off-by: Mattt Zmuda --- CONTRIBUTING.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a2faddf0..e58dec61 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,20 +87,14 @@ git interpret-trailers --if-exists doNothing --trailer \ ## Development The Python project is managed using [`rye`](https://rye.astral.sh). -You will need this installed and available locally. -See the [installation instructions](https://rye.astral.sh/guide/installation/) for details. - -To setup the project: +Run the setup script to install Rye and install the project's dependencies. ```console -rye sync +./script/setup ``` -To run the tests: - -```sh -rye run pytest -``` +You can run the `format`, `lint`, and `test` scripts before commiting +to validate your changes locally before going through CI. ### Environment variables From e8128c552d00a069d29b19bef84025af3b366d0e Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Wed, 11 Sep 2024 11:02:47 -0700 Subject: [PATCH 4/4] Update URL in setup script Signed-off-by: Mattt Zmuda --- script/setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/setup b/script/setup index 360307a6..e09f38f0 100755 --- a/script/setup +++ b/script/setup @@ -14,7 +14,7 @@ then case "$REPLY" in [yY]) echo "Installing rye..." - curl -sSf https://rye-up.com/get | sh + curl -sSf https://rye.astral.sh/get | sh echo "rye has been successfully installed." ;; *)