Repository navigation
SDK Developer Guide ‐ 2025
Before starting, install the following tools locally:
pip install --upgrade pip setuptools wheel twine build
pip install packaging==22- Clean Up Existing Build Artifacts Before proceeding with the build, ensure all old artifacts are removed to avoid conflicts:
rm -rf dist/ build/ *.egg-infoWhy? Cleaning the dist, build, and .egg-info directories eliminates outdated files that could interfere with the new build process. This ensures your distribution starts from a clean slate.
- Build the Distribution File Generate the source distribution and wheel package:
python setup.py sdist bdist_wheelWhy? This command creates the required distribution formats for your SDK, ensuring compatibility with PyPI.
- Validate the Distribution
Run a
twinecheck to verify the distribution files:
twine check dist/*Expected Outcome: The check should pass without errors. If issues are detected, resolve them before continuing.
Why? Validation ensures that the generated packages meet PyPI's requirements, avoiding upload failures.
- Test the Package on TestPyPI Before uploading to PyPI, test your package on the TestPyPI domain:
- URL: TestPyPI
- Authentication: Note that credentials for TestPyPI are different from PyPI.
Upload the package to TestPyPI for testing:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*Install the uploaded package from TestPyPI to confirm functionality:
pip install --index-url https://test.pypi.org/simple/ <package-name>Why? Testing on TestPyPI allows you to identify and fix any issues in a sandbox environment before publishing to the official PyPI repository.
- Run Tests Navigate to your test folder and execute all test cases:
pytest tests/Key Notes:
- Tests should be independent of each other
- Ensure all tests pass before proceeding
Why? A successful test run guarantees that the new version of your SDK works as expected and is ready for release.
- Raise a Pull Request Once all tests pass:
- Commit your changes
- Raise a pull request (PR) for review
Why? This enables peer review, ensuring code quality and compliance with your team's standards.
- Merge and Release When the PR is approved and merged, the release process is triggered automatically.
Why? Automating the release process minimizes human errors and ensures consistent deployment.
Use Semantic Versioning (MAJOR.MINOR.PATCH format) for version updates:
- MAJOR: Increment for incompatible API changes
- MINOR: Increment for backward-compatible functionality
- PATCH: Increment for backward-compatible bug fixes
Example:
For version `1.0.0`:
* `1`: First stable, production-ready release
* `0.0`: No minor or patch updates yet
Important: If the version number remains unchanged, the release will fail because PyPI rejects duplicate versions. Always verify and increment your version number appropriately.
Important: If there are any backend changes in the model, serializer, etc. please come and change it in the SDK as well. If not done, will lead to outage and issues being raised on our issues tab of SDK page.
- Pre-requisites installed
- Old build artifacts removed
- Distribution files built and validated
- Package tested on TestPyPI
- All tests passed
- Version number updated
- Pull request raised and approved
Following this guide ensures your SDK releases are reliable, professional, and aligned with best practices.