Development Guide

Please read our Contributing guide lines first.

Requirements

You can find any required library for this project listed in the pyproject.toml:

[build-system]
requires = ["setuptools >= 68.2.2", "setuptools_scm[toml] >= 8.0.4", "wheel", "build"]
build-backend = "setuptools.build_meta"

[project]
name = "hexonet.apiconnector"
version = "4.0.2"
description = "hexonet.apiconnector is a connector library for the insanely fast HEXONET Backend API"
readme = "README.md"
authors = [{name = "Kai Schwarz", email = "kschwarz@hexonet.net"}]
maintainers = [{name = "Kai Schwarz", email = "kschwarz@hexonet.net"}]
license = {file = "LICENSE"}
urls = {homepage = "https://github.com/centralnicgroup-opensource/rtldev-middleware-python-sdk/"}
dependencies = [
    "docutils>=0,<1",
    "sphinx-rtd-theme>=1,<2",
    "m2r2>=0,<1",
    "pytest-cov>=2,<5",
    "sphinx>=3,<8",
    "sphinxcontrib-log-cabinet>=1,<2",
    "sphinxcontrib-websupport>=1,<2",
    "twine>=4,<5",
    "black>=23,<24"
]
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent"
]

[tool.setuptools.packages.find]
where = ["."]
include = ["hexonet.*"]
exclude = ["tests*"]

[tool.pytest.ini_options]
addopts = "--strict --cov-config=.coveragerc --cov=hexonet --cov-report html --cache-clear -v"
testpaths = ["tests/"]

You can install all you need by

pip install --user --upgrade -e .

Consider doing that using a virtual environment. Read the docs.

NOTE: Make sure to have also all the extensions listed in the docs/conf.py that are required for the SDK Documentation.

We suggest to use Visual Studio Code with installed plugins for Python Development described here. But if you prefer any other IDE / Editor, it is fine.

Run Tests and Code Validation

If you open a Pull Request (PR), we will trigger automated tests and pep8 style check in CI process. So nothing you have to worry about in your development. You can open your PR and prefix its title with WIP “Work In Progress” to access these checks in advance.

If there’s anything breaking, be so kind to fix it. If you’re not able to do it - feel free to ask for help.

Try to auto-fix pep8 styling issues by

# to autofix possible issues
./scripts/pep8fix.sh

# to check for issues left
./scripts/pep8check.sh

# run unit tests
./scripts/coverage.sh

Pull Request (PR) Procedure

We care then about the rest - no need to worry about things like building current realease and versioning.

You can stop here.

TIA for your PR and thus for your support of this project. As we have further SDKs in other languages, it might take a bit of time to check if we can role out that PR as we want to keep all our SDKs aligned.

Changes to the documentation will be auto-deployed by a webhook to readthedocs.org.

The module can be accessed on the PyPi (Live) Index and the PyPi (Test) Index.

SDK Documentation

Have an eye on the generated SDK Documentation.

If you want to generate it from scratch out of the sources, please use the below script:

./scripts/generatedocs.sh

The generated files are then available in subfolder “docs/_build/html”. We regenerate the SDK Documentation whenever a new tag commit reaches the master branch.