Poetry 2.0 and Python 3.9 Updates

This guide covers important updates to the Python SDK generation process related to Poetry 2.0 and Python 3.9 requirements.

Steps Overview

Two significant changes are being implemented in the Python SDK generation process:

  1. The minimum Python version for generated Python SDKs is changing from 3.8 to 3.9
  2. Poetry packaging tool is being updated to version 2.0.0

These changes are necessary to evolve with the Python ecosystem and maintain compatibility with current tooling.

Python 3.9 Requirement

Python 3.8 reached end-of-life (EOL) status in October 2024 and is no longer supported by the Python language maintainers for security and bug fixes. The last bug fix update was in May 2021, and the last security update was in September 2024.

Key type safety tools used by our generation process have begun removing Python 3.8 support:

Poetry 2.0 Update

Poetry has released a major version update (2.0.0) that includes breaking changes between 1.x and 2.x for CLI commands used in the generation process. By default, following the documented installation options, Poetry is installed at the latest version.

Local Development Updates

API producers running generation locally will need to update Poetry to the new major version. The update process depends on your installation method:

# If installed via pipx
pipx upgrade poetry
# If installed via the official installer
poetry self update

If Poetry is not updated, the generator will output a dependency version error:

WARN can't compile - Dependency Version Mismatch - Install Poetry by following the instructions at https://python-poetry.org/docs/#installing-with-pipx.
ERROR dependency version not met -- poetry - version 1.8.5 is less than required version 2.0.0
FATAL Failed to generate SDK to XXX

GitHub Actions Configuration

For API producers using GitHub Actions (via speakeasy-api/sdk-generation-action@v15) with the latest Speakeasy version, Poetry will be automatically updated. No changes are needed for the most common usage.

If the Speakeasy version is pinned to an older version, add the poetry_version input to the repository’s workflow configuration to pin Poetry to the older major version:

uses: speakeasy-api/sdk-generation-action@v15
with:
# ... other existing inputs ...
poetry_version: "1.8.5"

Version Update Considerations

The generator will suggest these Python changes as a minor version update to the generated SDK, following typical industry practice. However, API producers may want to consider releasing the SDK as a major version update if they know their API consumers are particularly prone to be running on Python 3.8, which was previously common for some data management software as a service platforms.

If you have any questions please reach out on Slack (opens in a new tab).