Skip to content

Commit 9427055

Browse files
CarliJoyalexanderankin
authored andcommitted
fix(docs): update docs reflecting new structure
1 parent 8e1050a commit 9427055

5 files changed

Lines changed: 13 additions & 14 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ You need to have the following tools available to you:
3131
- Run `make install` to get `uv` to install all dependencies and set up `pre-commit`
3232
- **Recommended**: Run `make` or `make help` to see other commands available to you.
3333
- After this, you should have a working virtual environment and proceed with writing code with your favourite IDE
34-
- **TIP**: You can run `make core/tests` or `make modules/<my-module>/tests` to run the tests specifically for that to speed up feedback cycles
34+
- **TIP**: You can run `make core/tests` or `make community/<my-module>/tests` to run the tests specifically for that to speed up feedback cycles
3535
- You can also run `make lint` to run the `pre-commit` for the entire codebase.
3636

3737

.github/PULL_REQUEST_TEMPLATE/new_container.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,12 @@ It helps reduce unnecessary work for you and the maintainers!
2020
So please use `fix(postgres):` or `fix(my_new_vector_db):` if you want to add or modify community modules.
2121
This may change in the future if we have a separate package released with community modules.
2222
- [ ] Your PR allows maintainers to edit your branch, this will speed up resolving minor issues!
23-
- [ ] The new container is implemented under `modules/*`
24-
- Your module follows [PEP 420](https://peps.python.org/pep-0420/) with implicit namespace packages
25-
(if unsure, look at other existing community modules)
26-
- Your package namespacing follows `testcontainers.<modulename>.*`
27-
and you DO NOT have an `__init__.py` above your module's level.
28-
- Your module has its own tests under `modules/*/tests`
29-
- Your module has a `README.rst` and hooks in the `.. auto-class` and `.. title` of your container
23+
- [ ] The new container is implemented under `src/testcontainers/community/<modulename>/`
24+
- Your package namespacing follows `testcontainers.community.<modulename>.*`.
25+
- Your module has its own tests under `tests/community/<modulename>/`
26+
- Your module has a `docs/community/<modulename>.rst` with the `.. autoclass` and `.. title` of your container
3027
- Implement the new feature (typically in `__init__.py`) and corresponding tests.
3128
- [ ] Your module is added in `pyproject.toml`
32-
- it is declared under `tool.hatch.build.targets.wheel` - see other community modules
3329
- it is declared under `project.optional-dependencies` with the same name as your module name,
3430
we still prefer adding _NO EXTRA DEPENDENCIES_, meaning `mymodule = []` is the preferred addition
3531
(see the notes at the bottom)

docs/community/generic.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ FastAPI container that is using :code:`ServerContainer`
1111
>>> from testcontainers.core.waiting_utils import wait_for_logs
1212
>>> from testcontainers.core.image import DockerImage
1313

14-
>>> with DockerImage(path="./modules/generic/tests/samples/fastapi", tag="fastapi-test:latest") as image:
14+
>>> with DockerImage(path="./tests/community/generic/samples/fastapi", tag="fastapi-test:latest") as image:
1515
... with ServerContainer(port=80, image=image) as fastapi_server:
1616
... delay = wait_for_logs(fastapi_server, "Uvicorn running on http://0.0.0.0:80")
1717
... fastapi_server.get_api_url = lambda: fastapi_server._create_connection_url() + "/api/v1/"
@@ -31,7 +31,7 @@ A more advance use-case, where we are using a FastAPI container that is using Re
3131
... redis_container_port = redis.port
3232
... redis_container_ip_address = redis.get_docker_client().bridge_ip(redis._container.id)
3333

34-
... with DockerImage(path="./modules/generic/tests/samples/advance_1", tag="advance-1:latest") as image:
34+
... with DockerImage(path="./tests/community/generic/samples/advance_1", tag="advance-1:latest") as image:
3535
... web_server = ServerContainer(port=80, image=image)
3636
... web_server.with_env(key="REDIS_HOST", value=redis_container_ip_address)
3737
... web_server.with_env(key="REDIS_PORT", value=redis_container_port)

docs/contributing.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You need to have the following tools available to you:
3030
- Run `make install` to get `uv` to install all dependencies and set up `pre-commit`
3131
- **Recommended**: Run `make` or `make help` to see other commands available to you.
3232
- After this, you should have a working virtual environment and proceed with writing code with your favorite IDE
33-
- **TIP**: You can run `make core/tests` or `make modules/<my-module>/tests` to run the tests specifically for that to speed up feedback cycles
33+
- **TIP**: You can run `make core/tests` or `make community/<my-module>/tests` to run the tests specifically for that to speed up feedback cycles
3434
- You can also run `make lint` to run the `pre-commit` for the entire codebase.
3535

3636
## Adding new modules
@@ -47,10 +47,12 @@ Once you've talked to the maintainers (we do our best to reply!) then you can pr
4747

4848
### Module documentation
4949

50-
Leave examples for others with your mew module such as `modules/<new_module>/basic_example.py`. You can create as many examples as you want.
50+
Leave examples for others with your new module such as `docs/modules/<new_module>_example.py`. You can create as many examples as you want.
5151

5252
Create a new `docs/modules/<new_module>.md` describing the basic use of the new container. There is a [starter template provided here](https://raw.githubusercontent.com/testcontainers/testcontainers-python/blob/main/docs/modules/template.md){:target="\_blank"}.
5353

54+
Also create a `docs/community/<new_module>.rst` with the `.. autoclass` and `.. title` directives pointing at your container class — this is used by the Sphinx doctest runner.
55+
5456
!!! important
5557

5658
Make sure to add your new module to the sidebar nav in the `mkdocs.yml`

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ testcontainers-python facilitates the use of Docker containers for functional an
1414

1515
.. toctree::
1616
:maxdepth: 1
17+
:glob:
1718

1819
core/README
1920
compose
@@ -78,7 +79,7 @@ Crafting containers that are based on custom images is supported by the `core` m
7879

7980
This allows you to create containers from images that are not part of the modules provided by testcontainers-python.
8081

81-
For common use cases, you can also use the generic containers provided by the `testcontainers-generic` module. Please check the `generic documentation <modules/generic/README.html>`_ for more information.
82+
For common use cases, you can also use the generic containers provided by the `testcontainers-generic` module. Please check the `generic documentation <community/generic.html>`_ for more information.
8283
(example: `ServerContainer` for running a FastAPI server)
8384

8485

0 commit comments

Comments
 (0)