You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.rst
+21-61Lines changed: 21 additions & 61 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,6 @@ testcontainers-python
13
13
testcontainers-python facilitates the use of Docker containers for functional and integration testing. The collection of packages currently supports the following features.
14
14
15
15
.. toctree::
16
-
:maxdepth:1
17
16
18
17
core/README
19
18
modules/index
@@ -60,15 +59,12 @@ Installation
60
59
------------
61
60
62
61
The suite of testcontainers packages is available on `PyPI <https://pypi.org/project/testcontainers/>`_,
63
-
and the package can be installed using :code:`pip`.
62
+
and individual packages can be installed using :code:`pip`.
64
63
65
-
Version `4.0.0` onwards we do not support the `testcontainers-*` packages as it is unsustainable to maintain ownership.
64
+
Version `4.0.0` onwards we do not support the `testcontainers-*` packages as it is unsutainable to maintain ownership.
66
65
67
66
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]`.
68
67
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
-
72
68
73
69
Custom Containers
74
70
-----------------
@@ -84,75 +80,40 @@ For common use cases, you can also use the generic containers provided by the `t
84
80
Docker in Docker (DinD)
85
81
-----------------------
86
82
87
-
When trying to launch Testcontainers from within a Docker container, e.g., in continuous integration testing, two things have to be provided:
83
+
When trying to launch a testcontainer from within a Docker container, e.g., in continuous integration testing, two things have to be provided:
88
84
89
85
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.
90
86
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.
91
87
92
-
Private Docker registry
93
-
-----------------------
94
-
95
-
Using a private docker registry requires the `DOCKER_AUTH_CONFIG` environment variable to be set.
We recommend you use a `Poetry <https://python-poetry.org/docs/>`_ for development.
142
-
After having installed `poetry`, you can run the following snippet to set up your local dev environment.
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.
143
107
144
108
.. code-block:: bash
145
109
146
-
make install
110
+
poetry install --all-extras
111
+
make <your-module>/tests
147
112
148
113
Package Structure
149
114
^^^^^^^^^^^^^^^^^
150
115
151
-
Testcontainers is a collection of `implicit namespace packages <https://peps.python.org/pep-0420/>`__
152
-
to decouple the development of different extensions,
153
-
e.g., :code:`testcontainers[mysql]` and :code:`testcontainers[postgres]` for MySQL and PostgreSQL database containers, respectively.
154
-
155
-
The folder structure is as follows:
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.
156
117
157
118
.. code-block:: bash
158
119
@@ -172,11 +133,10 @@ The folder structure is as follows:
172
133
...
173
134
# README for this feature.
174
135
README.rst
136
+
# Setup script for this feature.
137
+
setup.py
175
138
176
139
Contributing a New Feature
177
140
^^^^^^^^^^^^^^^^^^^^^^^^^^
178
141
179
-
You want to contribute a new feature or container? Great!
180
-
- We recommend you first `open an issue <https://github.com/testcontainers/testcontainers-python/issues/new/choose>`_
181
-
- Then follow the suggestions from the team
182
-
- 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!
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>__`.
0 commit comments