Skip to content

Commit

Permalink
Bagatur/fix doc ci (langchain-ai#12529)
Browse files Browse the repository at this point in the history
  • Loading branch information
baskaryan authored Oct 29, 2023
1 parent 2424fff commit 0b4b9e6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/doc_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- 'docs/**'
- 'templates/**'
- 'cookbook/**'
- '.github/workflows/_lint.yml'
- '.github/workflows/doc_lint.yml'
workflow_dispatch:

jobs:
Expand All @@ -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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/guides/safety/amazon_comprehend_chain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "a25e6f93-765b-4f99-8c1c-929157dbd4aa",
"id": "082c6cfc",
"metadata": {
"tags": []
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1414,7 +1414,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.9.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b4b9e6

Please sign in to comment.