Package: sila2
:warning: On 2021-11-15, this project replaced a legacy Python implementation of SiLA 2. That project can be foundhereand is still installable viapip install sila2lib.SiLA 2 Python ImplementationSiLA Homepagehttps://sila-standard.comChat groupJoin the group on SlackMaintainerNiklas Mertsch(@NMertsch)MaintainerMark Doerr(@markdoerr)Getting startedInstallationUsepip install sila2to install the latest release of the library.There are optional dependencies:pip install sila2[codegen]is required for code generation but not for running SiLA Servers or Clientspip install sila2[cryptography]is required for auto-generating self-signed SSL certificates on server startup, and for additional certificate validation steps by the clientOn Raspberry Pi systems, run the following to fix someImportErrors:pip uninstall -y lxml grpcio grpcio-toolssudo apt install -y python3-lxml python3-grpcio python3-grpc-toolsDocumentationA documentation on SiLA Server generation, feature implementation, and usage of SiLA Clients can be foundhere.ExampleThe directoryexample_servercontains an example SiLA Server application.example_client_scriptscontains multiple SiLA Client programs that interact with the example server.Implementation statusMissing parts from SiLA 2 specificationLifetime handling for binary transfercurrently, large binaries are only deleted on requestServer-initiated connection (SiLA 2 v1.1)currently, only client-initiated connections are supportedDeviations from SiLA 2 specificationDurationis rounded to microseconds, becausedatetime.timedeltadoes not support sub-microsecond precisionMicroseconds ofdatetime.timeanddatetime.datetimeare ignored sinceTimeandTimestampdon't support sub-second precisionContributingContributions in the form ofissues,feature requestsand merge requests are welcome. To reduce duplicate work, please create an issue and state that you are working on it before you spend significant time on writing code for a merge request.DevelopmentMulti-stage build processBecause thesila2.featuressubmodule is auto-generated using the code generator included in this library, the build process has multiple steps:Install the library withoutsila2.featureUse the scriptgenerate-feature-submodule.pyto generatesila2.featureInstall againDevelopment toolsThis project uses the following tools to improve code quality:rufffor code formatting and lintingpytestfor testingpytest-covfor measuring code coverageThe following Python scripts are provided to guide the development process:run-formatting.pyappliesruff formatandruff check --select I --fix .run-checks.pychecks for formatting and code style problems, and runs the testsinstall-pre-commit-hook.pyinstalls apre-commitgit hookto automatically execute a fast-running subset of all checks on each commitTo install all these tools, usepip install .[dev].Documentation build processTo build the documentation, first install this library withpip install .[docs], the rundocs/make-docs.py.
The HTML documentation can then be found atdocs/_build/htmlSetup codeThe full development setup using thesetuptools development modelooks like this:# clone repositorygitclone--recurse-submoduleshttps://gitlab.com/sila2/sila_pythoncdsila2# install sila2 in development modepipinstall-e.[full]# install without sila2.feature submodule and all optional dependenciespythongenerate-feature-submodule.py# generate sila2.feature code (generates src/sila2/feature/...)# build documentation (generates docs/_build/html)pythondocs/make-docs.py# install example server in development mode (required for tests)pipinstall-eexample_server# run test suitepythonrun-checks.py# run code formattingpythonrun-formatting.py# install git pre-commit hook (generates .git/hooks/pre-commit)pythoninstall-pre-commit-hook.py# build wheel and source distribution (generates build/ and dist/)pipinstallbuild
python-mbuild-ws