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.

Changes overview

To evolve with the Python ecosystem and maintain compatibility with current tooling, 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.

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.

The key type safety tools used in the Speakeasy generation process have begun removing Python 3.8 support:

Poetry 2.0 update

The Poetry version 2.0.0 release introduces breaking changes to CLI commands used in the generation process, affecting compatibility with version 1.x. By default, Poetry is installed at the latest version when following the documented installation options.

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

API producers using GitHub Actions (speakeasy-api/sdk-generation-action@v15) with the latest Speakeasy version will have Poetry 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

Consistent with industry practice, the Speakeasy generator will suggest a minor version update for the generated SDK to reflect these Python changes. However, consider releasing the SDK as a major version update if you know your API consumers are likely to be using Python 3.8, which was previously common for some data management SaaS platforms.

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