From 85b1ce20be29393a376b921ef5f343e4adc12aed Mon Sep 17 00:00:00 2001 From: Shion Matsumoto Date: Thu, 3 Jul 2025 14:23:57 -0400 Subject: [PATCH 1/5] add dev env setup guide --- .github/CONTRIBUTING.md | 37 +++++++++++++++++++++++++++++++++++++ tests/README.md | 4 ++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index cfb03d220c99c..ca8b58d809149 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -109,6 +109,43 @@ ______________________________________________________________________ ## Guidelines +### Development environment + +To set up a local development environment, begin by cloning the repository: + +```bash +# clone the repo +git clone git@github.com:Lightning-AI/pytorch-lightning.git +cd pytorch-lightning +``` + +Once in root level of the repository, install the dependencies using a package manager of your choice: + +```bash +# pip +python -m venv ./venv +source ./venv/bin/activate +pip install ".[dev, examples]" + +# uv +uv venv +source ./venv/bin/activate +uv pip install ".[dev, examples]" +``` + +Once the dependencies have been installed, install pre-commit and set up the git hook scripts: + +```bash +# pip +pip install pre-commit + +# uv +uv pip install pre-commit + +# Install git hook scripts +pre-commit install +``` + ### Developments scripts To build the documentation locally, simply execute the following commands from project root (only for Unix): diff --git a/tests/README.md b/tests/README.md index 26e49c4f5751f..aedeb1946d210 100644 --- a/tests/README.md +++ b/tests/README.md @@ -9,8 +9,8 @@ To setup a local development environment, install both local and test dependenci ```bash # clone the repo -git clone https://github.com/Lightning-AI/lightning.git -cd lightning +git clone git@github.com:Lightning-AI/pytorch-lightning.git +cd pytorch-lightning # install required dependencies export PACKAGE_NAME=pytorch From 6e37c7e04d102422acfcef3cfddd3901759158a6 Mon Sep 17 00:00:00 2001 From: Shion Matsumoto Date: Thu, 3 Jul 2025 14:31:31 -0400 Subject: [PATCH 2/5] use https --- .github/CONTRIBUTING.md | 2 +- tests/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ca8b58d809149..9d751e5b3f2dc 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -115,7 +115,7 @@ To set up a local development environment, begin by cloning the repository: ```bash # clone the repo -git clone git@github.com:Lightning-AI/pytorch-lightning.git +git clone https://github.com/Lightning-AI/pytorch-lightning.git cd pytorch-lightning ``` diff --git a/tests/README.md b/tests/README.md index aedeb1946d210..98c67f06ae2de 100644 --- a/tests/README.md +++ b/tests/README.md @@ -9,7 +9,7 @@ To setup a local development environment, install both local and test dependenci ```bash # clone the repo -git clone git@github.com:Lightning-AI/pytorch-lightning.git +git clone https://github.com/Lightning-AI/pytorch-lightning.git cd pytorch-lightning # install required dependencies From e8e8aef01dc9de18e189816654c1bd04ea002b83 Mon Sep 17 00:00:00 2001 From: Shion Matsumoto Date: Fri, 4 Jul 2025 00:55:35 -0400 Subject: [PATCH 3/5] fix venv path --- .github/CONTRIBUTING.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 9d751e5b3f2dc..b09b3f646061a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -114,7 +114,6 @@ ______________________________________________________________________ To set up a local development environment, begin by cloning the repository: ```bash -# clone the repo git clone https://github.com/Lightning-AI/pytorch-lightning.git cd pytorch-lightning ``` @@ -123,13 +122,13 @@ Once in root level of the repository, install the dependencies using a package m ```bash # pip -python -m venv ./venv -source ./venv/bin/activate +python -m venv .venv +source .venv/bin/activate pip install ".[dev, examples]" # uv uv venv -source ./venv/bin/activate +source .venv/bin/activate uv pip install ".[dev, examples]" ``` From 305178970f2afd13db495b5294c706e35505622b Mon Sep 17 00:00:00 2001 From: Shion Matsumoto Date: Sun, 6 Jul 2025 18:53:45 -0400 Subject: [PATCH 4/5] revert to lightning --- .github/CONTRIBUTING.md | 4 ++-- tests/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b09b3f646061a..ced1eb3590697 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -114,8 +114,8 @@ ______________________________________________________________________ To set up a local development environment, begin by cloning the repository: ```bash -git clone https://github.com/Lightning-AI/pytorch-lightning.git -cd pytorch-lightning +git clone https://github.com/Lightning-AI/lightning.git +cd lightning ``` Once in root level of the repository, install the dependencies using a package manager of your choice: diff --git a/tests/README.md b/tests/README.md index 98c67f06ae2de..26e49c4f5751f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -9,8 +9,8 @@ To setup a local development environment, install both local and test dependenci ```bash # clone the repo -git clone https://github.com/Lightning-AI/pytorch-lightning.git -cd pytorch-lightning +git clone https://github.com/Lightning-AI/lightning.git +cd lightning # install required dependencies export PACKAGE_NAME=pytorch From e6d6acdc1ef583fb8ea01f771336c048a82fc4ac Mon Sep 17 00:00:00 2001 From: Shion Matsumoto Date: Mon, 7 Jul 2025 09:20:29 -0400 Subject: [PATCH 5/5] recommend uv --- .github/CONTRIBUTING.md | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ced1eb3590697..dcfc590a0fe23 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -111,40 +111,34 @@ ______________________________________________________________________ ### Development environment -To set up a local development environment, begin by cloning the repository: +To set up a local development environment, we recommend using `uv`, which can be installed following their [instructions](https://docs.astral.sh/uv/getting-started/installation/). + +Once `uv` has been installed, begin by cloning the repository: ```bash git clone https://github.com/Lightning-AI/lightning.git cd lightning ``` -Once in root level of the repository, install the dependencies using a package manager of your choice: +Once in root level of the repository, create a new virtual environment and install the project dependencies. ```bash -# pip -python -m venv .venv -source .venv/bin/activate -pip install ".[dev, examples]" - -# uv uv venv -source .venv/bin/activate +# uv venv --python 3.11 # use this instead if you need a specific python version + +source .venv/bin/activate # command may differ based on your shell uv pip install ".[dev, examples]" ``` Once the dependencies have been installed, install pre-commit and set up the git hook scripts: ```bash -# pip -pip install pre-commit - -# uv uv pip install pre-commit - -# Install git hook scripts pre-commit install ``` +If you would like more information regarding the uv commands, please refer to uv's documentation for more information on their [pip interface](https://docs.astral.sh/uv/pip/). + ### Developments scripts To build the documentation locally, simply execute the following commands from project root (only for Unix):