Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Remove class-level variables from containers. #296

Merged
merged 34 commits into from
Apr 11, 2023

Conversation

tillahoffmann
Copy link
Collaborator

@tillahoffmann tillahoffmann commented Jan 7, 2023

Several of the containers currently load environment variables at import time. Consequently, if we create a container, its configuration may not match the current environment variables. Containers also overwrite class variables with instance variables of the same name which can cause confusion.

This PR

  • removes all class-level variables and loads environment variables at the time the container is created.
  • unifies the container API by renaming user to username and port_to_expose to port where applicable such that all containers have the same parameter names. The motivation behind renaming port_to_expose is that some containers have multiple different ports (cf. Clickhouse container exposing ports setup is strange #257 and Add azurite module #234). [specific]_port_to_expose is just a bit long.

This will break a bunch of stuff, but I'm planning to squeeze a lot of this cleanup into the next major release.

core/testcontainers/core/generic.py Outdated Show resolved Hide resolved
core/testcontainers/core/utils.py Outdated Show resolved Hide resolved
neo4j/testcontainers/neo4j/__init__.py Outdated Show resolved Hide resolved
@pffijt pffijt self-requested a review February 23, 2023 11:36
@pffijt
Copy link
Collaborator

pffijt commented Feb 23, 2023

We should fix the minor inconsistencies then this pr should be ready for merge.

Sign up for free to 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.

None yet

3 participants