diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc1dbd542..83b5a85a1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,7 @@ # Contributing To Rez +## Guidelines + If you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request. Please follow these guidelines: @@ -21,6 +23,45 @@ sending a pull request. Please follow these guidelines: document the setting. The comments in this file are extracted and turned into documentation. Pay attention to the comment formatting and follow the existing style closely. +## Development Environment + +### Prerequisites + +On Windows, make sure to set your PowerShell execution policy as shown [here](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-5.1), +otherwise the PowerShell tests will fail. + +### Setting Up + +To begin development on rez you'll first need to set up your development environment. There are many +ways you can do it, but these are the recommended approaches. + +This first approach will automatically create a virtual environment for you, patch the Rez binaries, +and copy completion scripts. All tests will be run this way. + +1. Fork the repo and clone it. +2. Create a new Git branch and check it out. +3. Install your local rez code by running `python install.py venv`. +4. Activate the virtual environment by running the `activate` file. +5. Add the `Scripts/rez` folder on Windows or the `bin/rez` folder on Mac/Linux to the `PATH` environment variable. + +There is an alternative method of setting up your development environment, that doesn't use the `install.py` +script. Please note that not all tests will be run if rez is installed this way. + +1. Fork the repo and clone it. +2. Create a new Git branch and check it out. +3. Create a virtual environment in the same directory as the repo by running `python -m venv venv`. +4. Activate the virtual environment by running the `activate` file. +5. Pip install your local rez code by running `pip install .`. + +Additionally, if you are going to run tests in the repo, you may want to install two additional optional +packages for improved test output: `pytest` and `parameterized`. You can install these by running +`pip install pytest parameterized`. + +### Running Tests + +1. Set up your development environment as shown above. +2. Run `rez selftest`. + ## CLA Rez enforces use of a Contributor License Agreement as per ASWF guidelines. You need only sign up to the EasyCLA system once, but until you do, your PRs will be automatically blocked.