Skip to content

Conversation

@rwjblue-glean
Copy link
Member

Update related metadata in .speakeasy/gen.yaml so that the pyproject.toml can be autogenerated.

This fixes a number of issues that we have had with speakeasy generation (basically there was no way for the generation to update dependencies, add scripts, etc).

Update related metadata in `.speakeasy/gen.yaml` so that the
`pyproject.toml` can be autogenerated.

This fixes a number of issues that we have had with speakeasy generation
(basically there was no way for the generation to update dependencies,
add scripts, etc).
@rwjblue-glean rwjblue-glean requested a review from a team as a code owner December 9, 2025 23:56
outputModelSuffix: output
packageManager: poetry
packageName: glean
packageName: glean-api-client

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwjblue-glean This looks strange. Isn't the package name supposed to be glean? We publish glean-api-client but the package users import from is glean

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, no, I think this is correct?

If you notice the [tool.poetry] section in pyproject.toml is unchanged:

packages = [
    { include = "glean", from = "src" }
]

AFAICT this is the correct way to do PEP 420 namespaced packages.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tldr; the import path is governed by the file layout in the sdist/wheel (which we haven't changed with this config change).

Landing this change, then running speakeasy run doesn't change anything about the file system layout (happy to push up a branch for you to review just to be safe).

Originally (when we first created the api clients), Speakeasy didn't support PEP 420 namespaced packages but they landed that support a few months back. In this docs they have two settings:

  • moduleName -- this is the expected import path for users (what is shown in the code samples, docs, etc)
  • packageName -- this is what is actually published to pypi

We had a work around (added in #23) that ran speakeasy run then munged a bunch of stuff in order to have the PEP 420 namespacing, but then when Speakeasy added support I updated (in #43) to avoid a really gnarly workaround that we had previously (basically setting the new moduleName field).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k. As long as the imports still work then :shipit:

@rwjblue-glean rwjblue-glean merged commit 5bea34b into main Dec 10, 2025
3 checks passed
@rwjblue-glean rwjblue-glean deleted the rwjblue/re-generate-pyproject.toml branch December 10, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants