Package: cortex-python
Python Module for the Cortex Cognitive PlatformThe Cortex Python module provides an API client library to easily integrate with the Cortex Cognitive Platform.
Refer to the Cortex documentation for details on how to use the library:Developer guide:https://cognitivescale.github.io/cortex-fabric/Cortex Python references:https://cognitivescale.github.io/cortex-python/master/InstallationTo install:> pip install cortex-pythonor from source code:> git clone git@github.com:CognitiveScale/cortex-python.git
  > cd cortex-python
  > pip install -e .To install the optional components:> pip install cortex-python[viz]
  > pip install cortex-python[jupyter]DevelopmentSetupWhen developing, it's a best practice to work in a virtual environment. Create and activate a virtual environment:> virtualenv --python=python3.10 _venv
  > source _venv/bin/activateInstall developer dependencies:> git clone git@github.com:CognitiveScale/cortex-python.git
  > cd cortex-python
  > make dev.installRun Developer test and linting tasks:
Three types of checks are configured for this:symilar- to test code duplicationpylint- for lintingpytest- for running the unit tests. These are orchestrated throughtox. The tox configuration is available attox.iniThere's a convenienceMakefilethat has commands to common tasks, such as build, test, etc. Use it!TestingUnit TestsFollow above setup instructions (making sure to be in the virtual environment and having the necessary dependencies)make testto run test suiteTo run an individual file or class method, use pytest. Example tests shown below:file:pytest test/unit/agent_test.pyclass method:pytest test/unit/agent_test.py::TestAgent::test_get_agentPublishing an alpha buildSuppose you want to release new functionality so it can be installed without releasing a new official version. We need to use an alpha version in PyPi.we need to create and publish an alpha release:get credentials to thecortex-pythonpypi CognitiveScale account (via lastpass)runmake dev.push. The alpha pre-release number (the N in X.Y.ZaN) with be determined automatically.ContributionAfter contributing to the library, and before you submit changes as a PR, please do the followingRun unit tests viamake testManually verification (i.e. try the new changes out in Cortex) to make sure everything is going well. Not required, but highly encouraged.Bump upsetup.pyversion and update theCHANGELOG.mdDocumentationActivate your virtual environment:> source _venv/bin/activateSet up your environment, if you have not done so:> make dev.installThe package documentation is built with Sphinx and generates versioned documentation for all tag matching therelease/X.Y.Zpattern and for themasterbranch. To build the documentation:> make docs.multiThe documentation will be rendered in HTML format under thedocs/_build/${VERSION}directory.Pre-release to stagingCreate and push an alpha release:> make dev.pushThis will build an alpha-tagged package.Mergedeveloptostagingbranch:> make stageIn GitHub, create a pull request fromstagingtomaster.TODOextending the client with helpers for cortex resourcescamelcase in pylinyrcUpdate all documentation with proper Sphinx formattingMost of the major modules have been fixed except skill.py, model.pyuse exceptions defined incortex/exceptions.pyintegrate the cortex-python-profiles package back into the python SDK