diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..2c634d5 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +branch = true +omit = + */__init__.py + +[report] +show_missing = true +fail_under = 90 \ No newline at end of file diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 0000000..e572fb5 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,4 @@ +assign_issues: + - googleapis/langchain-bigtable +assign_prs: + - googleapis/langchain-bigtable diff --git a/.github/header-checker-lint.yml b/.github/header-checker-lint.yml index 53c9c5c..5a21e5f 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 c2ce28d..ad774a6 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 @@ -498,9 +502,9 @@ typing-extensions==4.10.0 \ --hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \ --hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb # via -r requirements.in -urllib3==2.2.1 \ - --hash=sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d \ - --hash=sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19 +urllib3==2.2.2 \ + --hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \ + --hash=sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168 # via # requests # twine diff --git a/CHANGELOG.md b/CHANGELOG.md index 93271b7..51132e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.2.2](https://github.com/googleapis/langchain-google-bigtable-python/compare/v0.2.1...v0.2.2) (2024-06-25) + + +### Bug Fixes + +* Increase delay in test ([#60](https://github.com/googleapis/langchain-google-bigtable-python/issues/60)) ([f3ac73a](https://github.com/googleapis/langchain-google-bigtable-python/commit/f3ac73a1e55b7387997334129a2a8e8661e7cc9a)) + ## [0.2.1](https://github.com/googleapis/langchain-google-bigtable-python/compare/v0.2.0...v0.2.1) (2024-05-01) diff --git a/DEVELOPER.md b/DEVELOPER.md index 5348073..11189b1 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -55,7 +55,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 @@ -74,5 +74,17 @@ 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. + [triggers]: https://console.cloud.google.com/cloud-build/triggers?e=13802955&project=langchain-cloud-sql-testing \ No newline at end of file diff --git a/integration.cloudbuild.yaml b/integration.cloudbuild.yaml index e25bc62..d0549c5 100644 --- a/integration.cloudbuild.yaml +++ b/integration.cloudbuild.yaml @@ -25,8 +25,8 @@ steps: - id: Run integration tests name: python:${_VERSION} + args: ["-m", "pytest", "--cov=langchain_google_bigtable", "--cov-config=.coveragerc", "tests/"] entrypoint: python - args: ["-m", "pytest"] env: - "PROJECT_ID=$PROJECT_ID" - "INSTANCE_ID=test-instance" diff --git a/pyproject.toml b/pyproject.toml index 38705aa..566d76f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,9 +38,10 @@ Changelog = "https://github.com/googleapis/langchain-google-bigtable-python/blob%20test%20=%20["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 387003c..b3f5626 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -langchain-core==0.1.35 -langchain-community==0.0.28 -google-cloud-bigtable==2.23.0 +langchain-core==0.2.7 +langchain-community==0.2.5 +google-cloud-bigtable==2.23.1 diff --git a/src/langchain_google_bigtable/version.py b/src/langchain_google_bigtable/version.py index fffa9d9..6265626 100644 --- a/src/langchain_google_bigtable/version.py +++ b/src/langchain_google_bigtable/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.2.1" +__version__ = "0.2.2" diff --git a/tests/test_bigtable_loader.py b/tests/test_bigtable_loader.py index 2c6fddf..db8df5d 100644 --- a/tests/test_bigtable_loader.py +++ b/tests/test_bigtable_loader.py @@ -100,7 +100,7 @@ def test_bigtable_loads_of_messages( saver.add_documents(written_docs) # wait for eventual consistency - time.sleep(10) + time.sleep(20) returned_docs = loader.load() @@ -113,7 +113,7 @@ def test_bigtable_loads_of_messages( saver.delete(returned_docs[:-1]) # wait for eventual consistency - time.sleep(10) + time.sleep(20) returned_docs = loader.load() assert len(returned_docs) == 1