Package: crl.devutils
Guide for developing Common Robot Libraries (CRL) via crl.devutilsDocumentationDocumentation for crl.devutils can be found fromRead The Docs.SetupFirst, install crl.devutils.$pipinstallcrl.devutilsNow, there is availablecrldevelopment command line:$crl-lAvailabletasks:cleanCleanworkspace.create_docsCreatebothRobotFrameworkandSphinxdocumentation.create_indexCreateanindexwithgivenbasescreate_setupCreateinitialsetup.pyintocurrentdirectoryfromlibraryname.delete_indexDeleteanindexhelpShowhelp,basicallyanaliasfor--help.publish*DEPRECATED*Publishversionfromagivenindextoanotherindex.sdistCreatesourcedistribution.set_versionSetversionin./src/crl/<libname>/_version.py`.tag_releaseTagspecifiedrelease.tag_setup_versionTagspecifiedrelease.testUploadscontentsofcurrentworkspacetodevpiandrunstoxtests.NOTE that some of the commands have been deprecated and should not be used.This tool is based on invoke 3rd party Python module and more details can be
found by running commandcrl help. Please usecrlinstead ofinvokeeven
though the help shows this differently.Thecrltasks glue the git tags and the package distribution versions
together behind the scenes.Using the CRL devpi serverFor using the test command you need the devpi server. If you do not have devpi,
you need to install and configure it. See instructions on how toConfigure
Devpi.Before using the test command you should also configure the devpi index that is
to be used as the base index of the library.Here devpi is configured to use the imaginaryhttps://example.devpi.com/user/indexsimple index.$devpiusehttps://example.devpi.com/user/index/+simple--set-cfgcurrentdevpiindex:https://example.devpi.com/crl/prod(loggedinas<username>)~/.pydistutils.cfg:https://example.devpi.com/user/index/+simple/~/.pip/pip.conf:https://example.devpi.com/user/index/+simple/~/.buildout/default.cfg:https://example.devpi.com/user/index/+simple/always-set-cfg:noUsing the Test EnvironmentIf there is a [testenv:test] in the library’s tox.ini, you can use this to
test your work. This runs the same tests as tox, but also uploads the current
workspace contents to a development index. Also, this is the way tests are
run in CI, so you might want to simulate the CI run to avoid problems later.If the library’s tox.ini doesn’t have the test environment, it can be added
easily by adding the following lines into the tox.ini file:[testenv:test]changedir={toxinidir}deps=crl.devutilscommands=crltest--no-virtualenv{posargs}WarningDependency package list to this test environment may vary according
to the library’s needs.First, login to the devpi server. Now you can load development indexes under
your personal user index.$PYPI=https://example.devpi.com/user/index$tox-etest---b${PYPI}-t<test-indexname>--verboseThe above command saves the tests and contents tohttps://example.devpi.com/<username>/<test-indexname>.Working without thecrlnamespaceIf the library shall not be incrlnamespace, then the version file path has
to be given relatively.For example:$tox-etest-i${PYPI}/+simple--\-tCRL-92\-psrc/examplelib/_version.py\-shttps://example.devpi.com/<username>/<srcindexname>\-dhttps://example.devpi.com/<username>/<destindexname>The tagging of the version commmand has to also contain the path to version
file. For example:$crltag_release\--pathtoversionfilesrc/examplelib/_version.py0.6.10.dev201612050621Creating a new CRL libraryCreating a new CRL library is done with a dedicated Jenkins jobCreate New CRL
Library. The job creates the library structure from a template and generates
all the needed Jenkins jobs for the library.Creating DocumentationThecrltool provides two alternatives for the documentation of the test
library:crl create_docsandcrl publish.Now, thecrl create_docsis a standalone tool for generating documentation
during the development. If documentation is done so that asphinxdocsdirectory exists,crl publishtool automatically uploads the documentation
more or less the same produced bycrl create_docstool. It is recommended
thatcrl create_docswill be integrated totoxin order to verify
documentation generation, as well as producing it in the CI e.g. via Jenkins
jobs for each commit to git.Adding docs environment for tox.ini. Remember to add the docs environment to
theenvlist.[testenv:docs]deps=sphinxcrl.devutilsrobotframeworkcommands=crlcreate_docs-vWarningDependency package list for docs environment may vary according to the
library’s needsIn order to generate documentation for your library with robot.libdoc you
should:createrobotdocs/robotdocsconf.py, with content like below:robotdocs={'crl.examplelib.examplelib':{'docformat':'rest','synopsis':'Example of test library functions.'},'crl.examplelib.examplelib.Example':{'args':['example'],'docformat':'rest','synopsis':'Example of test library class.'}}add relative path of yourrobotdocsdirectory to ‘html_extra_path’ insphinxdocs/conf.py:html_extra_path=['../robotdocs']it is also recommended to set page width to 90% in ‘html_theme_options’ insphinxdocs/conf.pyhtml_theme_options={'page_width':'90%'}Libraries using crl.devutils processLibraries providing Robot Framework test librariesLibraryDescriptioncrl-interactivesessionsRemote command and file management via pexpectcrl-remotescriptRemote command and file management via paramiko and trilead-sshcrl-remotesessionWrapper ofcrl-interactivesessionsandcrl-remotescriptRobot Framework robot command wrappersLibraryDescriptioncrl-rfcliPython path setter and parser of test target filecrl-threadverifyRobot run verifier for hanging threadsDevelopment librariesLibraryDescriptioncrl-devutilsDevelopment tools for CRLcrl-examplelibExample library template for CRLGeneric helper librariesLibraryDescriptionfixtureresourcesPytest fixturessphinx-invokeSphinx extension for invoke tasksvirtualenvrunnerPython Virtualenv creator and command executorUseful LinksConfigure DevpiCreate New CRL LibraryContributingPlease seecontributingfor development and contribution practices.Thecodeand theissuesare hosted on GitHub.The project is licensed underBSD-3-Clause.