Skip to content

Commit 4766e48

Browse files
authoredJul 2, 2024··
fix(core): bad rebase from #579 (#635)
fixes some incorrectly resolved conflicts during the rebase in #579 fixes #632 - **fix #607 - no longer need to manually include for toctree** - **semver note** - **fix rest of incorrectly resolved conflicts in index.rst**
1 parent e93bc29 commit 4766e48

File tree

2 files changed

+70
-24
lines changed

2 files changed

+70
-24
lines changed
 

‎.github/PULL_REQUEST_TEMPLATE/new_container.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,26 @@ It helps reduce unnecessary work for you and the maintainers!
1414

1515
- [ ] Your PR title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) syntax
1616
as we make use of this for detecting Semantic Versioning changes.
17+
- Additions to the community modules do not contribute to SemVer scheme:
18+
all community features will be tagged [community-feat](https://github.com/testcontainers/testcontainers-python/issues?q=label%3Acommunity-feat+),
19+
but we do not want to release minor or major versions due to features or breaking changes outside of core.
20+
So please use `fix(postgres):` or `fix(my_new_vector_db):` if you want to add or modify community modules.
21+
This may change in the future if we have a separate package released with community modules.
1722
- [ ] Your PR allows maintainers to edit your branch, this will speed up resolving minor issues!
1823
- [ ] The new container is implemented under `modules/*`
1924
- Your module follows [PEP 420](https://peps.python.org/pep-0420/) with implicit namespace packages
2025
(if unsure, look at other existing community modules)
2126
- Your package namespacing follows `testcontainers.<modulename>.*`
2227
and you DO NOT have an `__init__.py` above your module's level.
23-
- Your module has it's own tests under `modules/*/tests`
28+
- Your module has its own tests under `modules/*/tests`
2429
- Your module has a `README.rst` and hooks in the `.. auto-class` and `.. title` of your container
2530
- Implement the new feature (typically in `__init__.py`) and corresponding tests.
2631
- [ ] Your module is added in `pyproject.toml`
2732
- it is declared under `tool.poetry.packages` - see other community modules
2833
- it is declared under `tool.poetry.extras` with the same name as your module name,
2934
we still prefer adding _NO EXTRA DEPENDENCIES_, meaning `mymodule = []` is the preferred addition
3035
(see the notes at the bottom)
31-
- [ ] The `INDEX.rst` at the project root includes your module under the `.. toctree` directive
32-
- [ ] Your branch is up to date (or we'll use GH's "update branch" function through the UI)
36+
- [ ] Your branch is up-to-date (or your branch will be rebased with `git rebase`)
3337

3438
# Preferred implementation
3539

‎index.rst

+63-21
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ testcontainers-python
1313
testcontainers-python facilitates the use of Docker containers for functional and integration testing. The collection of packages currently supports the following features.
1414

1515
.. toctree::
16+
:maxdepth: 1
1617

1718
core/README
1819
modules/index
@@ -59,12 +60,15 @@ Installation
5960
------------
6061

6162
The suite of testcontainers packages is available on `PyPI <https://pypi.org/project/testcontainers/>`_,
62-
and individual packages can be installed using :code:`pip`.
63+
the package can be installed using :code:`pip`.
6364

64-
Version `4.0.0` onwards we do not support the `testcontainers-*` packages as it is unsutainable to maintain ownership.
65+
Version `4.0.0` onwards we do not support the `testcontainers-*` packages as it is unsustainable to maintain ownership.
6566

6667
Instead packages can be installed by specifying `extras <https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies>`__, e.g., :code:`pip install testcontainers[postgres]`.
6768

69+
Please note, that community modules are supported on a best-effort basis and breaking changes DO NOT create major versions in the package.
70+
Therefore, only the package core is strictly following SemVer. If your workflow is broken by a minor update, please look at the changelogs for guidance.
71+
6872

6973
Custom Containers
7074
-----------------
@@ -80,40 +84,77 @@ For common use cases, you can also use the generic containers provided by the `t
8084
Docker in Docker (DinD)
8185
-----------------------
8286

83-
When trying to launch a testcontainer from within a Docker container, e.g., in continuous integration testing, two things have to be provided:
87+
When trying to launch Testcontainers from within a Docker container, e.g., in continuous integration testing, two things have to be provided:
8488

8589
1. The container has to provide a docker client installation. Either use an image that has docker pre-installed (e.g. the `official docker images <https://hub.docker.com/_/docker>`_) or install the client from within the `Dockerfile` specification.
8690
2. The container has to have access to the docker daemon which can be achieved by mounting `/var/run/docker.sock` or setting the `DOCKER_HOST` environment variable as part of your `docker run` command.
8791

92+
93+
Private Docker registry
94+
-----------------------
95+
96+
Using a private docker registry requires the `DOCKER_AUTH_CONFIG` environment variable to be set.
97+
`official documentation <https://docs.docker.com/engine/reference/commandline/login/#credential-helpers>`_
98+
99+
The value of this variable should be a JSON string containing the authentication information for the registry.
100+
101+
Example:
102+
103+
.. code-block:: bash
104+
105+
DOCKER_AUTH_CONFIG='{"auths": {"https://myregistry.com": {"auth": "dXNlcm5hbWU6cGFzc3dvcmQ="}}}'
106+
107+
In order to generate the JSON string, you can use the following command:
108+
109+
.. code-block:: bash
110+
111+
echo -n '{"auths": {"<url>": {"auth": "'$(echo -n "<username>:<password>" | base64 -w 0)'"}}}'
112+
113+
Fetching passwords from cloud providers:
114+
115+
.. code-block:: bash
116+
117+
ECR_PASSWORD = $(aws ecr get-login-password --region eu-west-1)
118+
GCP_PASSWORD = $(gcloud auth print-access-token)
119+
AZURE_PASSWORD = $(az acr login --name <registry-name> --expose-token --output tsv)
120+
121+
88122
Configuration
89123
-------------
90124

91-
+-------------------------------------------+-------------------------------+------------------------------------------+
92-
| Env Variable | Example | Description |
93-
+===========================================+===============================+==========================================+
94-
| ``TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE`` | ``/var/run/docker.sock`` | Path to Docker's socket used by ryuk |
95-
+-------------------------------------------+-------------------------------+------------------------------------------+
96-
| ``TESTCONTAINERS_RYUK_PRIVILEGED`` | ``false`` | Run ryuk as a privileged container |
97-
+-------------------------------------------+-------------------------------+------------------------------------------+
98-
| ``TESTCONTAINERS_RYUK_DISABLED`` | ``false`` | Disable ryuk |
99-
+-------------------------------------------+-------------------------------+------------------------------------------+
100-
| ``RYUK_CONTAINER_IMAGE`` | ``testcontainers/ryuk:0.7.0`` | Custom image for ryuk |
101-
+-------------------------------------------+-------------------------------+------------------------------------------+
125+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
126+
| Env Variable | Example | Description |
127+
+===========================================+===================================================+==========================================+
128+
| ``TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE`` | ``/var/run/docker.sock`` | Path to Docker's socket used by ryuk |
129+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
130+
| ``TESTCONTAINERS_RYUK_PRIVILEGED`` | ``false`` | Run ryuk as a privileged container |
131+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
132+
| ``TESTCONTAINERS_RYUK_DISABLED`` | ``false`` | Disable ryuk |
133+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
134+
| ``RYUK_CONTAINER_IMAGE`` | ``testcontainers/ryuk:0.7.0`` | Custom image for ryuk |
135+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
136+
| ``DOCKER_AUTH_CONFIG`` | ``{"auths": {"<url>": {"auth": "<encoded>"}}}`` | Custom registry auth config |
137+
+-------------------------------------------+---------------------------------------------------+------------------------------------------+
102138

103139
Development and Contributing
104140
----------------------------
105141

106-
We recommend you use a `virtual environment <https://virtualenv.pypa.io/en/stable/>`_ for development (:code:`python>=3.7` is required). After setting up your virtual environment, you can install all dependencies and test the installation by running the following snippet.
142+
143+
We recommend you use a `Poetry <https://python-poetry.org/docs/>`_ for development.
144+
After having installed `poetry`, you can run the following snippet to set up your local dev environment.
107145

108146
.. code-block:: bash
109147
110-
poetry install --all-extras
111-
make <your-module>/tests
148+
make install
112149
113150
Package Structure
114151
^^^^^^^^^^^^^^^^^
115152

116-
Testcontainers is a collection of `implicit namespace packages <https://peps.python.org/pep-0420/>`__ to decouple the development of different extensions, e.g., :code:`testcontainers-mysql` and :code:`testcontainers-postgres` for MySQL and PostgreSQL database containers, respectively. The folder structure is as follows.
153+
Testcontainers is a collection of `implicit namespace packages <https://peps.python.org/pep-0420/>`__
154+
to decouple the development of different extensions,
155+
e.g., :code:`testcontainers[mysql]` and :code:`testcontainers[postgres]` for MySQL and PostgreSQL database containers, respectively.
156+
157+
The folder structure is as follows:
117158

118159
.. code-block:: bash
119160
@@ -133,10 +174,11 @@ Testcontainers is a collection of `implicit namespace packages <https://peps.pyt
133174
...
134175
# README for this feature.
135176
README.rst
136-
# Setup script for this feature.
137-
setup.py
138177
139178
Contributing a New Feature
140179
^^^^^^^^^^^^^^^^^^^^^^^^^^
141180

142-
You want to contribute a new feature or container? Great! You can do that in six steps as outlined `here <https://github.com/testcontainers/testcontainers-python/blob/main/.github/PULL_REQUEST_TEMPLATE/new_container.md>__`.
181+
You want to contribute a new feature or container? Great!
182+
- We recommend you first `open an issue <https://github.com/testcontainers/testcontainers-python/issues/new/choose>`_
183+
- Then follow the suggestions from the team
184+
- We also have a Pull Request `template <https://github.com/testcontainers/testcontainers-python/blob/main/.github/PULL_REQUEST_TEMPLATE/new_container.md>`_ for new containers!

0 commit comments

Comments
 (0)
Please sign in to comment.