Thank you, in advance, for your pull requests!
Make sure your python is Python 3.9 or later:
python --versionInstall build and test dependencies:
python -m pip install -r requirements.txtInstall mypy types:
python -m mypy --install-typesTo build use the build.sh script:
./build.sh./lint.shTo install build wheel (also calls ./build.sh)
./install.shTo install as editable for dev testing without having to reinstall between changes:
./install-dev.shTo build the docs from source code:
./build-docs.pyNOTE: the files generated by the above script, are in .gitignore
After running the build-docs.py script, you can verify that the docs look correct by starting the mkdocs server:
mkdocs serve...and browsing to the url shown in the console (http://127.0.0.1:8000/)
./deploy-docs.shbasic_bot uses several third-party components to produce the docs that eventually get published to GitHub.io at https://littlebee.github.io/basic_bot/
- MkDocs
- mkdocs-material - provides the Material UI style pattern to our docs.
- pydoc-markdown - used to extract the doc-strings from the basic_bot Python code, modules, and functions, into individual files.
Several scripts are provided in the basic_bot root dir for document build and deploy.
./deploy-docs.shwill first call./build-docsto build the /docs directory. Then, it leverages themkdocs gh-deploycommand provided by MkDocs to publish the prepared documentation to GitHub Pages../build-docs.shis used to build the markdown docs, in the./docsdirectory. It crawls several subdirectories in the src/basic_bot directory and uses [pydoc-markdown] to extract the Python docstrings from .py files into the docs/**.md files. It also looks for all README.md files in the directories scanned and includes those in the docs/. The root README.md is also copied to the docs and becomes the "Getting Started" landing page of the documentation.
Run the main test.sh script from the project root dir:
./test.sh...will run all of the tests in test/integration_tests and test/e2e_tests
https://yakworks.github.io/docmark/cheat-sheet/
- need a blank line before the dash or asterisk
It is easier to start with an empty logs dir. From the root of your project dir:
rm -Rf logs/*You can make the test failure output more readable and narrow the tests to run a
single test using pytest -vv and pytest -k respectively. For example:
pytest -vv tests/integration_tests/test_central_hub.py -k test_connect_identifyThe -s argument to pytest can be used to see prints to stdout from the test file as it runs instead of only on fail.
You can dump all logs to a screen and quickly look for errors. It's easier to read if only running one test. To figure out which service a specific line was output to, scan up in the logs for identity
cat logs/*Click into the details of the CICD run. Look for the "Run Tests" task and open it. Scroll to the bottom of the test output to find the failing test.
Sometimes it may not be obvious what failed from the test output. Below the "Run Tests" step is the "Upload log artifacts" step. Open it and you should see a link at the bottom labled "Artifact download URL:" Click on it to download. Unzip and inspect logs.