If you are would like to use the SDK then please see the documentation or try an example.
This README is designed for developers who are building or contributing to the SDK.
The easiest way (if you have Docker installed) is to first build the docker image:
docker build -t rfcx-sdk-python .
Then run scripts directly, for example:
docker run -it --rm -v ${PWD}/package-rfcx:/usr/src/app rfcx-sdk-python python example.py
Or run a terminal and execute scripts inside the container:
docker run -it --rm -v ${PWD}/package-rfcx:/usr/src/app rfcx-sdk-python bash
python example.py
(Scripts like example.py in the root directory can import rfcx
from the source -- making it easy to develop new SDK features.)
To build a new version:
-
Increment the version in the package setup.py files (for whichever package you want to distribute, e.g.
package-rfcx/setup.py
orpackage-rfcxtf/setup.py
). -
Remove existing files
rm -r package-rfcx*/dist
-
Create a distribution (source and wheel) through docker for each package you want to distribute:
docker run -it --rm -v ${PWD}/package-rfcx:/usr/src/app rfcx-sdk-python python setup.py sdist bdist_wheel
docker run -it --rm -v ${PWD}/package-rfcxtf:/usr/src/app rfcx-sdk-python python setup.py sdist bdist_wheel
docker run -it --rm -v ${PWD}/package-rfcxutils:/usr/src/app rfcx-sdk-python python setup.py sdist bdist_wheel
-
Upload to PyPI:
First time only, install twine
pip install --user --upgrade twine
Then
twine upload package-rfcx*/dist/*
(or if it fails to find twine thenpython -m twine upload package-rfcx*/dist/*
)Enter your username and password.
docker run -it --rm -v ${PWD}:/usr/src/app rfcx-sdk-python python package-rfcxutils/setup.py test
Simple test: pip install --no-deps rfcx
Better test:
- Create a new notebook/colab
- Run the following code:
!pip install rfcx import rfcx rfcx.name
The documentation is generated from docstrings in the source code. To generate it, you have to build an image:
docker build -t rfcx-sdk-python .
and then run:
docker run -it --rm -v ${PWD}:/usr/src/app rfcx-sdk-python pdoc3 --html --force --template-dir docs_src/template --output-dir docs package-rfcx/rfcx package-rfcxtf/rfcxtf package-rfcxutils/rfcxutils
Note: For windows, please switch to linux base terminal or Powershell before running the command
To generate a PDF:
docker run -it --rm -v ${PWD}:/usr/src/app rfcx-sdk-python pdoc3 --pdf --force --template-dir docs_src/template package-rfcx/rfcx package-rfcxtf/rfcxtf package-rfcxutils/rfcxutils > docs.md
docker run --rm -v ${PWD}:/data pandoc/latex docs.md -o docs.pdf