* feat: create scripts to generate repo assets * move script * publish.md * deletes unmaintained .md files * ruff * pylint * fix: website urls * fix: website urls * rename script * renames * create folder * mypy * PyDocstyle * fix: descriptions & websites * camelCase * change json structure * logo url * reprName * finra * logos * logo * logo * logo * logo * pylint --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
4.0 KiB
Vendored
Publishing to PyPI
Pre-release procedure
Warning
The
releasebranch is solely for the purpose of publishing the package(s)! Any last minute changes should be made in appropriate PRs and merged to thedevelopbranch. Once thereleasebranch is created, thedevelopbranch should be frozen for further commits.
A
releasebranch for a particular package should only cater to the changes for that package directory. For e.g. therelease/openbb-core-2.0.0branch should only contain changes for theopenbb-corepackage i.e. in theopenbb_platform/coredirectory.
-
Open a PR with the changes to be published in the format
release/<version>(for e.g.release/4.0.0). For a particular package use the formatrelease/<package>-<version>(for e.g.release/openbb-core-1.0.1). -
Ensure all the CI workflows pass.
-
Ensure all unit tests pass:
pytest openbb_platform -m "not integration" -
Ensure all integration tests pass:
pytest openbb_platform -m integration -
Run
python -c "import openbb; openbb.build()"to build the static assets. Make sure that only required extensions are installed.Note
: Run
python -c "import openbb"after building the static to check that no additional static is being built. -
Finally, check if everything works:
- Install the packages locally using
python openbb_platform/dev_install.pycommand and test them in a new environment. - Check if all the
pyproject.tomlfiles are correct, including theopenbb_platformone. - Double check if there is any new extension or provider that needs to be added to integration tests GitHub Action workflow.
- Install the packages locally using
Release procedure
Ensure you have the appropriate credentials and permissions to publish to PyPI.
-
Run the following commands for publishing the packages to PyPI:
Consider using the
--dry-runflag to check if everything is correct before publishing. Also, it might be a good idea to run the script in batches to ensure that the packages are published correctly and the dependencies pick the correct versions.For a single package release, the following steps are optional since the package can be bumped manually.
- For the core package run:
python build/pypi/openbb_platform/publish.py --core - For the extension and provider packages run:
python build/pypi/openbb_platform/publish.py --extensions - For the
openbbpackage - which requires manual publishing - do the following- Bump the dependency package versions
- Re-build the static assets that are bundled with the package
- Run unit tests to validate the existence of deprecated endpoints
- Run
poetry publish --buildfromopenbb_platform - Run
poetry lockfromopenbb_platform
Tip
Note that, in order for packages to pick up the latest versions of dependencies, it is advised to clear the local cache of the dependencies:
We can do that with
pip cache purgeandpoetry cache clear pypi --allAlso, sometimes there might be some delay in the PyPI API, so it might be necessary to wait a few minutes before publishing the next package.
- For the core package run:
-
Merge the
release/<package>-<version>branch to themainbranch. -
Check the
Deploy to GitHub PagesGitHub action is completed successfully. Go to the docs website to see the changes.
Post-release procedure
- Install the packages on Google Colaboratory via PyPi and test to check if everything is working as expected.
- Install the packages in a new environment locally via PyPi and test to check if everything is working as expected.
- Regenerate assets for external use by running
python assets/scripts/generate_extension_data.py - Open a new PR with the
release/<package>-<version>branch pointing to thedevelopbranch. - Merge the
release/<package>-<version>branch to thedevelopbranch. - If any bugs are encountered, create a new branch -
hotfixformainandbugfixfordevelopand merge them accordingly.