Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(modules): Mailpit Container #625

Merged

Conversation

oliverlambson
Copy link
Contributor

@oliverlambson oliverlambson commented Jun 29, 2024

New Container

Fixes #626

PR Checklist

  • Your PR title follows the Conventional Commits syntax
    as we make use of this for detecting Semantic Versioning changes.
  • Your PR allows maintainers to edit your branch, this will speed up resolving minor issues!
  • The new container is implemented under modules/*
    • Your module follows PEP 420 with implicit namespace packages
      (if unsure, look at other existing community modules)
    • Your package namespacing follows testcontainers.<modulename>.*
      and you DO NOT have an __init__.py above your module's level.
    • Your module has it's own tests under modules/*/tests
    • Your module has a README.rst and hooks in the .. auto-class and .. title of your container
    • Implement the new feature (typically in __init__.py) and corresponding tests.
  • Your module is added in pyproject.toml
    • it is declared under tool.poetry.packages - see other community modules
    • it is declared under tool.poetry.extras with the same name as your module name,
      we still prefer adding NO EXTRA DEPENDENCIES, meaning mymodule = [] is the preferred addition
      (see the notes at the bottom)
  • (seems to not be needed anymore) The INDEX.rst at the project root includes your module under the .. toctree directive
  • Your branch is up to date (or we'll use GH's "update branch" function through the UI)

Preferred implementation

  • The current consensus among maintainers is to try to avoid enforcing the client library
    for the given tools you are triyng to implement.
  • This means we want you to avoid adding specific libraries as dependencies to testcontainers.
  • Therefore, you should implement the configuration and the waiting with as little extra as possible
  • You may still find it useful to add your preferred client library as a dev dependency

@oliverlambson oliverlambson force-pushed the feat/mailpit-container branch 2 times, most recently from 975d556 to cfce31d Compare June 30, 2024 11:53
@oliverlambson oliverlambson marked this pull request as ready for review June 30, 2024 11:53
Copy link

codecov bot commented Jun 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@01d6c18). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #625   +/-   ##
=======================================
  Coverage        ?   76.26%           
=======================================
  Files           ?       11           
  Lines           ?      573           
  Branches        ?       83           
=======================================
  Hits            ?      437           
  Misses          ?      110           
  Partials        ?       26           

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

@oliverlambson oliverlambson force-pushed the feat/mailpit-container branch from cfce31d to f4b2278 Compare June 30, 2024 11:57
@oliverlambson oliverlambson force-pushed the feat/mailpit-container branch from 5d08557 to 41b6771 Compare June 30, 2024 12:47
@oliverlambson oliverlambson force-pushed the feat/mailpit-container branch from 41b6771 to 2dfd1c0 Compare June 30, 2024 12:52
Comment on lines +35 to +40
class MailpitUser(NamedTuple):
"""Mailpit user for authentication

Helper class to define a user for Mailpit authentication.

This is just a named tuple for username and password.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I imagine this could be a controversial addition, since it's the first class being exported from community modules that isn't a container.

The reason I've done this is because it's a more descriptive and intuitive datatype (to me):

- users:  list[tuple[str, str]] | None
+ users:  list[MailpitUser] | None

Copy link
Contributor Author

@oliverlambson oliverlambson Jun 30, 2024

Choose a reason for hiding this comment

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

I've also added a py.typed as this module is fully type-hinted (see #504). Running mypy on it reveals the type hint issues in core, but raises no issues within this module

@alexanderankin alexanderankin changed the title feat(modules): Mailpit Container fix(modules): Mailpit Container Jun 30, 2024
@alexanderankin alexanderankin added the community-feat feature but its a community module so we wont bump tc core for it label Jun 30, 2024
@alexanderankin alexanderankin merged commit 0b866ff into testcontainers:main Jun 30, 2024
16 checks passed
@oliverlambson oliverlambson deleted the feat/mailpit-container branch June 30, 2024 18:02
Tranquility2 pushed a commit to Tranquility2/testcontainers-python that referenced this pull request Jun 30, 2024
Fixes testcontainers#626

- [x] Your PR title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) syntax
  as we make use of this for detecting Semantic Versioning changes.
- [x] Your PR allows maintainers to edit your branch, this will speed up
resolving minor issues!
- [x] The new container is implemented under `modules/*`
- Your module follows [PEP 420](https://peps.python.org/pep-0420/) with
implicit namespace packages
    (if unsure, look at other existing community modules)
  - Your package namespacing follows `testcontainers.<modulename>.*`
    and you DO NOT have an `__init__.py` above your module's level.
  - Your module has it's own tests under `modules/*/tests`
- Your module has a `README.rst` and hooks in the `.. auto-class` and
`.. title` of your container
- Implement the new feature (typically in `__init__.py`) and
corresponding tests.
- [x] Your module is added in `pyproject.toml`
- it is declared under `tool.poetry.packages` - see other community
modules
- it is declared under `tool.poetry.extras` with the same name as your
module name,
we still prefer adding _NO EXTRA DEPENDENCIES_, meaning `mymodule = []`
is the preferred addition
    (see the notes at the bottom)
- [x] (seems to not be needed anymore) The `INDEX.rst` at the project
root includes your module under the `.. toctree` directive
- [x] Your branch is up to date (or we'll use GH's "update branch"
function through the UI)

---------

Co-authored-by: Dave Ankin <daveankin@gmail.com>
alexanderankin pushed a commit that referenced this pull request Jul 2, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.7.1](testcontainers-v4.7.0...testcontainers-v4.7.1)
(2024-07-02)


### Bug Fixes

* **core:** bad rebase from
[#579](#579)
([#635](#635))
([4766e48](4766e48))
* **modules:** Mailpit Container
([#625](#625))
([0b866ff](0b866ff))
* **modules:** SFTP Server Container
([#629](#629))
([2e7dbf1](2e7dbf1))
* **network:** Now able to use Network without context, and has labels
to be automatically cleaned up
([#627](#627))
([#630](#630))
([e93bc29](e93bc29))
* **postgres:** get_connection_url(driver=None) should return
postgres://...
([#588](#588))
([01d6c18](01d6c18)),
closes
[#587](#587)
* update test module import
([#623](#623))
([16f6ca4](16f6ca4))

---
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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
community-feat feature but its a community module so we wont bump tc core for it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Container: Mailpit
2 participants