From 0b4b9e61fc51531d6ffb95a0351c7848000184e9 Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Sun, 29 Oct 2023 16:15:18 -0700 Subject: [PATCH] Bagatur/fix doc ci (#12529) --- .github/workflows/doc_lint.yml | 11 ++++++----- Makefile | 8 ++++---- docs/docs/guides/safety/amazon_comprehend_chain.ipynb | 8 ++++---- poetry.lock | 2 +- pyproject.toml | 8 ++++++++ 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/doc_lint.yml b/.github/workflows/doc_lint.yml index b484b602f69da..93ccf734d0af6 100644 --- a/.github/workflows/doc_lint.yml +++ b/.github/workflows/doc_lint.yml @@ -9,6 +9,8 @@ on: - 'docs/**' - 'templates/**' - 'cookbook/**' + - '.github/workflows/_lint.yml' + - '.github/workflows/doc_lint.yml' workflow_dispatch: jobs: @@ -23,12 +25,11 @@ jobs: run: | # We should not encourage imports directly from main init file # Expect for hub - git grep 'from langchain import' {docs,templates,cookbook} | grep -vE 'from langchain import (hub)' && exit 1 || exit 0 + git grep 'from langchain import' {docs/docs,templates,cookbook} | grep -vE 'from langchain import (hub)' && exit 1 || exit 0 - - name: Run lint + lint: uses: ./.github/workflows/_lint.yml with: - working-directory: . - secrets: inherit - + working-directory: "." + secrets: inherit \ No newline at end of file diff --git a/Makefile b/Makefile index d540e3a0cd271..961819bea74f3 100644 --- a/Makefile +++ b/Makefile @@ -42,12 +42,12 @@ spell_fix: ###################### lint: - poetry run ruff {docs,templates,cookbook} - poetry run black {docs,templates,cookbook} --check + poetry run ruff docs templates cookbook + poetry run black docs templates cookbook --check format format_diff: - poetry run black {docs,templates,cookbook} - poetry run ruff --select I --fix {docs,templates,cookbook} + poetry run black docs templates cookbook + poetry run ruff --select I --fix docs templates cookbook ###################### # HELP diff --git a/docs/docs/guides/safety/amazon_comprehend_chain.ipynb b/docs/docs/guides/safety/amazon_comprehend_chain.ipynb index ddbabd1087e1b..8843b370b4165 100644 --- a/docs/docs/guides/safety/amazon_comprehend_chain.ipynb +++ b/docs/docs/guides/safety/amazon_comprehend_chain.ipynb @@ -232,7 +232,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a25e6f93-765b-4f99-8c1c-929157dbd4aa", + "id": "082c6cfc", "metadata": { "tags": [] }, @@ -562,7 +562,7 @@ }, "outputs": [], "source": [ - "from langchain import HuggingFaceHub\n", + "from langchain.llms import HuggingFaceHub\n", "from langchain.prompts import PromptTemplate\n", "\n", "template = \"\"\"{question}\"\"\"\n", @@ -690,7 +690,7 @@ "metadata": {}, "outputs": [], "source": [ - "from langchain import SagemakerEndpoint\n", + "from langchain.llms import SagemakerEndpoint\n", "from langchain.llms.sagemaker_endpoint import LLMContentHandler\n", "from langchain.prompts import PromptTemplate\n", "import json\n", @@ -1414,7 +1414,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.9.1" } }, "nbformat": 4, diff --git a/poetry.lock b/poetry.lock index d61a37d6e24c4..35b6eee659db5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3915,4 +3915,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0" -content-hash = "00e7c3ba52c8c852a7470838a48244da94f3b2074f5a122f6cb9f78953489e82" +content-hash = "47b6bed43d64a2d4690d4554c78481485822b4b226a6e7f8a456dddb4ce8dd20" diff --git a/pyproject.toml b/pyproject.toml index 1794c515c29c8..ce052f0042ee0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,14 @@ black = "^23.10.0" codespell = "^2.2.0" +[tool.poetry.group.dev.dependencies] + + +[tool.poetry.group.test.dependencies] + + +[tool.poetry.group.typing.dependencies] + [tool.codespell] skip = '.git,*.pdf,*.svg,*.pdf,*.yaml,*.ipynb,poetry.lock,*.min.js,*.css,package-lock.json,example_data,_dist,examples,templates' # Ignore latin etc