Skip to main content

mb.add_package(path_to_package, ...)

Stores a package in Modelbit's package repository for installation into deployment environments. Packages can be .whl files or point to the directory of package's source.

If adding a directory this command will attempt to build the package into a .whl. To make sure your package can be built, run python -m build in the directory containing your package's source.

See adding packages for more information.

Parameters

  • path_to_package: str the filepath to the .whl or a directory containing the package's setup.py or pyproject.toml.
  • force: Optional[bool] set to True to overwrite existing packages with the same version number in Modelbit. Default is False.

Examples

Build and upload a local Python package

mb.add_package("path/to/my/package.whl")

Overwrite the version in Modelbit

mb.add_package("path/to/my/package.whl", force=True)

See also