Skip to content

fix(postgres): add py.typed marker to postgres module - #849

Merged
Tranquility2 merged 3 commits into
testcontainers:mainfrom
oliverlambson:main
Apr 4, 2026
Merged

fix(postgres): add py.typed marker to postgres module#849
Tranquility2 merged 3 commits into
testcontainers:mainfrom
oliverlambson:main

Conversation

@oliverlambson

@oliverlambsonoliverlambson commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

It's already fully typed, just not marked as such

@codecov

codecovBot commented Jul 23, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.05%. Comparing base (58459a1) to head (2eeb1ad).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #849 +/- ##
=======================================
Coverage 83.05% 83.05% =======================================
Files 16 16 Lines 1700 1700 Branches 186 186 =======================================
Hits 1412 1412 Misses 234 234 Partials 54 54 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tranquility2

Tranquility2 commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Not sure this is ready:
poetry run mypy --config-file pyproject.toml modules/postgres/testcontainers/postgres/

modules/postgres/testcontainers/postgres/__init__.py:48: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
def __init__(
^
modules/postgres/testcontainers/postgres/__init__.py:60: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")
[assignment]
self.username: str = username or os.environ.get("POSTGRES_USER", "test")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/postgres/testcontainers/postgres/__init__.py:61: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")
[assignment]
self.password: str = password or os.environ.get("POSTGRES_PASSWORD", "test")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/postgres/testcontainers/postgres/__init__.py:62: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")
[assignment]
self.dbname: str = dbname or os.environ.get("POSTGRES_DB", "test")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/postgres/testcontainers/postgres/__init__.py:73: error: Incompatible default for argument "driver" (default has type "object", argument has type
"Optional[str]") [assignment]
def get_connection_url(self, host: Optional[str] = None, driver: Optional[str] = _UNSET) -> str:
^~~~~~
Found 5 errors in 1 file (checked 1 source file)

Maybe some stuff moved since this original commit?

@Tranquility2Tranquility2 changed the title fix(modules): add py.typed marker to postgres modulefix(postgres): add py.typed marker to postgres moduleApr 4, 2026
@Tranquility2
Tranquility2 merged commit c8a5bbd into testcontainers:mainApr 4, 2026
13 checks passed
alexanderankin added a commit that referenced this pull request Apr 7, 2026
🤖 I have created a release *beep* *boop*
---
##
[4.15.0-rc.1](testcontainers-v4.14.2...testcontainers-v4.15.0-rc.1)
(2026-04-07)
### Features
* **compose:** add structured container inspect information
([#897](#897))
([58459a1](58459a1))
* **core:** support SSH-based DOCKER_HOST
([#993](#993))
([d48115d](d48115d))
* **generic:** Reintroducing the generic SQL module
([#892](#892))
([2ca2321](2ca2321))
* **keycloak:** support for relative path and management relative path
([#982](#982))
([898faf6](898faf6))
* **mqtt:** MosquittoContainer: Add version 2.1.2
([#978](#978))
([af382f7](af382f7))
### Bug Fixes
* **azurite:** make visible to type checkers
([#927](#927))
([baa5668](baa5668))
* **clickhouse:** add `HttpWaitStrategy` instead of deprecated
`wait_container_is_ready`
([#962](#962))
([8034541](8034541))
* **compose:** return type in get_service_port docstring
([#939](#939))
([fed65fe](fed65fe))
* **core:** Refactor copy file
([#996](#996))
([0e0bb24](0e0bb24))
* **core:** wait for ryuk more reliably, improve tests: long_running,
filter logs
([#984](#984))
([b12ae13](b12ae13))
* **generic:** Migrate ServerContainer from deprecated decorator to
HttpWaitStrategy
([#971](#971))
([460b0d8](460b0d8))
* **kafka:** Use wait strategy instead of deprecated wait_for_logs
([#903](#903))
([87332c1](87332c1))
* **postgres:** add py.typed marker to postgres module
([#849](#849))
([c8a5bbd](c8a5bbd))
* **qdrant:** migrate Qdrant from deprecated decorator.
([#963](#963))
([407f798](407f798))
* **redis:** Use wait strategy instead of deprecated decorator
([#914](#914))
([e25713a](e25713a))
* **sftp:** Avoid using wait_for_logs in module.
([#995](#995))
([83157eb](83157eb))
---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Co-authored-by: David Ankin <daveankin@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@oliverlambson@Tranquility2