From ad47068964b00821670f74a801e679d18254edd4 Mon Sep 17 00:00:00 2001 From: Anurag Dhadse Date: Fri, 22 Apr 2022 01:37:37 +0530 Subject: [PATCH] Updated CONTRIBUTING.md for setup of venv and standard pip install (#127) * Updated CONTRIBUTING.md for setup of venv and standard pip install * Updated CONTRIBUTING.md with proposed changes * Fixes Co-authored-by: Matt Watson <1389937+mattdangerw@users.noreply.github.com> --- CONTRIBUTING.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4ed655e097..fa08c85fc2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,12 +26,14 @@ development environment and run the unit tests. This is covered in section ### Step 3. Create a pull request Once the change is ready, open a pull request from your branch in your fork to -the master branch in [keras-team/keras-nlp](https://github.com/keras-team/keras-nlp). +the master branch in +[keras-team/keras-nlp](https://github.com/keras-team/keras-nlp). ### Step 4. Sign the Contributor License Agreement After creating the pull request, you will need to sign the Google CLA agreement. -The agreement can be foiund at [https://cla.developers.google.com/clas](https://cla.developers.google.com/clas). +The agreement can be found at +[https://cla.developers.google.com/clas](https://cla.developers.google.com/clas). ### Step 5. Code review @@ -47,20 +49,24 @@ Once the pull request is approved, a team member will take care of merging. ## Setup environment +Python 3.7 or later is required. + Setting up your KerasNLP development environment requires you to fork the -KerasNLP repository, clone the repository, install dependencies, and execute -`python setup.py develop`. +KerasNLP repository, clone the repository, create a virtual environment, and +install dependencies. You can achieve this by running the following commands: ```shell gh repo fork keras-team/keras-nlp --clone --remote cd keras-nlp -pip install ".[tests]" -python setup.py develop +python -m venv ~/keras-nlp-venv +source ~/keras-nlp-venv/bin/activate +pip install -e ".[tests]" ``` -The first line relies on having an installation of [the GitHub CLI](https://github.com/cli/cli). +The first line relies on having an installation of +[the GitHub CLI](https://github.com/cli/cli). Following these commands you should be able to run the tests using `pytest keras_nlp`. Please report any issues running tests following these @@ -114,4 +120,5 @@ like - `: invalid option` ## Community Guidelines -This project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct/). +This project follows +[Google's Open Source Community Guidelines](https://opensource.google/conduct/).