This commit is contained in:
Erick Friis 2024-11-21 18:41:56 -08:00
parent 9ac46cc264
commit 1798d6e92e
4 changed files with 45 additions and 16 deletions

View File

@ -1,5 +1,5 @@
---
pagination_next: docs/contributing/how_to/integrations/package
pagination_next: contributing/how_to/integrations/package
---
# Contribute Integrations

View File

@ -1,6 +1,6 @@
---
pagination_next: docs/contributing/how_to/integrations/standard_tests
pagination_prev: docs/contributing/how_to/integrations
pagination_next: contributing/how_to/integrations/standard_tests
pagination_prev: contributing/how_to/integrations/index
---
# How to bootstrap a new integration package

View File

@ -1,4 +1,6 @@
---
pagination_prev: contributing/how_to/integrations/standard_tests
pagination_next: null
---
# Publishing your package

View File

@ -5,8 +5,8 @@
"metadata": {},
"source": [
"---\n",
"pagination_next: null\n",
"pagination_prev: docs/contributing/how_to/integrations/standard_tests\n",
"pagination_next: contributing/how_to/integrations/publish\n",
"pagination_prev: contributing/how_to/integrations/package\n",
"---\n",
"# How to add standard tests to an integration\n",
"\n",
@ -24,16 +24,26 @@
"Because added tests in new versions of `langchain-tests` can break your CI/CD pipelines, we recommend pinning the \n",
"version of `langchain-tests` to avoid unexpected changes.\n",
"\n",
":::"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -U langchain-core langchain-tests pytest pytest-socket"
":::\n",
"\n",
"<Tabs>\n",
" <TabItem value=\"poetry\" label=\"Poetry\" default>\n",
"If you followed the [previous guide](../package), you should already have these dependencies installed!\n",
"\n",
"```bash\n",
"poetry add langchain-core\n",
"poetry add --group test pytest pytest-socket langchain-tests==<latest_version>\n",
"```\n",
" </TabItem>\n",
" <TabItem value=\"pip\" label=\"Pip\">\n",
"```bash\n",
"pip install -U langchain-core pytest pytest-socket langchain-tests\n",
"\n",
"# install current package in editable mode\n",
"pip install --editable .\n",
"```\n",
" </TabItem>\n",
"</Tabs>"
]
},
{
@ -180,13 +190,30 @@
"source": [
"and you would run these with the following commands from your project root\n",
"\n",
"<Tabs>\n",
" <TabItem value=\"poetry\" label=\"Poetry\" default>\n",
"\n",
"```bash\n",
"# run unit tests without network access\n",
"poetry run pytest --disable-socket --allow-unix-socket tests/unit_tests\n",
"\n",
"# run integration tests\n",
"poetry run pytest tests/integration_tests\n",
"```\n",
"\n",
" </TabItem>\n",
" <TabItem value=\"pip\" label=\"Pip\">\n",
"\n",
"```bash\n",
"# run unit tests without network access\n",
"pytest --disable-socket --allow-unix-socket tests/unit_tests\n",
"\n",
"# run integration tests\n",
"pytest tests/integration_tests\n",
"```"
"```\n",
"\n",
" </TabItem>\n",
"</Tabs>"
]
},
{