Uh oh!
There was an error while loading. Please reload this page.
fix(core): make config editable to avoid monkeypatching.1 - #532
Conversation
alexanderankin
commented
Apr 8, 2024
ok, i checked against #519 and shouldnt be too hard to rebase (if even necessary), unfortunately re #525 and #527 - 527 is a draft and 525 is a feat, which deprioritizes over things which can be considered fixes - unless the changes are inspired by tc-go or tc-java or other sources of truth on how to deal with things like mssql, may even be "breaking" even though they are "fixing" - i unfortunately have a lot of pent up sympathy for people doing unusual software things. nothing against the PR, we will figure it out and hopefully release it as a fix rather than a feat) so with that said, not sure why i shouldnt merge this |
🤖 I have created a release *beep* *boop* --- ## [4.3.2](testcontainers-v4.3.1...testcontainers-v4.3.2) (2024-04-08) ### Bug Fixes * **core:** Improve typing for common container usage scenarios ([#523](#523)) ([d5b8553](d5b8553)) * **core:** make config editable to avoid monkeypatching.1 ([#532](#532)) ([3be6da3](3be6da3)) * **vault:** add support for HashiCorp Vault container ([#366](#366)) ([1326278](1326278)) --- 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>
…ners#532) see testcontainers#531: I am using testcontainers within a library that provides some pytest-fixtures. In order for this to work I have change some settings. As I can not guarantee that that my lib is imported before testcontainers I need to monkeypatch the settings. This is much easier if I only need to monkeypatch the config file and not all modules that use configurations. I would argue that for a potential library as this, this is a better design. Also one can easier see that the given UPERCASE variable is not a constant but rather a setting. Co-authored-by: Carli* Freudenberg <carli.freudenberg@energymeteo.de>
🤖 I have created a release *beep* *boop* --- ## [4.3.2](testcontainers/testcontainers-python@testcontainers-v4.3.1...testcontainers-v4.3.2) (2024-04-08) ### Bug Fixes * **core:** Improve typing for common container usage scenarios ([testcontainers#523](testcontainers#523)) ([d5b8553](testcontainers@d5b8553)) * **core:** make config editable to avoid monkeypatching.1 ([testcontainers#532](testcontainers#532)) ([3be6da3](testcontainers@3be6da3)) * **vault:** add support for HashiCorp Vault container ([testcontainers#366](testcontainers#366)) ([1326278](testcontainers@1326278)) --- 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>
CarliJoy
commented
Apr 8, 2024
Dear, @alexanderankin Imports like fromtestcontainers.core.configimporttestcontainers_configasconfigwill have the same problems as fromtestcontainers.core.configimportSETTINGOnly difference is that one can monkeypatch values of the But if you goal was to allow to make testcontainers_config replaceable with a new But thank you for adopting my idea so fast. |
alexanderankin
commented
Apr 8, 2024
via email
The data class is not frozen …On Mon, Apr 8, 2024, 10:07 AM Kound ***@***.***> wrote:
Dear, @alexanderankin <https://github.com/alexanderankin>
Imports like
from testcontainers.core.config import testcontainers_config as config
will have the same problems as
from testcontainers.core.config import SETTING
Only difference is that one can monkeypatch values of the
testcontainers_config dataclass object.
But if you goal was to allow to make testcontainers_config replaceable
with a new TestcontainersConfiguration instance, it won't work.
But thank you for adopting my idea so fast.
It's good enough for me.
—
Reply to this email directly, view it on GitHub
<#532 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACECGJCXAA3UJV7EJPJKHIDY4KQCFAVCNFSM6AAAAABF4JQBFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSHA2TGNRSGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
see #531