Skip to content

Developer setup

Christina-Kang edited this page Apr 5, 2018 · 5 revisions

Prerequisites

Before starting, install the following tools:

  • Python 2.7 or 3.6 (both preferably)
  • Pip package manager
  • Virtualenv (pip install virtualenv)

For more information on these tools, see the public documentation on Python or Pip

Development can be done on Windows, macOS, and Linux.

Install module locally

From the root of your cloned repo, generate a virtual environment with a specific version of python.

For python 3.6, run the following commands:

virtualenv -p python3 env/
. ./env/bin/activate

For python 2.7, run the following commands:

virtualenv -p python2 env27/
. ./env27/bin/activate

Then install the required packages and a local symbolic link of the sfctl package:

pip install -e ./src
pip install -r requirements.txt

VS Code Extensions

If you are using VS Code, it is recommended you install two extensions (ext install <name>):

Keep the project dictionary up to date by adding exclusions when running spell check.

For different virtual environments, it is also important to update the workspace Python interpreter. Select an interpreter by running the Python: Select Workspace Interpreter command.

Testing

Pull requests are gated on passing unit tests and PyLint. To run these checks locally, run the following commands from root:

./scripts/verify.sh local

For more detailed testing information, see the testing guide.

Conventions

Before submitting any pull requests for merging, be sure to review the requirements and suggestions outlined in the coding conventions documentation.

TroubleShooting

'pip' is not recognized as an internal or external command

This error can be due to Python not being in your path.

The path python3 (from --python=python3) does not exist

This error can be due to Python not being in your path. Alternatively, you can provide a path to python.exe