- Do not run
ruff format .. CI runs onlyruff check .. The codebase is not ruff-formatted, so a repo-wide format produces a large unrelated diff. Match surrounding formatting by hand. - Python floor compatibility.
- Where the version lives. The floor is the
pythonconstraint under[tool.poetry.dependencies]inpyproject.toml..ruff.tomltarget-versionand thetest.ymlmatrix hard-code their own versions and do not follow it, so check all three agree, and raise a mismatch rather than fixing CI or ruff config yourself (Ask First). - CI coverage. The CI matrix pins the minor version only, so it tests the latest patch release, not the exact floor patch.
- Syntax limits. Avoid syntax newer than the floor.
- Where the version lives. The floor is the
- Async tests need
@pytest.mark.asyncio.- Why. No
asyncio_modeis set inpyproject.toml, so pytest-asyncio runs in strict mode and ignores an unmarked async test. - Symptom. Depending on the pytest version it fails with an "async def functions are not natively supported" message or is skipped with a warning. If a new async test fails that way or shows as skipped, check the marker first.
- Why. No
- Two dependency lists.
- Installs.
pyproject.toml+poetry.lockdrive installs. - Snyk scan.
requirements.txtis a hand-maintained partial list (authlib,httpx,ada-url,freezegun, and the pytest packages, withoutcryptography,jwcrypto,requestsorruff) that only the Snyk SCA workflow reads. Changing one without the other leaves the scan out of date.
- Installs.
custom_fetchcovers only discovery and JWKS.- Discovery and JWKS.
fetch_oidc_metadataandfetch_jwks(utils.py) use the integrator'scustom_fetchwhen set. Otherwise they create a plainhttpx.AsyncClient(), which uses the httpx default timeout of 5 seconds (httpx 0.28.1 inpoetry.lock), sooptions.timeoutdoes not apply to them. - Token endpoint calls. The calls in
get_access_token_for_connection,get_token_by_exchange_profile, andget_client_credentials_tokenalways build their ownhttpx.AsyncClientwithoptions.timeout. - Telemetry headers. The default client and the token endpoint calls also send
self._telemetry_headers(Auth0-Client,User-Agent), butcustom_fetchis called with the URL only and receives none of them. - For new HTTP paths. Do not assume a new path inherits the timeout or the telemetry headers of another. Pick the matching pattern deliberately.
- Discovery and JWKS.
- Imports must be at module top level.
.ruff.tomlenforcesPLC0415, so an import inside a function failsruff check .. Move it to the top of the file. For an import needed only in type annotations, useif TYPE_CHECKING:asconfig.pydoes. - Stale local venvs. A hand-made venv in the working tree (anything other than Poetry's) may not have the package or dev dependencies installed. Use
poetry installthenpoetry run ...so you test the same environment CI does.