Acumos onnx Client Developer Guide

Testing

We use a combination of tox, pytest, and flake8 to test acumos_onnx_client. Code which is not PEP8 compliant (aside from E501) will be considered a failing test. You can use tools like autopep8 to “clean” your code as follows:

$ pip install autopep8
$ cd acumos-onnx-client
$ autopep8 -r --in-place --ignore E501 acumos_onnx_client/ testing/ examples/

Run tox directly:

$ cd acumos-onnx-client
$ export WORKSPACE=$(pwd)  # env var normally provided by Jenkins
$ tox

You can also specify certain tox environments to test:

$ tox -e py36  # only test against Python 3.6
$ tox -e flake8  # only lint code

A set of integration test is also available in acumos-package/testing/integration_tests. To run those, use acumos-package/testing/tox-integration.ini as tox config (-c flag), onboarding tests will be ran with python 3.6 to 3.9. You will need to set your user credentials and platform configuration in tox-integration.ini.

$ tox -c acumos-package/testing/integration_tests

Packaging

The RST files in the docs/ directory are used to publish HTML pages to ReadTheDocs.io and to build the package long description in setup.py. The symlink from the subdirectory acumos-package to the docs/ directory is required for the Python packaging tools. Those tools build a source distribution from files in the package root, the directory acumos-package. The MANIFEST.in file directs the tools to pull files from directory docs/, and the symlink makes it possible because the tools only look within the package root.