From eeece12bc61654a6513e1ee70bd2a2871c801e10 Mon Sep 17 00:00:00 2001 From: Vemund Santi Date: Sat, 30 Mar 2024 17:28:06 +0100 Subject: [PATCH 1/2] Remove unsupported Oracle community module --- .github/settings.yml | 1 - index.rst | 1 - modules/oracle/README.rst | 2 -- .../oracle/testcontainers/oracle/__init__.py | 33 ------------------- modules/oracle/tests/test_oracle.py | 20 ----------- pyproject.toml | 7 ---- 6 files changed, 64 deletions(-) delete mode 100644 modules/oracle/README.rst delete mode 100644 modules/oracle/testcontainers/oracle/__init__.py delete mode 100644 modules/oracle/tests/test_oracle.py diff --git a/.github/settings.yml b/.github/settings.yml index e72584e6..c0ee8a01 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -73,7 +73,6 @@ labels: - { name: '📦 package: mongodb', color: '#0052CC', description: '' } - { name: '📦 package: mssql', color: '#0052CC', description: '' } - { name: '📦 package: neo4j', color: '#0052CC', description: '' } - - { name: '📦 package: oracle', color: '#0052CC', description: '' } - { name: '📦 package: postgres', color: '#0052CC', description: '' } - { name: '📦 package: rabbitmq', color: '#0052CC', description: '' } - { name: '📦 package: selenium', color: '#0052CC', description: '' } diff --git a/index.rst b/index.rst index 71828de2..caff1417 100644 --- a/index.rst +++ b/index.rst @@ -32,7 +32,6 @@ testcontainers-python facilitates the use of Docker containers for functional an modules/neo4j/README modules/nginx/README modules/opensearch/README - modules/oracle/README modules/postgres/README modules/rabbitmq/README modules/redis/README diff --git a/modules/oracle/README.rst b/modules/oracle/README.rst deleted file mode 100644 index bbd5d3b5..00000000 --- a/modules/oracle/README.rst +++ /dev/null @@ -1,2 +0,0 @@ -.. autoclass:: testcontainers.oracle.OracleDbContainer -.. title:: testcontainers.oracle.OracleDbContainer diff --git a/modules/oracle/testcontainers/oracle/__init__.py b/modules/oracle/testcontainers/oracle/__init__.py deleted file mode 100644 index c0a5e657..00000000 --- a/modules/oracle/testcontainers/oracle/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -from testcontainers.core.generic import DbContainer - - -class OracleDbContainer(DbContainer): - """ - Oracle database container. - - Example: - - .. code-block:: - - >>> import sqlalchemy - >>> from testcontainers.oracle import OracleDbContainer - - >>> with OracleDbContainer() as oracle: - ... engine = sqlalchemy.create_engine(oracle.get_connection_url()) - ... with engine.begin() as connection: - ... result = connection.execute(sqlalchemy.text("select * from V$VERSION")) - """ - - def __init__(self, image: str = "wnameless/oracle-xe-11g-r2:latest", **kwargs) -> None: - super().__init__(image=image, **kwargs) - self.container_port = 1521 - self.with_exposed_ports(self.container_port) - self.with_env("ORACLE_ALLOW_REMOTE", "true") - - def get_connection_url(self) -> str: - return super()._create_connection_url( - dialect="oracle", username="system", password="oracle", port=self.container_port, dbname="xe" - ) - - def _configure(self) -> None: - pass diff --git a/modules/oracle/tests/test_oracle.py b/modules/oracle/tests/test_oracle.py deleted file mode 100644 index 32d58b46..00000000 --- a/modules/oracle/tests/test_oracle.py +++ /dev/null @@ -1,20 +0,0 @@ -import pytest -import sqlalchemy - -from testcontainers.oracle import OracleDbContainer - - -@pytest.mark.skip(reason="needs oracle client libraries unavailable on Travis") -def test_docker_run_oracle(): - versions = { - "Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production", - "PL/SQL Release 11.2.0.2.0 - Production", - "CORE\t11.2.0.2.0\tProduction", - "TNS for Linux: Version 11.2.0.2.0 - Production", - "NLSRTL Version 11.2.0.2.0 - Production", - } - with OracleDbContainer() as oracledb: - engine = sqlalchemy.create_engine(oracledb.get_connection_url()) - with engine.begin() as connection: - result = connection.execute(sqlalchemy.text("select * from V$VERSION")) - assert {row[0] for row in result} == versions diff --git a/pyproject.toml b/pyproject.toml index c48dce7e..f29342e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,6 @@ packages = [ { 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" }, @@ -80,7 +79,6 @@ pymssql = { version = "*", optional = true } pymysql = { version = "*", extras = ["rsa"], optional = true } neo4j = { version = "*", optional = true } opensearch-py = { version = "*", optional = true } -cx_Oracle = { version = "*", optional = true } pika = { version = "*", optional = true } redis = { version = "*", optional = true } selenium = { version = "*", optional = true } @@ -103,7 +101,6 @@ mysql = ["sqlalchemy", "pymysql"] neo4j = ["neo4j"] nginx = [] opensearch = ["opensearch-py"] -oracle = ["sqlalchemy", "cx_Oracle"] postgres = [] rabbitmq = ["pika"] redis = ["redis"] @@ -138,9 +135,6 @@ log_cli_level = "INFO" [tool.coverage.run] branch = true -omit = [ - "oracle.py" -] [tool.coverage.report] exclude_lines = [ @@ -235,7 +229,6 @@ mypy_path = [ # "modules/neo4j", # "modules/nginx", # "modules/opensearch", -# "modules/oracle", # "modules/postgres", # "modules/rabbitmq", # "modules/redis", From 2c218249c79307f970304160c0cf849abdd60381 Mon Sep 17 00:00:00 2001 From: Vemund Santi Date: Sat, 30 Mar 2024 17:35:46 +0100 Subject: [PATCH 2/2] Update lockfile after removing Oracle dependencies --- poetry.lock | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/poetry.lock b/poetry.lock index 357dd660..a48a5c1a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -675,31 +675,6 @@ ssh = ["bcrypt (>=3.1.5)"] test = ["certifi", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] -[[package]] -name = "cx-oracle" -version = "8.3.0" -description = "Python interface to Oracle" -optional = true -python-versions = "*" -files = [ - {file = "cx_Oracle-8.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b6a23da225f03f50a81980c61dbd6a358c3575f212ca7f4c22bb65a9faf94f7f"}, - {file = "cx_Oracle-8.3.0-cp310-cp310-win32.whl", hash = "sha256:715a8bbda5982af484ded14d184304cc552c1096c82471dd2948298470e88a04"}, - {file = "cx_Oracle-8.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:07f01608dfb6603a8f2a868fc7c7bdc951480f187df8dbc50f4d48c884874e6a"}, - {file = "cx_Oracle-8.3.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4b3afe7a911cebaceda908228d36839f6441cbd38e5df491ec25960562bb01a0"}, - {file = "cx_Oracle-8.3.0-cp36-cp36m-win32.whl", hash = "sha256:076ffb71279d6b2dcbf7df028f62a01e18ce5bb73d8b01eab582bf14a62f4a61"}, - {file = "cx_Oracle-8.3.0-cp36-cp36m-win_amd64.whl", hash = "sha256:b82e4b165ffd807a2bd256259a6b81b0a2452883d39f987509e2292d494ea163"}, - {file = "cx_Oracle-8.3.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b902db61dcdcbbf8dd981f5a46d72fef40c5150c7fc0eb0f0698b462d6eb834e"}, - {file = "cx_Oracle-8.3.0-cp37-cp37m-win32.whl", hash = "sha256:4c82ca74442c298ceec56d207450c192e06ecf8ad52eb4aaad0812e147ceabf7"}, - {file = "cx_Oracle-8.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:54164974d526b76fdefb0b66a42b68e1fca5df78713d0eeb8c1d0047b83f6bcf"}, - {file = "cx_Oracle-8.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:410747d542e5f94727f5f0e42e9706c772cf9094fb348ce965ab88b3a9e4d2d8"}, - {file = "cx_Oracle-8.3.0-cp38-cp38-win32.whl", hash = "sha256:3baa878597c5fadb2c72f359f548431c7be001e722ce4a4ebdf3d2293a1bb70b"}, - {file = "cx_Oracle-8.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:de42bdc882abdc5cea54597da27a05593b44143728e5b629ad5d35decb1a2036"}, - {file = "cx_Oracle-8.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:df412238a9948340591beee9ec64fa62a2efacc0d91107034a7023e2991fba97"}, - {file = "cx_Oracle-8.3.0-cp39-cp39-win32.whl", hash = "sha256:70d3cf030aefd71f99b45beba77237b2af448adf5e26be0db3d0d3dee6ea4230"}, - {file = "cx_Oracle-8.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:bf01ce87edb4ef663b2e5bd604e1e0154d2cc2f12b60301f788b569d9db8a900"}, - {file = "cx_Oracle-8.3.0.tar.gz", hash = "sha256:3b2d215af4441463c97ea469b9cc307460739f89fdfa8ea222ea3518f1a424d9"}, -] - [[package]] name = "deprecation" version = "2.1.0" @@ -3280,7 +3255,6 @@ mysql = ["pymysql", "sqlalchemy"] neo4j = ["neo4j"] nginx = [] opensearch = ["opensearch-py"] -oracle = ["cx_Oracle", "sqlalchemy"] postgres = [] rabbitmq = ["pika"] redis = ["redis"] @@ -3289,4 +3263,4 @@ selenium = ["selenium"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "d58539d14fbcf79c97d6dde14d76a86b52cc11d059bd5e211655be73b74c4993" +content-hash = "11c222c8d214a301d4ff3192c922f9e6f1ab327920aeb5ce3eb2ed68d5070629"