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..ba2b030 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,4 @@ +assign_issues: + - googleapis/langchain-datastore +assign_prs: + - googleapis/langchain-datastore 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/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index d96368b..a9e4000 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -27,7 +27,6 @@ branchProtectionRules: requiredStatusCheckContexts: - "cla/google" - "lint" - - "integration-test-pr-py38 (langchain-datastore-testing)" - "integration-test-pr-py39 (langchain-datastore-testing)" - "integration-test-pr-py310 (langchain-datastore-testing)" - "integration-test-pr-py311 (langchain-datastore-testing)" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ada322c..d21ada6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 with: python-version: "3.9" - name: Install nox @@ -24,9 +24,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 with: python-version: "3.10" - name: Install nox diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2352d4b..e6b7a95 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,12 +19,6 @@ on: - "*.md" - ".kokoro/**" - ".github/**" - pull_request_target: - types: [labeled] - paths-ignore: - - "*.md" - - ".kokoro/**" - - ".github/**" jobs: lint: @@ -34,36 +28,17 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - # run job on proper workflow event triggers (skip job for pull_request event from forks and only run pull_request_target for "tests: run" label) - if: "${{ (github.event.action != 'labeled' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) || github.event.label.name == 'tests: run' }}" steps: - - name: Remove PR label - if: "${{ github.event.action == 'labeled' && github.event.label.name == 'tests: run' }}" - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - try { - await github.rest.issues.removeLabel({ - name: 'tests: run', - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number - }); - } catch (e) { - console.log('Failed to remove label. Another job may have already removed it!'); - } - - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: ref: ${{ github.event.pull_request.head.sha }} repository: ${{ github.event.pull_request.head.repo.full_name }} token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Python - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 with: python-version: "3.11" diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 272708a..79d0dee 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -23,7 +23,7 @@ python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source / export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-3") cd github/langchain-google-datastore-python python3 -m build --wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 0f36338..69d1dc3 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -28,7 +28,7 @@ before_action { fetch_keystore { keystore_resource { keystore_config_id: 73713 - keyname: "google-cloud-pypi-token-keystore-1" + keyname: "google-cloud-pypi-token-keystore-3" } } } diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index c2ce28d..6602ee1 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -20,9 +20,9 @@ cachetools==5.3.3 \ --hash=sha256:0abad1021d3f8325b2fc1d2e9c8b9c9d57b04c3932657a72465447332c24d945 \ --hash=sha256:ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105 # via google-auth -certifi==2023.11.17 \ - --hash=sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1 \ - --hash=sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474 +certifi==2024.7.4 \ + --hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \ + --hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90 # via requests cffi==1.16.0 \ --hash=sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc \ @@ -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 @@ -512,9 +516,9 @@ wheel==0.43.0 \ --hash=sha256:465ef92c69fa5c5da2d1cf8ac40559a8c940886afcef87dcf14b9470862f1d85 \ --hash=sha256:55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81 # via -r requirements.in -zipp==3.18.1 \ - --hash=sha256:206f5a15f2af3dbaee80769fb7dc6f249695e940acca08dfb2a4769fe61e538b \ - --hash=sha256:2884ed22e7d8961de1c9a05142eb69a247f120291bc0206a00a7642f09b5b715 +zipp==3.19.1 \ + --hash=sha256:2828e64edb5386ea6a52e7ba7cdb17bb30a73a858f5eb6eb93d8d36f5ea26091 \ + --hash=sha256:35427f6d5594f4acf82d25541438348c26736fa9b3afa2754bcd63cdb99d8e8f # via importlib-metadata # WARNING: The following packages were not pinned, but pip requires them to be diff --git a/CHANGELOG.md b/CHANGELOG.md index e721588..0c4df1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.3.0](https://github.com/googleapis/langchain-google-datastore-python/compare/v0.2.0...v0.3.0) (2024-10-28) + + +### Features + +* Remove support for Python 3.8 ([#76](https://github.com/googleapis/langchain-google-datastore-python/issues/76)) ([d1213ac](https://github.com/googleapis/langchain-google-datastore-python/commit/d1213ac751c2c8ef832a783deb808bf822b494a6)) + + +### Documentation + +* Fix font size in README.rst ([#69](https://github.com/googleapis/langchain-google-datastore-python/issues/69)) ([59fdf4e](https://github.com/googleapis/langchain-google-datastore-python/commit/59fdf4e4e3fb9a238d73aeac41bae3523b45587b)) + ## [0.2.0](https://github.com/googleapis/langchain-google-datastore-python/compare/v0.1.2...v0.2.0) (2024-05-01) diff --git a/DEVELOPER.md b/DEVELOPER.md index 1661e75..ea886ce 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -32,11 +32,11 @@ These tests are registered as required tests in `.github/sync-repo-settings.yaml #### Trigger Setup -Cloud Build triggers (for Python versions 3.8 to 3.11) were created with the following specs: +Cloud Build triggers (for Python versions 3.9 to 3.11) were created with the following specs: ```YAML -name: integration-test-pr-py38 -description: Run integration tests on PR for Python 3.8 +name: integration-test-pr-py39 +description: Run integration tests on PR for Python 3.9 filename: integration.cloudbuild.yaml github: name: langchain-google-datastore-python @@ -50,10 +50,10 @@ ignoredFiles: - .github/** - "*.md" substitutions: - _VERSION: "3.8" + _VERSION: "3.9" ``` -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 @@ -72,5 +72,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`. -[triggers]: https://console.cloud.google.com/cloud-build/triggers?e=13802955&project=langchain-datastore-testing \ No newline at end of file +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-datastore-testing diff --git a/README.rst b/README.rst index afa5c3e..a81e207 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,7 @@ With `virtualenv`_, it’s possible to install this library without needing syst Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.8 +Python >= 3.9 Mac/Linux ^^^^^^^^^ @@ -85,7 +85,7 @@ See the full `Document Loader`_ tutorial. .. _`Document Loader`: https://github.com/googleapis/langchain-google-datastore-python/blob/main/docs/document_loader.ipynb Chat Message History Usage --------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~ Use ``ChatMessageHistory`` to store messages and provide conversation history to LLMs. diff --git a/integration.cloudbuild.yaml b/integration.cloudbuild.yaml index 33ece04..04f0704 100644 --- a/integration.cloudbuild.yaml +++ b/integration.cloudbuild.yaml @@ -26,10 +26,10 @@ steps: - id: Run integration tests name: python:${_VERSION} entrypoint: python - args: ["-m", "pytest"] + args: ["-m", "pytest", "--cov=langchain_google_datastore", "--cov-config=.coveragerc", "tests/"] substitutions: - _VERSION: "3.8" + _VERSION: "3.9" options: dynamicSubstitutions: true diff --git a/pyproject.toml b/pyproject.toml index 0e25a3e..1212be2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] description = "LangChain integrations for Google Cloud Datastore" readme = "README.rst" license = {file = "LICENSE"} -requires-python = ">=3.8" +requires-python = ">=3.9" authors = [ {name = "Google LLC", email = "googleapis-packages@google.com"} ] @@ -19,7 +19,6 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -38,17 +37,21 @@ Changelog = "https://github.com/googleapis/langchain-google-datastore-python/blo [project.optional-dependencies] test = [ - "black[jupyter]==23.12.1", + "black[jupyter]==24.4.2", "isort==5.13.2", - "mypy==1.10.0", - "pytest-asyncio==0.23.6", - "pytest==7.4.4" + "mypy==1.10.1", + "pytest-asyncio==0.23.7", + "pytest==8.2.2", + "pytest-cov==5.0.0" ] [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" +[tool.black] +target-version = ['py39'] + [tool.isort] profile = "black" @@ -59,4 +62,4 @@ warn_unused_configs = true exclude = [ 'docs/*', 'noxfile.py' -] \ No newline at end of file +] diff --git a/requirements.txt b/requirements.txt index 607b3e4..220cf6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -langchain-core==0.1.45 -langchain-community==0.0.34 +langchain-core==0.3.0 +langchain-community==0.3.0 google-cloud-datastore==2.19.0 -more_itertools==10.2.0 +more_itertools==10.3.0 diff --git a/src/langchain_google_datastore/version.py b/src/langchain_google_datastore/version.py index 20c5861..2b5d97a 100644 --- a/src/langchain_google_datastore/version.py +++ b/src/langchain_google_datastore/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "0.2.0" +__version__ = "0.3.0"