Contributing
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
Style Guide
This library leverages the python style guide as defined by Google
Directory Structure
.
├── .github # GitHub repository files
├── .gitlab # GitLab repository files
├── .vscode # Settings for Visual Studio Code
├── docs # Files for generating documentation
├── _static_ # Directory for static HTML files (i.e. images)
├── _templates # HTML template files
├── modules # Directory with ReStructured file for each sub-module
└── <name>.rst # File for each sub-module or Python file
├── advanced_usage.rst # Advanced module usage instructions
├── change_log.rst # Change log documentation
├── conf.py # Sphinx configuration file
├── contributing.rst # Contributing documentation
├── description.rst # Module description
├── getting_started.rst # Basic getting started instructions
├── index.rst # Sphinx index file
├── license.rst # Module LICENSE file
├── modules.rst # Build module directory index
├── readme.rst # Readme file
├── requirements.txt # Module requirements
├── testing.rst # Testing instructions
└── versioning.rst # Version details
├── src # Main code directory
└── <name> # Name of the project
├── tests # Directory with test files
└── unit # Directory with unit test files
├── context.py # Common file for all test_*.py files to include
└── test_<name>.py # Test file for each python file in src/<name>
├── .codeclimate.yml # Code quality configuration
├── .coveragerc # Code coverage configuration
├── .editorconfig # File to help with editor differences by OS
├── .gitignore # Files/Directories to ignore for Git Version Control
├── .gitlab-ci.yml # GitLab Continuous Integration file
├── .pypirc # PyPi configuration file
├── CHANGELOG.md # Log for each version
├── CONTRIBUTING.md # Contributing to repo instructions
├── LICENSE # Project license
├── pylintrc.txt # PyLint configuration
├── pyproject.toml # Project configuration
├── README.md # Main repo README file
├── requirements-dev.txt # External python package requirements for contributing/development
└── requirements.txt # External python package requirements
Built With
See our environment setup page for installation and configuration of local environment.
Below is a list of all external python libraries that are used for the development of this project, which can also be found in the requirements-dev.txt file located at the root of the project.
black - For auto-formatting Python code in Visual Studio Code
build - For packaging project distributions
coverage - For evaluating test code coverage (lines of code covered by a test case)
coverage-badge - For displaying the coverage percent in GitLab as a badge
PyLint - Checking syntax and formatting during development
Sphinx - For generating documentation
sphinxcontrib-mermaid - For auto-generating function call dependencies
sphinx-copybutton - For adding copy button to code snippets
sphinx-multiversion - For generating documentation per version
sphinx_rtd_theme - For ReadTheDocs.io Theme in sphinx documentation output
unittest-xml-reporting - For JUnit format to display in build pipeline output
Environment Setup
We use Visual Studio Code as our Integrated Development Environment (IDE) with the following extensions:
EditorConfig: Utility for keeping file consistency across Operating Systems
Todo Tree: Extension for tracking & highlighting inline comments & tasks
Code Merge
Prior to submitting merge requests, ensuring the following steps are complete:
[ ] Update version in
src/name/__init__.pywherenameis the name of your module[ ] Add entry to CHANGELOG.md file
[ ] Activate venv before running commands
python -m venv .venvsource .venv/bin/activatepip install -r requirements.txtpip install -r requirements-dev.txt
[ ] Run command for testing
python -m unittest discover tests/unit/[ ] Run command for code testing coverage
coverage run -m unittest discover tests/unit/ && coverage report -m[ ] Run command to generate docs and validate accuracy
rm -rf public/html && sphinx-build docs public/html[ ] Run command to generate versioned docs and validate accuracy
rm -rf public/html && sphinx-multiversion docs public/html[ ] Run command to package module for distribution
py -m build[ ] Deactivate venv
deactivate[ ] Add git tag to your commit by running
git tag -a #.#.#where#.#.#is the version
Change Log
This project uses the Semantic Versioning, which consists of MAJOR.MINOR.PATCH, and follows the best practices of change log usage from KeepAChangeLog.
A CHANGELOG file tracks all the changes by version in friendly format, with the format of:
# Change Log
## <MAJOR>.<MINOR>.<PATCH> - MONTH DD, YYYY
* <Type>
* <Description>
* <module>
Where the following placeholders are used as:
Variable |
Description |
|---|---|
Type |
Type of change, with acceptable values of: <li>Added: New features <li>Changed: Updates to existing features <li>Deprecated: Soon-to-be removed features <li>Removed: Now removed features <li>Fixed: Bug fixes <li>Security: Vulnerability fixes |
Module |
List of file(s) the change applies to |
Description |
Description of the change made, include references to stories/issues |
Changes are displayed in descending order (most recent first), with an UNRELEASED section at the very top for changes that are pending.
Code of Conduct
Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
Our Standards
Examples of behavior that contributes to creating a positive environment include:
Using welcoming and inclusive language
Being respectful of differing viewpoints and experiences
Gracefully accepting constructive criticism
Focusing on what is best for the community
Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
The use of sexualized language or imagery and unwelcome sexual attention or advances
Trolling, insulting/derogatory comments, and personal or political attacks
Public or private harassment
Publishing others’ private information, such as a physical or electronic address, without explicit permission
Other conduct which could reasonably be considered inappropriate in a professional setting
Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.
Attribution
This Code of Conduct is adapted from the Contributor Covenant v1.4.