Skip to content

Latest commit

 

History

History
214 lines (124 loc) · 5.42 KB

CONTRIBUTING.adoc

File metadata and controls

214 lines (124 loc) · 5.42 KB

Contributing to Modzy's Python SDK





GitHub contributors GitHub last commit GitHub Release Date

Contributor Covenant






Contributions are welcome and they are greatly appreciated! Every little bit helps, and credit will always be given.

Below you’ll find our contributing requirements, a step-by-step guideline, and our features roadmap.

Requirements

  • Search previous issues before making new ones to avoid duplicates.

  • If you are reporting a bug, please include:

    1. Your operating system name and version.

    2. Any details about your local setup that might be helpful in troubleshooting.

    3. Detailed steps to reproduce the bug.

  • If you are proposing a feature:

    1. Explain in detail how it would work.

    2. Keep the scope as narrow as possible, to make it easier to implement.

    3. Remember that this is a volunteer-driven project, and that contributions are welcome.

  • File an issue to let us know what you’re working on.

  • Fork the repo, develop and test your code changes, and add supporting documentation.

  • Use descriptive comments throughout your code.

  • Add test cases and comment them.

  • Use descriptive commit messages that clearly explain the changes. Reference the original issue in the pull request.

  • Make an individual pull request for each issue.

Guidelines

1. Fork the repo and set it for local development

Clone the repository:

Setup a virtual environment from the local git directory:

  • $ conda create --name VIRTUAL_ENVIRON_NAME --file requirements_dev.txt -c conda-forge python=3.9 or for non-conda python distros:

  • $ python3 -m venv /path/to/VIRTUAL_ENVIRON_NAME

Activate the virtual environment:

  • $ conda activate VIRTUAL_ENVIRON_NAME

or for non-conda python distros there are different commands for Linux vs. Windows.

On Linux use source to activate

  • $ source /path/to/VIRTUAL_ENVIRON_NAME/bin/activate

On Windows run the activate.bat file

  • C:>\path\to\VIRTUAL_ENVIRON_NAME\Scripts\activate.bat

Install dependencies (if not using conda):

  • $ pip3 install -r requirements_dev.txt

Create a branch for your awesome new feature:

  • $ git checkout -b my-awesome-new-feature

2. Develop your changes

Fix that bug or build your feature.

3. Run unit tests

Configure the environment variables to easily run all the tests with a single configuration point. Note that the environment variables must be set before opening the terminal or program that you will be running your tests from. Environmental variables do not update on the fly.

You can:

Set environment variables in bash

There are 2 environmental variables that the test scripts will need. MODZY_BASE_URL: This variable holds the network address of the modzy installation. Notice the '/api' appeanded to the end of the url. This is mandatory and will cause errors if not present. MODZY_API_KEY: This variable holds a full copy of a modzy API key. Modzy’s role based access controls will cause some of the tests to fail if your key doesn’t have all the roles assigned. ===== Windows

set MODZY_BASE_URL=https://modzy.example.com/api
set MODZY_API_KEY=<your Modzy API key here>
Unix
export MODZY_BASE_URL=https://modzy.example.com/api
export MODZY_API_KEY=<your Modzy API key here>

Use .env file

Create a .env file in the root folder with your API key:

MODZY_BASE_URL=https://modzy.example.com/api
MODZY_API_KEY=<your Modzy API key here>

Run tests:

  • $ py.test

Or specify the test that you want to run:

  • $ py.test tests.test_client

4. Document your changes

Add supporting documentation for your code.

5. Send a pull request

Add and commit your changes:

  • git add .

  • $ git commit "A descriptive message"

Push your branch to GitHub:

  • $ git push origin my-new-awesome-feature

Initiate a Pull Request:

If your PR doesn’t pass all tests due to role based access controls with your key, please provide log information so that we may test the PR under appropriate conditions.

Roadmap

  • Documentation improvement.

  • Comprehensive unit tests.

  • Wider API coverage (custom models, accounting, audit, etc).

  • [Maybe] Add retry logic for possibly transient issues.

  • [Maybe] Consider moving to concrete classes for the API JSON - objects, or else move the ApiObject to a public module.

  • [Maybe] Python 2.7 compatibility.

Support

Use GitHub to report bugs and send feature requests.
Reach out to https://www.modzy.com/support/ for support requests.