Package: trimarlib-brio
trimarlib-brioBasic Remote Input/Output- Python applicationGetting startedThese instructions will get you a copy of the project on your local machine for development and testing purposes.
SeeDeploymentfor notes on how to deploy the project on a live system.PrerequisitesThe build process requires some basic development tools:make- GNU Make program, either for *nix or Windows system, used to execute build and test targetsgit- used not only to clone the repository, but also in auto-versioning (seeVersioning)python3Two standard Python packages are used for build and installation steps:setuptoolswheelThe application depends on the following libraries:trimarlib-sysfsgpiotrimarlib-newlandjson-rpcThese dependencies are defined in thesetup.pyinstallation script and therefore should be
automatically satisfied bypip.Building and releasingInvokingmake all(default target) prepares archives for distribution. It is done in two steps:query Git repository for tags (git describecommand) to determine current version and generateversion.pyfile,invoke Python interpreter passingsetup.pyscript to prepare source and wheel distributions.The Python interpreter invoked by theMakefiledefaults topython- it is possible to override it
passing aPYTHONvariable to the command, e.g.make all PYTHON=python3.The release process is automated and based on GitLab CI/CD environment - each commit triggers a build job
which attempts to make and install built packages. If the commit is tagged, the built wheel distribution
is passed to the deployment stage and the runner attempts to upload the package to the repository
specified in project settings.DeploymentInstallation viapip(i.e.pip install trimarlib-brio) is the recommended method of deployment.After the package has been installed it is recommended to perform additional steps:Installgpio-exporter.serviceandgpio.rules- seesysfsgpiolibprojectfor more information;Installbrio.serviceandbrio.iniconfiguration file.The second step is performed using the entry points exposed by the package:brio-install-service- copies the predefined service file to/etc/systemd/system/brio.service, reloadssystemddaemons and enables the service. Runbrio-install-service -hfor more information;brio-install-configuration- copies the default configuration file to the default location.
Runbrio-install-configuration -hfor more information.brio-install- performs the above steps in one go. Runbrio-install -hfor more information.The application is started using another entry point -brio-app. Runbrio-app -hfor more information.VersioningThe project is versioned using a simple pattern based on repository tagging feature. SeeMakefilefor implementation details, for versions available seetags on this repository.UsageSee docstrings for API documentation.Example of using the server in a custom application:frombrioimportServerimporttimeserver=Server()server.configure()server.start()time.sleep(10)server.stop()The application is run using thebrio-appentry point, seeDeploymentfor more information.LicenseThis software is licensed under the MIT License - seeLICENSE.Related documentsThis software conforms to the JSON RPC protocol, seewebsitefor more information.