The commhandler library provides the interfaces and drivers to access devices.
pyproject.tomlis the main project configuration file.setup.pyis used to build the library package using setuptools.requirements.txtcontains the dependencies required to use the library.requirements-dev.txtcontains the dependencies required to run tests.src/sgr_commhandlercontains the source code of the library, with sgr_commhandler being the root of the namespace.testscontains unit and integration tests.examplescontains basic examples of using the library. See SGrPythonSamples for more detailed examples.
Check out the SGrPython repository, e.g. in SGrPython.
Create and activate virtual environment:
cd SGrPython
python -m venv .venv
# On Linux call this:
source ./.venv/bin/activate
# On Windows call this:
.\.venv\Scripts\Activate.ps1Make sure you have the specification library sgr-specification installed in your virtual environment.
See specification for instructions.
You can run tests using pytest while in virtual environment.
It is not necessary to install the package locally, if you only want to run tests.
cd SGrPython/commhandler
pip install -r requirements-dev.txt
pytestBuild package and install in virtual environment:
cd SGrPython/commhandler
pip install -e .You can use the package sgr-commhandler from within the virtual environment now.
Note:
The designated package name sgr-commhandler must not be used until the PyPI administrators have
approved a SmartGridready organization account!
Deactivate the virtual environment after use:
cd SGrPython
deactivate