From df26c9aaf162e1eea55c1a0e975ecbf804377c36 Mon Sep 17 00:00:00 2001 From: kshramt Date: Thu, 21 Mar 2024 01:58:32 +0900 Subject: [PATCH 1/3] Migrate to the flat layout I will add `py.typed` after this PR is merged. --- INDEX.rst | 46 ++++++++--------- pyproject.toml | 51 ------------------- {modules => testcontainers}/README.md | 0 .../core => testcontainers}/__init__.py | 0 .../arangodb/README.rst | 0 .../arangodb/__init__.py | 0 .../azurite/README.rst | 0 .../azurite/__init__.py | 0 .../clickhouse/README.rst | 0 .../clickhouse/__init__.py | 0 .../compose/__init__.py | 0 .../compose/compose.py | 0 {core => testcontainers/core}/README.rst | 0 .../tests => testcontainers/core}/__init__.py | 0 .../core/config.py | 0 .../core/container.py | 0 .../core/docker_client.py | 0 .../core/exceptions.py | 0 .../core/generic.py | 0 .../core/labels.py | 0 .../core/utils.py | 0 .../core/waiting_utils.py | 0 .../elasticsearch/README.rst | 0 .../elasticsearch/__init__.py | 0 {modules => testcontainers}/google/README.rst | 0 .../google/__init__.py | 0 .../google/pubsub.py | 0 .../influxdb/README.rst | 0 .../influxdb/__init__.py | 0 .../influxdb1/__init__.py | 0 .../influxdb2/__init__.py | 0 {modules => testcontainers}/k3s/README.rst | 0 .../k3s/__init__.py | 0 {modules => testcontainers}/kafka/README.rst | 0 .../kafka/__init__.py | 0 .../keycloak/README.rst | 0 .../keycloak/__init__.py | 0 .../localstack/README.rst | 0 .../localstack/__init__.py | 0 {modules => testcontainers}/minio/README.rst | 0 .../minio/__init__.py | 0 .../mongodb/README.rst | 0 .../mongodb/__init__.py | 0 {modules => testcontainers}/mssql/README.rst | 0 .../mssql/__init__.py | 0 {modules => testcontainers}/mysql/README.rst | 0 .../mysql/__init__.py | 0 {modules => testcontainers}/neo4j/README.rst | 0 .../neo4j/__init__.py | 0 {modules => testcontainers}/nginx/README.rst | 0 .../nginx/__init__.py | 0 .../opensearch/README.rst | 0 .../opensearch/__init__.py | 0 {modules => testcontainers}/oracle/README.rst | 0 .../oracle/__init__.py | 0 .../postgres/README.rst | 0 .../postgres/__init__.py | 0 .../rabbitmq/README.rst | 0 .../rabbitmq/__init__.py | 0 {modules => testcontainers}/redis/README.rst | 0 .../redis/__init__.py | 0 .../selenium/README.rst | 0 .../selenium/__init__.py | 0 .../tests => tests/arangodb}/test_arangodb.py | 0 .../tests => tests/azurite}/test_azurite.py | 0 .../clickhouse}/test_clickhouse.py | 0 {core/tests => tests/core}/Dockerfile | 0 .../basic/docker-compose.yaml | 0 .../port_multiple/compose.yaml | 0 .../compose_fixtures/port_single/compose.yaml | 0 {core/tests => tests/core}/test_compose.py | 0 {core/tests => tests/core}/test_core.py | 0 .../core}/test_docker_client.py | 0 .../core}/test_docker_in_docker.py | 0 .../core}/test_new_docker_api.py | 0 {core/tests => tests/core}/test_ryuk.py | 0 .../elasticsearch}/test_elasticsearch.py | 0 .../tests => tests/google}/test_google.py | 0 .../tests => tests/influxdb}/test_influxdb.py | 0 {modules/k3s/tests => tests/k3s}/test_k3s.py | 0 .../kafka/tests => tests/kafka}/test_kafka.py | 0 .../tests => tests/keycloak}/test_keycloak.py | 0 .../localstack}/test_localstack.py | 0 .../minio/tests => tests/minio}/test_minio.py | 0 .../tests => tests/mongodb}/test_mongodb.py | 0 .../mssql/tests => tests/mssql}/test_mssql.py | 0 .../mysql/tests => tests/mysql}/test_mysql.py | 0 .../neo4j/tests => tests/neo4j}/test_neo4j.py | 0 .../nginx/tests => tests/nginx}/test_nginx.py | 0 .../opensearch}/test_opensearch.py | 0 .../tests => tests/oracle}/test_oracle.py | 0 .../tests => tests/postgres}/test_postgres.py | 0 .../tests => tests/rabbitmq}/test_rabbitmq.py | 0 .../redis/tests => tests/redis}/test_redis.py | 0 .../tests => tests/selenium}/test_selenium.py | 0 95 files changed, 23 insertions(+), 74 deletions(-) rename {modules => testcontainers}/README.md (100%) rename {core/testcontainers/core => testcontainers}/__init__.py (100%) rename {modules => testcontainers}/arangodb/README.rst (100%) rename {modules/arangodb/testcontainers => testcontainers}/arangodb/__init__.py (100%) rename {modules => testcontainers}/azurite/README.rst (100%) rename {modules/azurite/testcontainers => testcontainers}/azurite/__init__.py (100%) rename {modules => testcontainers}/clickhouse/README.rst (100%) rename {modules/clickhouse/testcontainers => testcontainers}/clickhouse/__init__.py (100%) rename {core/testcontainers => testcontainers}/compose/__init__.py (100%) rename {core/testcontainers => testcontainers}/compose/compose.py (100%) rename {core => testcontainers/core}/README.rst (100%) rename {modules/influxdb/tests => testcontainers/core}/__init__.py (100%) rename {core/testcontainers => testcontainers}/core/config.py (100%) rename {core/testcontainers => testcontainers}/core/container.py (100%) rename {core/testcontainers => testcontainers}/core/docker_client.py (100%) rename {core/testcontainers => testcontainers}/core/exceptions.py (100%) rename {core/testcontainers => testcontainers}/core/generic.py (100%) rename {core/testcontainers => testcontainers}/core/labels.py (100%) rename {core/testcontainers => testcontainers}/core/utils.py (100%) rename {core/testcontainers => testcontainers}/core/waiting_utils.py (100%) rename {modules => testcontainers}/elasticsearch/README.rst (100%) rename {modules/elasticsearch/testcontainers => testcontainers}/elasticsearch/__init__.py (100%) rename {modules => testcontainers}/google/README.rst (100%) rename {modules/google/testcontainers => testcontainers}/google/__init__.py (100%) rename {modules/google/testcontainers => testcontainers}/google/pubsub.py (100%) rename {modules => testcontainers}/influxdb/README.rst (100%) rename modules/influxdb/testcontainers/influxdb.py => testcontainers/influxdb/__init__.py (100%) rename {modules/influxdb/testcontainers => testcontainers}/influxdb1/__init__.py (100%) rename {modules/influxdb/testcontainers => testcontainers}/influxdb2/__init__.py (100%) rename {modules => testcontainers}/k3s/README.rst (100%) rename {modules/k3s/testcontainers => testcontainers}/k3s/__init__.py (100%) rename {modules => testcontainers}/kafka/README.rst (100%) rename {modules/kafka/testcontainers => testcontainers}/kafka/__init__.py (100%) rename {modules => testcontainers}/keycloak/README.rst (100%) rename {modules/keycloak/testcontainers => testcontainers}/keycloak/__init__.py (100%) rename {modules => testcontainers}/localstack/README.rst (100%) rename {modules/localstack/testcontainers => testcontainers}/localstack/__init__.py (100%) rename {modules => testcontainers}/minio/README.rst (100%) rename {modules/minio/testcontainers => testcontainers}/minio/__init__.py (100%) rename {modules => testcontainers}/mongodb/README.rst (100%) rename {modules/mongodb/testcontainers => testcontainers}/mongodb/__init__.py (100%) rename {modules => testcontainers}/mssql/README.rst (100%) rename {modules/mssql/testcontainers => testcontainers}/mssql/__init__.py (100%) rename {modules => testcontainers}/mysql/README.rst (100%) rename {modules/mysql/testcontainers => testcontainers}/mysql/__init__.py (100%) rename {modules => testcontainers}/neo4j/README.rst (100%) rename {modules/neo4j/testcontainers => testcontainers}/neo4j/__init__.py (100%) rename {modules => testcontainers}/nginx/README.rst (100%) rename {modules/nginx/testcontainers => testcontainers}/nginx/__init__.py (100%) rename {modules => testcontainers}/opensearch/README.rst (100%) rename {modules/opensearch/testcontainers => testcontainers}/opensearch/__init__.py (100%) rename {modules => testcontainers}/oracle/README.rst (100%) rename {modules/oracle/testcontainers => testcontainers}/oracle/__init__.py (100%) rename {modules => testcontainers}/postgres/README.rst (100%) rename {modules/postgres/testcontainers => testcontainers}/postgres/__init__.py (100%) rename {modules => testcontainers}/rabbitmq/README.rst (100%) rename {modules/rabbitmq/testcontainers => testcontainers}/rabbitmq/__init__.py (100%) rename {modules => testcontainers}/redis/README.rst (100%) rename {modules/redis/testcontainers => testcontainers}/redis/__init__.py (100%) rename {modules => testcontainers}/selenium/README.rst (100%) rename {modules/selenium/testcontainers => testcontainers}/selenium/__init__.py (100%) rename {modules/arangodb/tests => tests/arangodb}/test_arangodb.py (100%) rename {modules/azurite/tests => tests/azurite}/test_azurite.py (100%) rename {modules/clickhouse/tests => tests/clickhouse}/test_clickhouse.py (100%) rename {core/tests => tests/core}/Dockerfile (100%) rename {core/tests => tests/core}/compose_fixtures/basic/docker-compose.yaml (100%) rename {core/tests => tests/core}/compose_fixtures/port_multiple/compose.yaml (100%) rename {core/tests => tests/core}/compose_fixtures/port_single/compose.yaml (100%) rename {core/tests => tests/core}/test_compose.py (100%) rename {core/tests => tests/core}/test_core.py (100%) rename {core/tests => tests/core}/test_docker_client.py (100%) rename {core/tests => tests/core}/test_docker_in_docker.py (100%) rename {core/tests => tests/core}/test_new_docker_api.py (100%) rename {core/tests => tests/core}/test_ryuk.py (100%) rename {modules/elasticsearch/tests => tests/elasticsearch}/test_elasticsearch.py (100%) rename {modules/google/tests => tests/google}/test_google.py (100%) rename {modules/influxdb/tests => tests/influxdb}/test_influxdb.py (100%) rename {modules/k3s/tests => tests/k3s}/test_k3s.py (100%) rename {modules/kafka/tests => tests/kafka}/test_kafka.py (100%) rename {modules/keycloak/tests => tests/keycloak}/test_keycloak.py (100%) rename {modules/localstack/tests => tests/localstack}/test_localstack.py (100%) rename {modules/minio/tests => tests/minio}/test_minio.py (100%) rename {modules/mongodb/tests => tests/mongodb}/test_mongodb.py (100%) rename {modules/mssql/tests => tests/mssql}/test_mssql.py (100%) rename {modules/mysql/tests => tests/mysql}/test_mysql.py (100%) rename {modules/neo4j/tests => tests/neo4j}/test_neo4j.py (100%) rename {modules/nginx/tests => tests/nginx}/test_nginx.py (100%) rename {modules/opensearch/tests => tests/opensearch}/test_opensearch.py (100%) rename {modules/oracle/tests => tests/oracle}/test_oracle.py (100%) rename {modules/postgres/tests => tests/postgres}/test_postgres.py (100%) rename {modules/rabbitmq/tests => tests/rabbitmq}/test_rabbitmq.py (100%) rename {modules/redis/tests => tests/redis}/test_redis.py (100%) rename {modules/selenium/tests => tests/selenium}/test_selenium.py (100%) diff --git a/INDEX.rst b/INDEX.rst index 4e0cd54b..e429e117 100644 --- a/INDEX.rst +++ b/INDEX.rst @@ -14,29 +14,29 @@ testcontainers-python facilitates the use of Docker containers for functional an .. toctree:: - core/README - modules/arangodb/README - modules/azurite/README - modules/clickhouse/README - modules/elasticsearch/README - modules/google/README - modules/influxdb/README - modules/kafka/README - modules/keycloak/README - modules/localstack/README - modules/minio/README - modules/mongodb/README - modules/mssql/README - modules/mysql/README - modules/neo4j/README - modules/nginx/README - modules/opensearch/README - modules/oracle/README - modules/postgres/README - modules/rabbitmq/README - modules/redis/README - modules/selenium/README - modules/k3s/README + testcontainers/core/README + testcontainers//arangodb/README + testcontainers//azurite/README + testcontainers//clickhouse/README + testcontainers//elasticsearch/README + testcontainers//google/README + testcontainers//influxdb/README + testcontainers//kafka/README + testcontainers//keycloak/README + testcontainers//localstack/README + testcontainers//minio/README + testcontainers//mongodb/README + testcontainers//mssql/README + testcontainers//mysql/README + testcontainers//neo4j/README + testcontainers//nginx/README + testcontainers//opensearch/README + testcontainers//oracle/README + testcontainers//postgres/README + testcontainers//rabbitmq/README + testcontainers//redis/README + testcontainers//selenium/README + testcontainers//k3s/README Getting Started --------------- diff --git a/pyproject.toml b/pyproject.toml index b9ac9d7c..024a7cb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,32 +24,6 @@ classifiers = [ "Operating System :: Unix", "Operating System :: MacOS", ] -# testcontainers-core is a proper package dependency - only modules needed here -packages = [ - { include = "testcontainers", from = "core" }, - { include = "testcontainers", from = "modules/arangodb" }, - { include = "testcontainers", from = "modules/azurite" }, - { include = "testcontainers", from = "modules/clickhouse" }, - { include = "testcontainers", from = "modules/elasticsearch" }, - { include = "testcontainers", from = "modules/google" }, - { include = "testcontainers", from = "modules/influxdb" }, - { include = "testcontainers", from = "modules/k3s" }, - { include = "testcontainers", from = "modules/kafka" }, - { include = "testcontainers", from = "modules/keycloak" }, - { include = "testcontainers", from = "modules/localstack" }, - { include = "testcontainers", from = "modules/minio" }, - { include = "testcontainers", from = "modules/mongodb" }, - { include = "testcontainers", from = "modules/mssql" }, - { include = "testcontainers", from = "modules/mysql" }, - { include = "testcontainers", from = "modules/neo4j" }, - { include = "testcontainers", from = "modules/nginx" }, - { include = "testcontainers", from = "modules/opensearch" }, - { include = "testcontainers", from = "modules/oracle" }, - { include = "testcontainers", from = "modules/postgres" }, - { include = "testcontainers", from = "modules/rabbitmq" }, - { include = "testcontainers", from = "modules/redis" }, - { include = "testcontainers", from = "modules/selenium" } -] [tool.poetry.urls] "GitHub" = "https://github.com/testcontainers/testcontainers-python" @@ -215,31 +189,6 @@ pretty = true show_error_codes = true strict = true fast_module_lookup = true -modules = ["testcontainers.core"] -mypy_path = [ - "core", -# "modules/arangodb", -# "modules/azurite", -# "modules/clickhouse", -# "modules/elasticsearch", -# "modules/google", -# "modules/k3s", -# "modules/kafka", -# "modules/keycloak", -# "modules/localstack", -# "modules/minio", -# "modules/mongodb", -# "modules/mssql", -# "modules/mysql", -# "modules/neo4j", -# "modules/nginx", -# "modules/opensearch", -# "modules/oracle", -# "modules/postgres", -# "modules/rabbitmq", -# "modules/redis", -# "modules/selenium" -] enable_error_code = [ "ignore-without-code", "redundant-expr", diff --git a/modules/README.md b/testcontainers/README.md similarity index 100% rename from modules/README.md rename to testcontainers/README.md diff --git a/core/testcontainers/core/__init__.py b/testcontainers/__init__.py similarity index 100% rename from core/testcontainers/core/__init__.py rename to testcontainers/__init__.py diff --git a/modules/arangodb/README.rst b/testcontainers/arangodb/README.rst similarity index 100% rename from modules/arangodb/README.rst rename to testcontainers/arangodb/README.rst diff --git a/modules/arangodb/testcontainers/arangodb/__init__.py b/testcontainers/arangodb/__init__.py similarity index 100% rename from modules/arangodb/testcontainers/arangodb/__init__.py rename to testcontainers/arangodb/__init__.py diff --git a/modules/azurite/README.rst b/testcontainers/azurite/README.rst similarity index 100% rename from modules/azurite/README.rst rename to testcontainers/azurite/README.rst diff --git a/modules/azurite/testcontainers/azurite/__init__.py b/testcontainers/azurite/__init__.py similarity index 100% rename from modules/azurite/testcontainers/azurite/__init__.py rename to testcontainers/azurite/__init__.py diff --git a/modules/clickhouse/README.rst b/testcontainers/clickhouse/README.rst similarity index 100% rename from modules/clickhouse/README.rst rename to testcontainers/clickhouse/README.rst diff --git a/modules/clickhouse/testcontainers/clickhouse/__init__.py b/testcontainers/clickhouse/__init__.py similarity index 100% rename from modules/clickhouse/testcontainers/clickhouse/__init__.py rename to testcontainers/clickhouse/__init__.py diff --git a/core/testcontainers/compose/__init__.py b/testcontainers/compose/__init__.py similarity index 100% rename from core/testcontainers/compose/__init__.py rename to testcontainers/compose/__init__.py diff --git a/core/testcontainers/compose/compose.py b/testcontainers/compose/compose.py similarity index 100% rename from core/testcontainers/compose/compose.py rename to testcontainers/compose/compose.py diff --git a/core/README.rst b/testcontainers/core/README.rst similarity index 100% rename from core/README.rst rename to testcontainers/core/README.rst diff --git a/modules/influxdb/tests/__init__.py b/testcontainers/core/__init__.py similarity index 100% rename from modules/influxdb/tests/__init__.py rename to testcontainers/core/__init__.py diff --git a/core/testcontainers/core/config.py b/testcontainers/core/config.py similarity index 100% rename from core/testcontainers/core/config.py rename to testcontainers/core/config.py diff --git a/core/testcontainers/core/container.py b/testcontainers/core/container.py similarity index 100% rename from core/testcontainers/core/container.py rename to testcontainers/core/container.py diff --git a/core/testcontainers/core/docker_client.py b/testcontainers/core/docker_client.py similarity index 100% rename from core/testcontainers/core/docker_client.py rename to testcontainers/core/docker_client.py diff --git a/core/testcontainers/core/exceptions.py b/testcontainers/core/exceptions.py similarity index 100% rename from core/testcontainers/core/exceptions.py rename to testcontainers/core/exceptions.py diff --git a/core/testcontainers/core/generic.py b/testcontainers/core/generic.py similarity index 100% rename from core/testcontainers/core/generic.py rename to testcontainers/core/generic.py diff --git a/core/testcontainers/core/labels.py b/testcontainers/core/labels.py similarity index 100% rename from core/testcontainers/core/labels.py rename to testcontainers/core/labels.py diff --git a/core/testcontainers/core/utils.py b/testcontainers/core/utils.py similarity index 100% rename from core/testcontainers/core/utils.py rename to testcontainers/core/utils.py diff --git a/core/testcontainers/core/waiting_utils.py b/testcontainers/core/waiting_utils.py similarity index 100% rename from core/testcontainers/core/waiting_utils.py rename to testcontainers/core/waiting_utils.py diff --git a/modules/elasticsearch/README.rst b/testcontainers/elasticsearch/README.rst similarity index 100% rename from modules/elasticsearch/README.rst rename to testcontainers/elasticsearch/README.rst diff --git a/modules/elasticsearch/testcontainers/elasticsearch/__init__.py b/testcontainers/elasticsearch/__init__.py similarity index 100% rename from modules/elasticsearch/testcontainers/elasticsearch/__init__.py rename to testcontainers/elasticsearch/__init__.py diff --git a/modules/google/README.rst b/testcontainers/google/README.rst similarity index 100% rename from modules/google/README.rst rename to testcontainers/google/README.rst diff --git a/modules/google/testcontainers/google/__init__.py b/testcontainers/google/__init__.py similarity index 100% rename from modules/google/testcontainers/google/__init__.py rename to testcontainers/google/__init__.py diff --git a/modules/google/testcontainers/google/pubsub.py b/testcontainers/google/pubsub.py similarity index 100% rename from modules/google/testcontainers/google/pubsub.py rename to testcontainers/google/pubsub.py diff --git a/modules/influxdb/README.rst b/testcontainers/influxdb/README.rst similarity index 100% rename from modules/influxdb/README.rst rename to testcontainers/influxdb/README.rst diff --git a/modules/influxdb/testcontainers/influxdb.py b/testcontainers/influxdb/__init__.py similarity index 100% rename from modules/influxdb/testcontainers/influxdb.py rename to testcontainers/influxdb/__init__.py diff --git a/modules/influxdb/testcontainers/influxdb1/__init__.py b/testcontainers/influxdb1/__init__.py similarity index 100% rename from modules/influxdb/testcontainers/influxdb1/__init__.py rename to testcontainers/influxdb1/__init__.py diff --git a/modules/influxdb/testcontainers/influxdb2/__init__.py b/testcontainers/influxdb2/__init__.py similarity index 100% rename from modules/influxdb/testcontainers/influxdb2/__init__.py rename to testcontainers/influxdb2/__init__.py diff --git a/modules/k3s/README.rst b/testcontainers/k3s/README.rst similarity index 100% rename from modules/k3s/README.rst rename to testcontainers/k3s/README.rst diff --git a/modules/k3s/testcontainers/k3s/__init__.py b/testcontainers/k3s/__init__.py similarity index 100% rename from modules/k3s/testcontainers/k3s/__init__.py rename to testcontainers/k3s/__init__.py diff --git a/modules/kafka/README.rst b/testcontainers/kafka/README.rst similarity index 100% rename from modules/kafka/README.rst rename to testcontainers/kafka/README.rst diff --git a/modules/kafka/testcontainers/kafka/__init__.py b/testcontainers/kafka/__init__.py similarity index 100% rename from modules/kafka/testcontainers/kafka/__init__.py rename to testcontainers/kafka/__init__.py diff --git a/modules/keycloak/README.rst b/testcontainers/keycloak/README.rst similarity index 100% rename from modules/keycloak/README.rst rename to testcontainers/keycloak/README.rst diff --git a/modules/keycloak/testcontainers/keycloak/__init__.py b/testcontainers/keycloak/__init__.py similarity index 100% rename from modules/keycloak/testcontainers/keycloak/__init__.py rename to testcontainers/keycloak/__init__.py diff --git a/modules/localstack/README.rst b/testcontainers/localstack/README.rst similarity index 100% rename from modules/localstack/README.rst rename to testcontainers/localstack/README.rst diff --git a/modules/localstack/testcontainers/localstack/__init__.py b/testcontainers/localstack/__init__.py similarity index 100% rename from modules/localstack/testcontainers/localstack/__init__.py rename to testcontainers/localstack/__init__.py diff --git a/modules/minio/README.rst b/testcontainers/minio/README.rst similarity index 100% rename from modules/minio/README.rst rename to testcontainers/minio/README.rst diff --git a/modules/minio/testcontainers/minio/__init__.py b/testcontainers/minio/__init__.py similarity index 100% rename from modules/minio/testcontainers/minio/__init__.py rename to testcontainers/minio/__init__.py diff --git a/modules/mongodb/README.rst b/testcontainers/mongodb/README.rst similarity index 100% rename from modules/mongodb/README.rst rename to testcontainers/mongodb/README.rst diff --git a/modules/mongodb/testcontainers/mongodb/__init__.py b/testcontainers/mongodb/__init__.py similarity index 100% rename from modules/mongodb/testcontainers/mongodb/__init__.py rename to testcontainers/mongodb/__init__.py diff --git a/modules/mssql/README.rst b/testcontainers/mssql/README.rst similarity index 100% rename from modules/mssql/README.rst rename to testcontainers/mssql/README.rst diff --git a/modules/mssql/testcontainers/mssql/__init__.py b/testcontainers/mssql/__init__.py similarity index 100% rename from modules/mssql/testcontainers/mssql/__init__.py rename to testcontainers/mssql/__init__.py diff --git a/modules/mysql/README.rst b/testcontainers/mysql/README.rst similarity index 100% rename from modules/mysql/README.rst rename to testcontainers/mysql/README.rst diff --git a/modules/mysql/testcontainers/mysql/__init__.py b/testcontainers/mysql/__init__.py similarity index 100% rename from modules/mysql/testcontainers/mysql/__init__.py rename to testcontainers/mysql/__init__.py diff --git a/modules/neo4j/README.rst b/testcontainers/neo4j/README.rst similarity index 100% rename from modules/neo4j/README.rst rename to testcontainers/neo4j/README.rst diff --git a/modules/neo4j/testcontainers/neo4j/__init__.py b/testcontainers/neo4j/__init__.py similarity index 100% rename from modules/neo4j/testcontainers/neo4j/__init__.py rename to testcontainers/neo4j/__init__.py diff --git a/modules/nginx/README.rst b/testcontainers/nginx/README.rst similarity index 100% rename from modules/nginx/README.rst rename to testcontainers/nginx/README.rst diff --git a/modules/nginx/testcontainers/nginx/__init__.py b/testcontainers/nginx/__init__.py similarity index 100% rename from modules/nginx/testcontainers/nginx/__init__.py rename to testcontainers/nginx/__init__.py diff --git a/modules/opensearch/README.rst b/testcontainers/opensearch/README.rst similarity index 100% rename from modules/opensearch/README.rst rename to testcontainers/opensearch/README.rst diff --git a/modules/opensearch/testcontainers/opensearch/__init__.py b/testcontainers/opensearch/__init__.py similarity index 100% rename from modules/opensearch/testcontainers/opensearch/__init__.py rename to testcontainers/opensearch/__init__.py diff --git a/modules/oracle/README.rst b/testcontainers/oracle/README.rst similarity index 100% rename from modules/oracle/README.rst rename to testcontainers/oracle/README.rst diff --git a/modules/oracle/testcontainers/oracle/__init__.py b/testcontainers/oracle/__init__.py similarity index 100% rename from modules/oracle/testcontainers/oracle/__init__.py rename to testcontainers/oracle/__init__.py diff --git a/modules/postgres/README.rst b/testcontainers/postgres/README.rst similarity index 100% rename from modules/postgres/README.rst rename to testcontainers/postgres/README.rst diff --git a/modules/postgres/testcontainers/postgres/__init__.py b/testcontainers/postgres/__init__.py similarity index 100% rename from modules/postgres/testcontainers/postgres/__init__.py rename to testcontainers/postgres/__init__.py diff --git a/modules/rabbitmq/README.rst b/testcontainers/rabbitmq/README.rst similarity index 100% rename from modules/rabbitmq/README.rst rename to testcontainers/rabbitmq/README.rst diff --git a/modules/rabbitmq/testcontainers/rabbitmq/__init__.py b/testcontainers/rabbitmq/__init__.py similarity index 100% rename from modules/rabbitmq/testcontainers/rabbitmq/__init__.py rename to testcontainers/rabbitmq/__init__.py diff --git a/modules/redis/README.rst b/testcontainers/redis/README.rst similarity index 100% rename from modules/redis/README.rst rename to testcontainers/redis/README.rst diff --git a/modules/redis/testcontainers/redis/__init__.py b/testcontainers/redis/__init__.py similarity index 100% rename from modules/redis/testcontainers/redis/__init__.py rename to testcontainers/redis/__init__.py diff --git a/modules/selenium/README.rst b/testcontainers/selenium/README.rst similarity index 100% rename from modules/selenium/README.rst rename to testcontainers/selenium/README.rst diff --git a/modules/selenium/testcontainers/selenium/__init__.py b/testcontainers/selenium/__init__.py similarity index 100% rename from modules/selenium/testcontainers/selenium/__init__.py rename to testcontainers/selenium/__init__.py diff --git a/modules/arangodb/tests/test_arangodb.py b/tests/arangodb/test_arangodb.py similarity index 100% rename from modules/arangodb/tests/test_arangodb.py rename to tests/arangodb/test_arangodb.py diff --git a/modules/azurite/tests/test_azurite.py b/tests/azurite/test_azurite.py similarity index 100% rename from modules/azurite/tests/test_azurite.py rename to tests/azurite/test_azurite.py diff --git a/modules/clickhouse/tests/test_clickhouse.py b/tests/clickhouse/test_clickhouse.py similarity index 100% rename from modules/clickhouse/tests/test_clickhouse.py rename to tests/clickhouse/test_clickhouse.py diff --git a/core/tests/Dockerfile b/tests/core/Dockerfile similarity index 100% rename from core/tests/Dockerfile rename to tests/core/Dockerfile diff --git a/core/tests/compose_fixtures/basic/docker-compose.yaml b/tests/core/compose_fixtures/basic/docker-compose.yaml similarity index 100% rename from core/tests/compose_fixtures/basic/docker-compose.yaml rename to tests/core/compose_fixtures/basic/docker-compose.yaml diff --git a/core/tests/compose_fixtures/port_multiple/compose.yaml b/tests/core/compose_fixtures/port_multiple/compose.yaml similarity index 100% rename from core/tests/compose_fixtures/port_multiple/compose.yaml rename to tests/core/compose_fixtures/port_multiple/compose.yaml diff --git a/core/tests/compose_fixtures/port_single/compose.yaml b/tests/core/compose_fixtures/port_single/compose.yaml similarity index 100% rename from core/tests/compose_fixtures/port_single/compose.yaml rename to tests/core/compose_fixtures/port_single/compose.yaml diff --git a/core/tests/test_compose.py b/tests/core/test_compose.py similarity index 100% rename from core/tests/test_compose.py rename to tests/core/test_compose.py diff --git a/core/tests/test_core.py b/tests/core/test_core.py similarity index 100% rename from core/tests/test_core.py rename to tests/core/test_core.py diff --git a/core/tests/test_docker_client.py b/tests/core/test_docker_client.py similarity index 100% rename from core/tests/test_docker_client.py rename to tests/core/test_docker_client.py diff --git a/core/tests/test_docker_in_docker.py b/tests/core/test_docker_in_docker.py similarity index 100% rename from core/tests/test_docker_in_docker.py rename to tests/core/test_docker_in_docker.py diff --git a/core/tests/test_new_docker_api.py b/tests/core/test_new_docker_api.py similarity index 100% rename from core/tests/test_new_docker_api.py rename to tests/core/test_new_docker_api.py diff --git a/core/tests/test_ryuk.py b/tests/core/test_ryuk.py similarity index 100% rename from core/tests/test_ryuk.py rename to tests/core/test_ryuk.py diff --git a/modules/elasticsearch/tests/test_elasticsearch.py b/tests/elasticsearch/test_elasticsearch.py similarity index 100% rename from modules/elasticsearch/tests/test_elasticsearch.py rename to tests/elasticsearch/test_elasticsearch.py diff --git a/modules/google/tests/test_google.py b/tests/google/test_google.py similarity index 100% rename from modules/google/tests/test_google.py rename to tests/google/test_google.py diff --git a/modules/influxdb/tests/test_influxdb.py b/tests/influxdb/test_influxdb.py similarity index 100% rename from modules/influxdb/tests/test_influxdb.py rename to tests/influxdb/test_influxdb.py diff --git a/modules/k3s/tests/test_k3s.py b/tests/k3s/test_k3s.py similarity index 100% rename from modules/k3s/tests/test_k3s.py rename to tests/k3s/test_k3s.py diff --git a/modules/kafka/tests/test_kafka.py b/tests/kafka/test_kafka.py similarity index 100% rename from modules/kafka/tests/test_kafka.py rename to tests/kafka/test_kafka.py diff --git a/modules/keycloak/tests/test_keycloak.py b/tests/keycloak/test_keycloak.py similarity index 100% rename from modules/keycloak/tests/test_keycloak.py rename to tests/keycloak/test_keycloak.py diff --git a/modules/localstack/tests/test_localstack.py b/tests/localstack/test_localstack.py similarity index 100% rename from modules/localstack/tests/test_localstack.py rename to tests/localstack/test_localstack.py diff --git a/modules/minio/tests/test_minio.py b/tests/minio/test_minio.py similarity index 100% rename from modules/minio/tests/test_minio.py rename to tests/minio/test_minio.py diff --git a/modules/mongodb/tests/test_mongodb.py b/tests/mongodb/test_mongodb.py similarity index 100% rename from modules/mongodb/tests/test_mongodb.py rename to tests/mongodb/test_mongodb.py diff --git a/modules/mssql/tests/test_mssql.py b/tests/mssql/test_mssql.py similarity index 100% rename from modules/mssql/tests/test_mssql.py rename to tests/mssql/test_mssql.py diff --git a/modules/mysql/tests/test_mysql.py b/tests/mysql/test_mysql.py similarity index 100% rename from modules/mysql/tests/test_mysql.py rename to tests/mysql/test_mysql.py diff --git a/modules/neo4j/tests/test_neo4j.py b/tests/neo4j/test_neo4j.py similarity index 100% rename from modules/neo4j/tests/test_neo4j.py rename to tests/neo4j/test_neo4j.py diff --git a/modules/nginx/tests/test_nginx.py b/tests/nginx/test_nginx.py similarity index 100% rename from modules/nginx/tests/test_nginx.py rename to tests/nginx/test_nginx.py diff --git a/modules/opensearch/tests/test_opensearch.py b/tests/opensearch/test_opensearch.py similarity index 100% rename from modules/opensearch/tests/test_opensearch.py rename to tests/opensearch/test_opensearch.py diff --git a/modules/oracle/tests/test_oracle.py b/tests/oracle/test_oracle.py similarity index 100% rename from modules/oracle/tests/test_oracle.py rename to tests/oracle/test_oracle.py diff --git a/modules/postgres/tests/test_postgres.py b/tests/postgres/test_postgres.py similarity index 100% rename from modules/postgres/tests/test_postgres.py rename to tests/postgres/test_postgres.py diff --git a/modules/rabbitmq/tests/test_rabbitmq.py b/tests/rabbitmq/test_rabbitmq.py similarity index 100% rename from modules/rabbitmq/tests/test_rabbitmq.py rename to tests/rabbitmq/test_rabbitmq.py diff --git a/modules/redis/tests/test_redis.py b/tests/redis/test_redis.py similarity index 100% rename from modules/redis/tests/test_redis.py rename to tests/redis/test_redis.py diff --git a/modules/selenium/tests/test_selenium.py b/tests/selenium/test_selenium.py similarity index 100% rename from modules/selenium/tests/test_selenium.py rename to tests/selenium/test_selenium.py From 8c57f7a5f6eec439592378d1f64ed129d55b3edc Mon Sep 17 00:00:00 2001 From: kshramt Date: Thu, 21 Mar 2024 20:16:29 +0900 Subject: [PATCH 2/3] fix: Fix `Makefile` --- Makefile | 50 ++++++++++++++++---------------------------------- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index d8537efe..ec30cbf8 100644 --- a/Makefile +++ b/Makefile @@ -2,72 +2,54 @@ PYTHON_VERSIONS = 3.9 3.10 3.11 PYTHON_VERSION ?= 3.10 IMAGE = testcontainers-python:${PYTHON_VERSION} RUN = docker run --rm -it -# Get all directories that contain a setup.py and get the directory name. -PACKAGES = core $(addprefix modules/,$(notdir $(wildcard modules/*))) +TEST_NAMES := $(notdir $(wildcard tests/*)) -# All */dist folders for each of the packages. -DISTRIBUTIONS = $(addsuffix /dist,${PACKAGES}) -UPLOAD = $(addsuffix /upload,${PACKAGES}) -# All */tests folders for each of the test suites. -TESTS = $(addsuffix /tests,$(filter-out meta,${PACKAGES})) +TESTS := $(addprefix tests/,$(TEST_NAMES)) TESTS_DIND = $(addsuffix -dind,${TESTS}) -DOCTESTS = $(addsuffix /doctest,$(filter-out meta,${PACKAGES})) -# All linting targets. -LINT = $(addsuffix /lint,${PACKAGES}) -# Targets to build a distribution for each package. -dist: ${DISTRIBUTIONS} -${DISTRIBUTIONS} : %/dist : %/setup.py - cd $* \ - && python setup.py bdist_wheel \ - && twine check dist/* +dist: + poetry build \ + && poetry run twine check dist/*.tar.gz # Targets to run the test suite for each package. tests : ${TESTS} -${TESTS} : %/tests : - poetry run pytest -v --cov=testcontainers.$* $*/tests +${TESTS} : tests/% : + poetry run pytest -v --cov=testcontainers.$* tests/$* # Target to lint the code. lint: pre-commit run -a # Targets to publish packages. -upload : ${UPLOAD} -${UPLOAD} : %/upload : - if [ ${TWINE_REPOSITORY}-$* = testpypi-meta ]; then \ - echo "Cannot upload meta package to testpypi because of missing permissions."; \ - else \ - twine upload --non-interactive --skip-existing $*/dist/*; \ - fi +upload : + poetry run twine upload --non-interactive --skip-existing dist/* # Targets to build docker images image: + mkdir -p build/ poetry export -f requirements.txt -o build/requirements.txt docker build --build-arg version=${PYTHON_VERSION} -t ${IMAGE} . # Targets to run tests in docker containers tests-dind : ${TESTS_DIND} -${TESTS_DIND} : %/tests-dind : image +${TESTS_DIND} : tests/%-dind : image ${RUN} -v /var/run/docker.sock:/var/run/docker.sock ${IMAGE} \ - bash -c "make $*/lint $*/tests" + bash -c "make lint tests/$*" # Target to build the documentation docs : poetry run sphinx-build -nW . docs/_build -doctest : ${DOCTESTS} +doctest : poetry run sphinx-build -b doctest . docs/_build -${DOCTESTS} : %/doctest : - poetry run sphinx-build -b doctest -c doctests $* docs/_build - # Remove any generated files. clean : rm -rf docs/_build - rm -rf */build - rm -rf */dist + rm -rf build + rm -rf dist rm -rf */*.egg-info # Targets that do not generate file-level artifacts. -.PHONY : clean dists ${DISTRIBUTIONS} docs doctests image tests ${TESTS} +.PHONY : clean dists docs doctests image tests ${TESTS} From 50c70fa88bca9f097cb3808256b78e3774446895 Mon Sep 17 00:00:00 2001 From: kshramt Date: Thu, 21 Mar 2024 20:45:08 +0900 Subject: [PATCH 3/3] fix: Fix GitHub Actions --- .github/workflows/ci-community.yml | 12 +++++++----- .github/workflows/ci-core.yml | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-community.yml b/.github/workflows/ci-community.yml index 5188b9d4..472b2cbd 100644 --- a/.github/workflows/ci-community.yml +++ b/.github/workflows/ci-community.yml @@ -6,11 +6,13 @@ on: push: branches: [ main ] paths: - - "modules/**" + - "testcontainers/**" + - "!testcontainers/core/**" pull_request: branches: [ main ] paths: - - "modules/**" + - "testcontainers/**" + - "!testcontainers/core/**" jobs: track-modules: @@ -24,7 +26,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v42 with: - path: "./modules" + path: "./testcontainers" diff_relative: true dir_names: true dir_names_exclude_current_dir: true @@ -32,7 +34,7 @@ jobs: - name: Compute modules from files id: compute-changes run: | - modules=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | jq '.[] | split("/") | first' | jq -s -c '. | unique') + modules=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | jq '.[] | split("/") | first' | jq -s -c '[.[] | select(. != "core")] | unique')) echo "computed_modules=$modules" echo "computed_modules=$modules" >> $GITHUB_OUTPUT outputs: @@ -56,4 +58,4 @@ jobs: - name: Install Python dependencies run: poetry install -E ${{ matrix.module }} - name: Run tests - run: make modules/${{ matrix.module }}/tests + run: make tests/${{ matrix.module }} diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 65bb2388..2e903be3 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -27,4 +27,4 @@ jobs: - name: Run twine check run: poetry build && poetry run twine check dist/*.tar.gz - name: Run tests - run: make core/tests + run: make tests/core