Skip to content

Latest commit

 

History

History
127 lines (104 loc) · 5.43 KB

File metadata and controls

127 lines (104 loc) · 5.43 KB

Contributing to nitsm-python

Contributions to nitsm-python are welcome from all!

nitsm-python is managed via Git, with the canonical upstream repository hosted on GitHub.

nitsm-python follows a pull request model for development. If you wish to contribute, you will need to create a GitHub account, fork this project, push a branch with your changes to your project, and then submit a pull request.

See GitHub's official documentation for more details.

Getting Started

Environment Setup

Before beginning development, it is recommended to install the following dependencies:

pip install -r requirements.txt

Code Formatting

nitsm-python uses black for formatting. To format the entire project, run:

black .

Linting

nitsm-python uses ni-python-styleguide for linting. To lint the entire project, run:

ni-python-styleguide lint

Testing

Executing nitsm-python tests in the tests/ directory requires the TSM Standalone Semiconductor Module Context. If you are an NI employee, contact one of the repository owners to determine how to obtain a copy of this non-public component. If you are not an NI employee, hang tight! We are currently working on a process to enable external contributors to use this tool. Note that this does not apply to tests in the systemtests/ directory.

nitsm uses pytest to run tests. First, install nitsm in edit mode:

pip install -e .

Then, run pytest:

pytest

Running pytest without arguments will run all tests in the tests/ directory. To include system tests, include the systemtests/ directory.

pytest tests systemtests

tox is used to run tests against multiple versions of python. To test against all environments, run:

tox

The tox configuration in pyproject.toml creates environments for running pytest in tests/ and systemtests/. It also defines two additional environments, clean and report for cleaning and creating report files respectively. To specify a subset of tox environments, run tox with the -e flag followed by a comma separated list of environments:

tox -e clean,py36-tests,py36-sysytemtests,report

Building

To build nitsm-python, you will first need to install build:

pip install build

Next, build the project:

python -m build

If the build succeeds, artifacts will be placed in dist/.

Developer Certificate of Origin (DCO)

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.

(taken from developercertificate.org)

See LICENSE for details about how nitsm-python is licensed.