This document describes how to set up your development environment to build and test RDS-Python.
It also explains the basic mechanics of using git.
- Prerequisite Software
- Getting the Sources
- Installing NPM Modules
- Building
- Running Tests Locally
- Formatting your Source Code
- Linting/verifying your Source Code
See the contribution guidelines if you'd like to contribute to RDS-Python.
Before you can build and test RDS-Python, you must install and configure the following products on your development machine:
-
Git and/or the GitHub app (for Mac or Windows); GitHub's Guide to Installing Git is a good source of information.
-
Anaconda, provides quick access to the Spyder IDE for writing python as well as JupyterLab for data visualization and analysis.
Fork and clone the RDS-Python repository:
- Login to your GitHub account or create one by following the instructions given here.
- Fork the RDS-Python repository.
- Clone your fork of the RDS-Python repository and define an
upstreamremote pointing back to the RDS-Python repository that you forked in the first place.
# Clone your GitHub repository:
git clone git@github.com:<github username>/rds-python.git
# Go to the RDS-Python directory:
cd rds-python
# Add the main RDS-Python repository as an upstream remote to your repository:
git remote add upstream https://github.com/mtna/rds-python.gitNext, install the Python modules needed to test RDS-Python:
# Install RDS-Python project dependencies
pip install pytest
pip install black
pip install pyflakesTo build RDS-Python run:
python setup.py build- Results are put in the
dist/folder.
Pytest is used as the primary tool for testing RDS-Python.
You should execute all test suites before submitting a PR to GitHub:
pytest
All the tests are executed on our Continuous Integration infrastructure. PRs can only be merged if the code is formatted properly and all tests are passing.
RDS-Python uses black to format the source code. If the source code is not properly formatted, the CI will fail and the PR cannot be merged.
You can automatically format your code by running:
black {source_file_or_directory}
You can check that your code is properly formatted and adheres to coding style by running:
pyflakes {source_file_or_directory}