From 1798d6e92e63576deb2c2e6476ecf106295f659f Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Thu, 21 Nov 2024 18:41:56 -0800 Subject: [PATCH] x --- .../how_to/integrations/index.mdx | 2 +- .../how_to/integrations/package.mdx | 4 +- .../how_to/integrations/publish.mdx | 2 + .../how_to/integrations/standard_tests.ipynb | 53 ++++++++++++++----- 4 files changed, 45 insertions(+), 16 deletions(-) diff --git a/docs/docs/contributing/how_to/integrations/index.mdx b/docs/docs/contributing/how_to/integrations/index.mdx index 2b2730860ec..53e81de384c 100644 --- a/docs/docs/contributing/how_to/integrations/index.mdx +++ b/docs/docs/contributing/how_to/integrations/index.mdx @@ -1,5 +1,5 @@ --- -pagination_next: docs/contributing/how_to/integrations/package +pagination_next: contributing/how_to/integrations/package --- # Contribute Integrations diff --git a/docs/docs/contributing/how_to/integrations/package.mdx b/docs/docs/contributing/how_to/integrations/package.mdx index d9dc1211029..df8e5b9babe 100644 --- a/docs/docs/contributing/how_to/integrations/package.mdx +++ b/docs/docs/contributing/how_to/integrations/package.mdx @@ -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 diff --git a/docs/docs/contributing/how_to/integrations/publish.mdx b/docs/docs/contributing/how_to/integrations/publish.mdx index 72812f9c151..120b7bd08ea 100644 --- a/docs/docs/contributing/how_to/integrations/publish.mdx +++ b/docs/docs/contributing/how_to/integrations/publish.mdx @@ -1,4 +1,6 @@ --- +pagination_prev: contributing/how_to/integrations/standard_tests +pagination_next: null --- # Publishing your package diff --git a/docs/docs/contributing/how_to/integrations/standard_tests.ipynb b/docs/docs/contributing/how_to/integrations/standard_tests.ipynb index 56c0a7952ae..7713637d6c3 100644 --- a/docs/docs/contributing/how_to/integrations/standard_tests.ipynb +++ b/docs/docs/contributing/how_to/integrations/standard_tests.ipynb @@ -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", + "\n", + " \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==\n", + "```\n", + " \n", + " \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", + " \n", + "" ] }, { @@ -180,13 +190,30 @@ "source": [ "and you would run these with the following commands from your project root\n", "\n", + "\n", + " \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", + " \n", + " \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", + " \n", + "" ] }, {