From 6ea54348e00e418fdca6c521ae5382a69028ac2f Mon Sep 17 00:00:00 2001 From: Arthur Cheng Date: Mon, 24 Nov 2025 22:42:14 -0800 Subject: [PATCH 1/5] modify oracledb pyproject for updated standard and fix get_min_versions --- .github/scripts/get_min_versions.py | 39 +++++++++++++++++++++++----- libs/oracledb/pyproject.toml | 40 ++++++++++++++--------------- 2 files changed, 52 insertions(+), 27 deletions(-) diff --git a/.github/scripts/get_min_versions.py b/.github/scripts/get_min_versions.py index ca69b5c..2ac32b2 100644 --- a/.github/scripts/get_min_versions.py +++ b/.github/scripts/get_min_versions.py @@ -34,8 +34,34 @@ def get_min_version_from_toml(toml_path: str): with open(toml_path, "rb") as file: toml_data = tomllib.load(file) - # Get the dependencies from tool.poetry.dependencies - dependencies = toml_data["tool"]["poetry"]["dependencies"] + # Get the dependencies from [project] section (PEP 621 format) + if "project" not in toml_data or "dependencies" not in toml_data["project"]: + raise ValueError("Could not find dependencies in [project] section") + + dependencies_list = toml_data["project"]["dependencies"] + + # Parse dependencies list into a dictionary + # Format: "package-name>=x.x.x,=x.x.x; python_version < '3.10'" + dependencies = {} + for dep in dependencies_list: + # Remove environment markers (everything after semicolon) + dep_without_marker = dep.split(";")[0].strip() + + # Extract package name and version spec + match = re.match(r"^([a-zA-Z0-9_-]+)(.*)$", dep_without_marker) + if match: + pkg_name = match.group(1) + version_spec = match.group(2) + + # If this package already exists, collect both version specs + if pkg_name in dependencies: + # Store as a list to handle multiple version constraints + if isinstance(dependencies[pkg_name], list): + dependencies[pkg_name].append(version_spec) + else: + dependencies[pkg_name] = [dependencies[pkg_name], version_spec] + else: + dependencies[pkg_name] = version_spec # Initialize a dictionary to store the minimum versions min_versions = {} @@ -44,7 +70,7 @@ def get_min_version_from_toml(toml_path: str): for lib in MIN_VERSION_LIBS: # Check if the lib is present in the dependencies if lib in dependencies: - # Get the version string or list + # Get the version string(s) version_spec = dependencies[lib] # Handle list format (multiple version constraints for different Python versions) @@ -52,15 +78,14 @@ def get_min_version_from_toml(toml_path: str): # Extract all version strings from the list and find the minimum versions = [] for spec in version_spec: - if isinstance(spec, dict) and "version" in spec: - versions.append(get_min_version(spec["version"])) + if spec: + versions.append(get_min_version(spec)) # If we found versions, use the minimum one if versions: - # Parse all versions and select the minimum min_version = min(versions, key=parse_version) min_versions[lib] = min_version - elif isinstance(version_spec, str): + elif isinstance(version_spec, str) and version_spec: # Handle simple string format min_version = get_min_version(version_spec) min_versions[lib] = min_version diff --git a/libs/oracledb/pyproject.toml b/libs/oracledb/pyproject.toml index 142bf6a..e95311a 100644 --- a/libs/oracledb/pyproject.toml +++ b/libs/oracledb/pyproject.toml @@ -1,25 +1,25 @@ -[tool.poetry] +[project] name = "langchain-oracledb" version = "1.1.0" description = "An integration package connecting Oracle Database and LangChain" -authors = [] readme = "README.md" -repository = "https://github.com/oracle/langchain-oracle" -license = "UPL" +license = "UPL-1.0" +requires-python = ">=3.9,<4.0" +dependencies = [ + "langchain-core>=0.3.15,<1.0.0; python_version < '3.10'", + "langchain-core>=1.0.0,<2.0.0; python_version >= '3.10'", + "langchain-community>=0.3.0", + "oracledb>=2.2.0", + "pydantic>=2,<3", + "numpy>=1.21,<3", +] -[tool.poetry.urls] +[project.urls] "Source Code" = "https://github.com/oracle/langchain-oracle/tree/main/libs/oracledb" +Repository = "https://github.com/oracle/langchain-oracle" -[tool.poetry.dependencies] -python = ">=3.9,<4.0" -langchain-core = [ - { version = "^0.3.15", python = "<3.10" }, - { version = "^1.0.0", python = ">=3.10" } -] -langchain-community = ">=0.3.0" -oracledb = ">=2.2.0" -pydantic = ">=2,<3" -numpy = ">=1.21,<3" +[tool.poetry] +package-mode = true [tool.poetry.group.test] optional = true @@ -32,8 +32,8 @@ pytest-asyncio = "^0.23.2" pytest-watcher = "^0.3.4" sentence-transformers = "^5.0.0" langchain-tests = [ - { version = "^0.3.21", python = "<3.10" }, - { version = "^1.0.0", python = ">=3.10" } + { version = "^0.3.21", python = "<3.10" }, + { version = "^1.0.0", python = ">=3.10" } ] [tool.poetry.group.codespell] @@ -64,6 +64,9 @@ optional = true [tool.ruff] +[tool.ruff.format] +docstring-code-format = true + [tool.ruff.lint] select = [ "E", # pycodestyle @@ -75,9 +78,6 @@ ignore = [ "COM812", # Messes with the formatter ] -[tool.ruff.format] -docstring-code-format = true - [tool.mypy] plugins = ["pydantic.mypy"] check_untyped_defs = true From 6ef787abac3d6bf11a895fb89a2a3c426e023671 Mon Sep 17 00:00:00 2001 From: Arthur Cheng Date: Mon, 24 Nov 2025 23:07:20 -0800 Subject: [PATCH 2/5] update poetry.lock to reflect the latest pyproject.toml change --- libs/oracledb/poetry.lock | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libs/oracledb/poetry.lock b/libs/oracledb/poetry.lock index 93def09..69cb545 100644 --- a/libs/oracledb/poetry.lock +++ b/libs/oracledb/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -1111,6 +1111,8 @@ files = [ {file = "greenlet-3.2.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c2ca18a03a8cfb5b25bc1cbe20f3d9a4c80d8c3b13ba3df49ac3961af0b1018d"}, {file = "greenlet-3.2.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:9fe0a28a7b952a21e2c062cd5756d34354117796c6d9215a87f55e38d15402c5"}, {file = "greenlet-3.2.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8854167e06950ca75b898b104b63cc646573aa5fef1353d4508ecdd1ee76254f"}, + {file = "greenlet-3.2.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f47617f698838ba98f4ff4189aef02e7343952df3a615f847bb575c3feb177a7"}, + {file = "greenlet-3.2.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:af41be48a4f60429d5cad9d22175217805098a9ef7c40bfef44f7669fb9d74d8"}, {file = "greenlet-3.2.4-cp310-cp310-win_amd64.whl", hash = "sha256:73f49b5368b5359d04e18d15828eecc1806033db5233397748f4ca813ff1056c"}, {file = "greenlet-3.2.4-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:96378df1de302bc38e99c3a9aa311967b7dc80ced1dcc6f171e99842987882a2"}, {file = "greenlet-3.2.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:1ee8fae0519a337f2329cb78bd7a8e128ec0f881073d43f023c7b8d4831d5246"}, @@ -1120,6 +1122,8 @@ files = [ {file = "greenlet-3.2.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2523e5246274f54fdadbce8494458a2ebdcdbc7b802318466ac5606d3cded1f8"}, {file = "greenlet-3.2.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1987de92fec508535687fb807a5cea1560f6196285a4cde35c100b8cd632cc52"}, {file = "greenlet-3.2.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:55e9c5affaa6775e2c6b67659f3a71684de4c549b3dd9afca3bc773533d284fa"}, + {file = "greenlet-3.2.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c9c6de1940a7d828635fbd254d69db79e54619f165ee7ce32fda763a9cb6a58c"}, + {file = "greenlet-3.2.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:03c5136e7be905045160b1b9fdca93dd6727b180feeafda6818e6496434ed8c5"}, {file = "greenlet-3.2.4-cp311-cp311-win_amd64.whl", hash = "sha256:9c40adce87eaa9ddb593ccb0fa6a07caf34015a29bf8d344811665b573138db9"}, {file = "greenlet-3.2.4-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:3b67ca49f54cede0186854a008109d6ee71f66bd57bb36abd6d0a0267b540cdd"}, {file = "greenlet-3.2.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ddf9164e7a5b08e9d22511526865780a576f19ddd00d62f8a665949327fde8bb"}, @@ -1129,6 +1133,8 @@ files = [ {file = "greenlet-3.2.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b3812d8d0c9579967815af437d96623f45c0f2ae5f04e366de62a12d83a8fb0"}, {file = "greenlet-3.2.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:abbf57b5a870d30c4675928c37278493044d7c14378350b3aa5d484fa65575f0"}, {file = "greenlet-3.2.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:20fb936b4652b6e307b8f347665e2c615540d4b42b3b4c8a321d8286da7e520f"}, + {file = "greenlet-3.2.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ee7a6ec486883397d70eec05059353b8e83eca9168b9f3f9a361971e77e0bcd0"}, + {file = "greenlet-3.2.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:326d234cbf337c9c3def0676412eb7040a35a768efc92504b947b3e9cfc7543d"}, {file = "greenlet-3.2.4-cp312-cp312-win_amd64.whl", hash = "sha256:a7d4e128405eea3814a12cc2605e0e6aedb4035bf32697f72deca74de4105e02"}, {file = "greenlet-3.2.4-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:1a921e542453fe531144e91e1feedf12e07351b1cf6c9e8a3325ea600a715a31"}, {file = "greenlet-3.2.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd3c8e693bff0fff6ba55f140bf390fa92c994083f838fece0f63be121334945"}, @@ -1138,6 +1144,8 @@ files = [ {file = "greenlet-3.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:23768528f2911bcd7e475210822ffb5254ed10d71f4028387e5a99b4c6699671"}, {file = "greenlet-3.2.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:00fadb3fedccc447f517ee0d3fd8fe49eae949e1cd0f6a611818f4f6fb7dc83b"}, {file = "greenlet-3.2.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:d25c5091190f2dc0eaa3f950252122edbbadbb682aa7b1ef2f8af0f8c0afefae"}, + {file = "greenlet-3.2.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6e343822feb58ac4d0a1211bd9399de2b3a04963ddeec21530fc426cc121f19b"}, + {file = "greenlet-3.2.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ca7f6f1f2649b89ce02f6f229d7c19f680a6238af656f61e0115b24857917929"}, {file = "greenlet-3.2.4-cp313-cp313-win_amd64.whl", hash = "sha256:554b03b6e73aaabec3745364d6239e9e012d64c68ccd0b8430c64ccc14939a8b"}, {file = "greenlet-3.2.4-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:49a30d5fda2507ae77be16479bdb62a660fa51b1eb4928b524975b3bde77b3c0"}, {file = "greenlet-3.2.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:299fd615cd8fc86267b47597123e3f43ad79c9d8a22bebdce535e53550763e2f"}, @@ -1145,6 +1153,8 @@ files = [ {file = "greenlet-3.2.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b4a1870c51720687af7fa3e7cda6d08d801dae660f75a76f3845b642b4da6ee1"}, {file = "greenlet-3.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:061dc4cf2c34852b052a8620d40f36324554bc192be474b9e9770e8c042fd735"}, {file = "greenlet-3.2.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:44358b9bf66c8576a9f57a590d5f5d6e72fa4228b763d0e43fee6d3b06d3a337"}, + {file = "greenlet-3.2.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2917bdf657f5859fbf3386b12d68ede4cf1f04c90c3a6bc1f013dd68a22e2269"}, + {file = "greenlet-3.2.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:015d48959d4add5d6c9f6c5210ee3803a830dce46356e3bc326d6776bde54681"}, {file = "greenlet-3.2.4-cp314-cp314-win_amd64.whl", hash = "sha256:e37ab26028f12dbb0ff65f29a8d3d44a765c61e729647bf2ddfbbed621726f01"}, {file = "greenlet-3.2.4-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:b6a7c19cf0d2742d0809a4c05975db036fdff50cd294a93632d6a310bf9ac02c"}, {file = "greenlet-3.2.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:27890167f55d2387576d1f41d9487ef171849ea0359ce1510ca6e06c8bece11d"}, @@ -1154,6 +1164,8 @@ files = [ {file = "greenlet-3.2.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9913f1a30e4526f432991f89ae263459b1c64d1608c0d22a5c79c287b3c70df"}, {file = "greenlet-3.2.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b90654e092f928f110e0007f572007c9727b5265f7632c2fa7415b4689351594"}, {file = "greenlet-3.2.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:81701fd84f26330f0d5f4944d4e92e61afe6319dcd9775e39396e39d7c3e5f98"}, + {file = "greenlet-3.2.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:28a3c6b7cd72a96f61b0e4b2a36f681025b60ae4779cc73c1535eb5f29560b10"}, + {file = "greenlet-3.2.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:52206cd642670b0b320a1fd1cbfd95bca0e043179c1d8a045f2c6109dfe973be"}, {file = "greenlet-3.2.4-cp39-cp39-win32.whl", hash = "sha256:65458b409c1ed459ea899e939f0e1cdb14f58dbc803f2f93c5eab5694d32671b"}, {file = "greenlet-3.2.4-cp39-cp39-win_amd64.whl", hash = "sha256:d2e685ade4dafd447ede19c31277a224a239a0a1a4eca4e6390efedf20260cfb"}, {file = "greenlet-3.2.4.tar.gz", hash = "sha256:0dca0d95ff849f9a364385f36ab49f50065d76964944638be9691e1832e9f86d"}, @@ -5728,4 +5740,4 @@ cffi = ["cffi (>=1.17,<2.0) ; platform_python_implementation != \"PyPy\" and pyt [metadata] lock-version = "2.1" python-versions = ">=3.9,<4.0" -content-hash = "91777539b9efc75579a2a6a40b3b217e4c42f0209b1ddbef5e9b08ee4bfd272a" +content-hash = "cab7fdc84bd6341d88baf80fc84d54bdaeba9500dfbc3a267829617f7814acd1" From 8b3d4d7f97b08680211a1225d6e731c662eb60b9 Mon Sep 17 00:00:00 2001 From: Arthur Cheng Date: Tue, 25 Nov 2025 10:20:22 -0800 Subject: [PATCH 3/5] add min version test in CI --- .github/workflows/_test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index e29aad3..ed52e4d 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -49,6 +49,24 @@ jobs: run: | make test + - name: Get minimum versions + working-directory: ${{ inputs.working-directory }} + id: min-version + run: | + poetry run pip install packaging + min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml)" + echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT" + echo "min-versions=$min_versions" + + - name: Run unit tests with minimum dependency versions + if: ${{ steps.min-version.outputs.min-versions != '' }} + env: + MIN_VERSIONS: ${{ steps.min-version.outputs.min-versions }} + run: | + poetry run pip install $MIN_VERSIONS + make tests + working-directory: ${{ inputs.working-directory }} + - name: Ensure the tests did not create any additional files shell: bash run: | From 3d813e12d3b11fea6372f58d55fc75cc7fc82318 Mon Sep 17 00:00:00 2001 From: Arthur Cheng Date: Tue, 25 Nov 2025 10:39:13 -0800 Subject: [PATCH 4/5] fix tomllib error with python3.9 --- .github/scripts/get_min_versions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/scripts/get_min_versions.py b/.github/scripts/get_min_versions.py index 2ac32b2..3ae299a 100644 --- a/.github/scripts/get_min_versions.py +++ b/.github/scripts/get_min_versions.py @@ -1,9 +1,13 @@ import sys -import tomllib from packaging.version import parse as parse_version import re +try: + import tomllib +except ModuleNotFoundError: + import pip._vendor.tomli as tomllib + MIN_VERSION_LIBS = ["langchain-core"] From 22f6ca643156cd360e032532b659117a7523a8c5 Mon Sep 17 00:00:00 2001 From: Arthur Cheng Date: Tue, 25 Nov 2025 10:53:07 -0800 Subject: [PATCH 5/5] fix dep version for langchain --- libs/oci/poetry.lock | 2 +- libs/oci/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/oci/poetry.lock b/libs/oci/poetry.lock index 9661c90..6961cfc 100644 --- a/libs/oci/poetry.lock +++ b/libs/oci/poetry.lock @@ -4202,4 +4202,4 @@ cffi = ["cffi (>=1.17,<2.0) ; platform_python_implementation != \"PyPy\" and pyt [metadata] lock-version = "2.1" python-versions = ">=3.9,<4.0" -content-hash = "6a7391f96b265604ea97017f60114ac4ab8d1ee46db64b3b3c8ee1da3881951a" +content-hash = "09253133efa05bb1548acac554ff98a5d9540f1845f02481619828050a74f96a" diff --git a/libs/oci/pyproject.toml b/libs/oci/pyproject.toml index d988edc..0dbbcba 100644 --- a/libs/oci/pyproject.toml +++ b/libs/oci/pyproject.toml @@ -6,7 +6,7 @@ readme = "README.md" license = "UPL-1.0" requires-python = ">=3.9,<4.0" dependencies = [ - "langchain-core>=0.3.20,<1.0.0", + "langchain-core>=0.3.78,<1.0.0", "langchain>=0.3.20,<1.0.0", "oci>=2.161.0", "pydantic>=2,<3",