diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..982c440d --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +branch = true +omit = + */__init__.py + +[report] +show_missing = true +fail_under = 83 \ No newline at end of file diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 00000000..cedea1bf --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,4 @@ +assign_issues: + - googleapis/langchain-csql-pg +assign_prs: + - googleapis/langchain-csql-pg diff --git a/.github/header-checker-lint.yml b/.github/header-checker-lint.yml index 73f01db0..448c4c2e 100644 --- a/.github/header-checker-lint.yml +++ b/.github/header-checker-lint.yml @@ -11,6 +11,7 @@ sourceFileExtensions: - "py" - "text" ignoreFiles: + - ".github/blunderbuss.yml" - ".github/release-please.yml" - ".github/release-trigger.yml" - ".github/header-checker-lint.yml" diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index c2ce28db..7eb2ec20 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -273,10 +273,12 @@ jaraco-classes==3.3.1 \ jeepney==0.8.0 \ --hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \ --hash=sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755 - # via secretstorage -jinja2==3.1.3 \ - --hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \ - --hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90 + # via + # keyring + # secretstorage +jinja2==3.1.4 \ + --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ + --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d # via gcp-releasetool keyring==24.3.1 \ --hash=sha256:c3327b6ffafc0e8befbdb597cacdb4928ffe5c1212f7645f186e6d9957a898db \ @@ -451,9 +453,9 @@ readme-renderer==42.0 \ --hash=sha256:13d039515c1f24de668e2c93f2e877b9dbe6c6c32328b90a40a49d8b2b85f36d \ --hash=sha256:2d55489f83be4992fe4454939d1a051c33edbab778e82761d060c9fc6b308cd1 # via twine -requests==2.31.0 \ - --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ - --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 +requests==2.32.0 \ + --hash=sha256:f2c3881dddb70d056c5bd7600a4fae312b2a300e39be6a118d30b90bd27262b5 \ + --hash=sha256:fa5490319474c82ef1d2c9bc459d3652e3ae4ef4c4ebdd18a21145a47ca4b6b8 # via # gcp-releasetool # google-api-core @@ -479,7 +481,9 @@ rsa==4.9 \ secretstorage==3.3.3 \ --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 - # via -r requirements.in + # via + # -r requirements.in + # keyring six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 diff --git a/CHANGELOG.md b/CHANGELOG.md index 739a7fae..51cc3777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.5.0](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/compare/v0.4.1...v0.5.0) (2024-05-30) + + +### Features + +* Support LangChain v0.2 ([#133](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/issues/133)) ([4364a04](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/commit/4364a04bece61ab16f29cc37900dd79edc2128e2)) + ## [0.4.1](https://github.com/googleapis/langchain-google-cloud-sql-pg-python/compare/v0.4.0...v0.4.1) (2024-05-02) diff --git a/DEVELOPER.md b/DEVELOPER.md index 3cb0d40b..4118a0da 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -59,7 +59,7 @@ substitutions: _VERSION: "3.8" ``` -Use `gcloud builds triggers import --source=trigger.yaml` create triggers via the command line +Use `gcloud builds triggers import --source=trigger.yaml` to create triggers via the command line #### Project Setup @@ -78,6 +78,18 @@ Use `gcloud builds triggers import --source=trigger.yaml` create triggers via th To run Cloud Build tests on GitHub from external contributors, ie RenovateBot, comment: `/gcbrun`. +#### Code Coverage +Please make sure your code is fully tested. The Cloud Build integration tests are run with the `pytest-cov` code coverage plugin. They fail for PRs with a code coverage less than the threshold specified in `.coveragerc`. If your file is inside the main module and should be ignored by code coverage check, add it to the `omit` section of `.coveragerc`. + +Check for code coverage report in any Cloud Build integration test log. +Here is a breakdown of the report: +- `Stmts`: lines of executable code (statements). +- `Miss`: number of lines not covered by tests. +- `Branch`: branches of executable code (e.g an if-else clause may count as 1 statement but 2 branches; test for both conditions to have both branches covered). +- `BrPart`: number of branches not covered by tests. +- `Cover`: average coverage of files. +- `Missing`: lines that are not covered by tests. + ## Documentation ### LangChain Integration Docs diff --git a/integration.cloudbuild.yaml b/integration.cloudbuild.yaml index b375ada7..26a29290 100644 --- a/integration.cloudbuild.yaml +++ b/integration.cloudbuild.yaml @@ -26,7 +26,7 @@ steps: - id: Run integration tests name: python:${_VERSION} entrypoint: python - args: ["-m", "pytest"] + args: ["-m", "pytest", "--cov=langchain_google_cloud_sql_pg", "--cov-config=.coveragerc", "tests/"] env: - "PROJECT_ID=$PROJECT_ID" - "INSTANCE_ID=$_INSTANCE_ID" diff --git a/pyproject.toml b/pyproject.toml index 7caffb57..378a771c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,9 +11,10 @@ authors = [ dependencies = [ "cloud-sql-python-connector[asyncpg] >= 1.7.0, <2.0.0", - "langchain-core>=0.1.1, <2.0.0 ", - "langchain-community>=0.0.18, <0.1.0", - "numpy>=1.24.4, <2.0.0", + "langchain-core>=0.1.1, <1.0.0 ", + "langchain-community>=0.0.18, <0.3.0", + "numpy==1.24.4; python_version<='3.8'", + "numpy>=1.24.4, <2.0.0; python_version>'3.8'", "pgvector>=0.2.5, <1.0.0", "SQLAlchemy[asyncio]>=2.0.25, <3.0.0" ] @@ -43,9 +44,10 @@ Changelog = "https://github.com/googleapis/langchain-google-cloud-sql-pg-python/ test = [ "black[jupyter]==23.12.1", "isort==5.13.2", - "mypy==1.9.0", - "pytest-asyncio==0.23.5.post1", - "pytest==7.4.4" + "mypy==1.10.0", + "pytest-asyncio==0.23.7", + "pytest==7.4.4", + "pytest-cov==5.0.0" ] [build-system] diff --git a/requirements.txt b/requirements.txt index ebb83631..db27ab05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -cloud-sql-python-connector[asyncpg]==1.8.0 -langchain-core==0.1.35 -langchain-community==0.0.28 -numpy==1.24.4; python_version<='3.8' +cloud-sql-python-connector[asyncpg]==1.9.2 +langchain-core==0.2.2 +langchain-community==0.2.1 +numpy===1.24.4; python_version<='3.8' numpy==1.26.4; python_version>'3.8' pgvector==0.2.5 -SQLAlchemy[asyncio]==2.0.28 +SQLAlchemy[asyncio]==2.0.30 diff --git a/src/langchain_google_cloud_sql_pg/version.py b/src/langchain_google_cloud_sql_pg/version.py index 2ebf21c0..4f5353ed 100644 --- a/src/langchain_google_cloud_sql_pg/version.py +++ b/src/langchain_google_cloud_sql_pg/version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.4.1" +__version__ = "0.5.0"