A Python client for interacting with the MPT API.
- Docker and Docker Compose plugin (
docker composeCLI) make- CodeRabbit CLI (optional. Used for running review check locally)
Common development workflows are wrapped in the Makefile. Run make help to see the list of available commands.
The project uses a modular Makefile structure that organizes commands into logical groups:
- Main Makefile (
Makefile): Entry point that automatically includes all.mkfiles from themake/directory - Modular includes (
make/*.mk): Commands are organized by category:common.mk- Core development commands (build, test, format, etc.)repo.mk- Repository management and dependency commandsmigrations.mk- Database migration commands (Only available in extension repositories)external_tools.mk- Integration with external tools
You can extend the Makefile with your own custom commands creating a local.mk file inside make folder. This file is
automatically ignored by git, so your personal commands won't affect other developers or appear in version control.
Follow these steps to set up the development environment:
git clone <repository-url>cd mpt-api-python-clientCopy the sample environment file and update it with your values:
cp .env.sample .envEdit the .env file with your actual configuration values. See the Configuration section for details on available variables.
Build the development environment:
make buildThis will create the Docker images with all required dependencies and the virtualenv.
Run the test suite to ensure everything is configured correctly:
make testYou're now ready to start developing! See Running the client for next steps.
Before running, ensure your .env file is populated.
make runUseful helper targets during development:
make bash # open a bash shell in the app container
make check # run ruff, flake8, and lockfile checks
make check-all # run checks and tests
make format # auto-format code and imports
make review # check the code in the cli by running CodeRabbitThe following environment variables are typically set in .env. Docker Compose reads them when using the Make targets described above.
| Environment Variable | Default | Example | Description |
|---|---|---|---|
MPT_API_BASE_URL |
- | https://portal.softwareone.com/mpt |
SoftwareONE Marketplace API URL |
MPT_API_TOKEN |
- | eyJhbGciOiJSUzI1N... | SoftwareONE Marketplace API Token |
| Environment Variable | Default | Example | Description |
|---|---|---|---|
MPT_API_TOKEN_CLIENT |
- | eyJhbGciOiJSUzI1N... | SoftwareONE Marketplace API Client Token |
MPT_API_TOKEN_OPERATIONS |
- | eyJhbGciOiJSUzI1N... | SoftwareONE Marketplace API Operations Token |
MPT_API_TOKEN_VENDOR |
- | eyJhbGciOiJSUzI1N... | SoftwareONE Marketplace API Vendor Token |
RP_API_KEY |
- | pytest_XXXXXXXXXXXXXX | ReportPortal API key |
RP_ENDPOINT |
- | https://reportportal.example.com |
ReportPortal endpoint |
RP_LAUNCH |
- | dev-env |
ReportPortal launch |