From d3f2a02dea9c25154942e71e9446bc0075f14576 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Tue, 9 Dec 2025 18:36:31 -0500 Subject: [PATCH 1/2] fix: Remove `pyproject.toml` from `.genignore` 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). --- .genignore | 1 - .speakeasy/gen.yaml | 4 ++-- pyproject.toml | 34 +++++++++++++++++++++------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.genignore b/.genignore index 7b2511e4..e69de29b 100644 --- a/.genignore +++ b/.genignore @@ -1 +0,0 @@ -pyproject.toml \ No newline at end of file diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index bad83ffd..aec456a6 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -40,7 +40,7 @@ python: - input asyncMode: both authors: - - Speakeasy + - Glean Technologies, Inc. baseErrorName: GleanBaseError clientServerStatusCodesAsErrors: true defaultErrorName: GleanError @@ -69,7 +69,7 @@ python: moduleName: glean.api_client outputModelSuffix: output packageManager: poetry - packageName: glean + packageName: glean-api-client pytestFilterWarnings: [] pytestTimeout: 0 responseFormat: flat diff --git a/pyproject.toml b/pyproject.toml index 68924c61..e2161265 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,21 +1,26 @@ + [project] name = "glean-api-client" version = "0.11.22" description = "Python Client SDK Generated by Speakeasy." -authors = [{ name = "Glean Technologies, Inc." }] -license = "MIT" -# NOTE: scripts/prepare_readme.py tweaks this to point to README-PYPI.md for publication -# The published readme has relative URLs converted to absolute URLs for PyPI compatibility -readme = "README.md" -requires-python = ">=3.9" -dependencies = ["httpx >=0.28.1", "pydantic >=2.11.2"] +authors = [{ name = "Glean Technologies, Inc." },] +readme = "README-PYPI.md" +requires-python = ">=3.9.2" +dependencies = [ + "httpcore >=1.0.9", + "httpx >=0.28.1", + "pydantic >=2.11.2", +] [tool.poetry] -packages = [{ include = "glean", from = "src" }] -include = ["py.typed", "src/glean/py.typed"] +repository = "https://github.com/gleanwork/api-client-python.git" +packages = [ + { include = "glean", from = "src" } +] +include = ["py.typed", "src/glean/api_client/py.typed"] [tool.setuptools.package-data] -"*" = ["py.typed", "src/glean/py.typed"] +"*" = ["py.typed", "src/glean/api_client/py.typed"] [virtualenvs] in-project = true @@ -23,9 +28,10 @@ in-project = true [tool.poetry.group.dev.dependencies] mypy = "==1.15.0" pylint = "==3.2.3" -pytest = "^8.3.4" -pytest-asyncio = "^0.25.3" -pytest-xdist = "^3.6.1" +pyright = "==1.1.398" +pytest = "^8.4.1" +pytest-asyncio = "==1.2.0" +pytest-xdist = "^3.8.0" [build-system] requires = ["poetry-core"] @@ -51,3 +57,5 @@ ignore_missing_imports = true [tool.pyright] venvPath = "." venv = ".venv" + + From 0aa9a7381369795e7ed102842ff647a65b5b002a Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Tue, 9 Dec 2025 18:36:31 -0500 Subject: [PATCH 2/2] chore(ci): Ensure README-PYPI.md is created before tests run --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7b040e69..d5fcb714 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -26,6 +26,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: "Ensure README-PYPI.md is created" + run: python scripts/prepare_readme.py + # run the glean target specified in .speakeasy/workflow.yaml - run: speakeasy test --target glean