Skip to content

Commit

Permalink
experimental: migrate to external repo (langchain-ai#26879)
Browse files Browse the repository at this point in the history
security scanners can't distinguish monorepo sources from each other.
this will resolve issues for folks trying to use e.g. langchain-core but
getting security issues from experimental flagged!
  • Loading branch information
efriis authored Sep 26, 2024
1 parent c750600 commit 2ea5f60
Show file tree
Hide file tree
Showing 223 changed files with 570 additions and 25,802 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Thank you for contributing to LangChain!

- [ ] **PR title**: "package: description"
- Where "package" is whichever of langchain, community, core, experimental, etc. is being modified. Use "docs: ..." for purely docs changes, "templates: ..." for template changes, "infra: ..." for CI changes.
- Where "package" is whichever of langchain, community, core, etc. is being modified. Use "docs: ..." for purely docs changes, "templates: ..." for template changes, "infra: ..." for CI changes.
- Example: "community: add foobar LLM"


Expand Down
20 changes: 12 additions & 8 deletions .github/scripts/check_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"libs/text-splitters",
"libs/langchain",
"libs/community",
"libs/experimental",
]

# when set to True, we are ignoring core dependents
Expand Down Expand Up @@ -153,14 +152,19 @@ def _get_pydantic_test_configs(
core_min_pydantic_version = get_min_version_from_toml(
"./libs/core/pyproject.toml", "release", python_version, include=["pydantic"]
)["pydantic"]
core_min_pydantic_minor = core_min_pydantic_version.split(".")[1] if "." in core_min_pydantic_version else "0"
dir_min_pydantic_version = (
get_min_version_from_toml(
f"./{dir_}/pyproject.toml", "release", python_version, include=["pydantic"]
)
.get("pydantic", "0.0.0")
core_min_pydantic_minor = (
core_min_pydantic_version.split(".")[1]
if "." in core_min_pydantic_version
else "0"
)
dir_min_pydantic_version = get_min_version_from_toml(
f"./{dir_}/pyproject.toml", "release", python_version, include=["pydantic"]
).get("pydantic", "0.0.0")
dir_min_pydantic_minor = (
dir_min_pydantic_version.split(".")[1]
if "." in dir_min_pydantic_version
else "0"
)
dir_min_pydantic_minor = dir_min_pydantic_version.split(".")[1] if "." in dir_min_pydantic_version else "0"

custom_mins = {
# depends on pydantic-settings 2.4 which requires pydantic 2.7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_test_doc_imports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Install langchain editable
run: |
poetry run pip install -e libs/core libs/langchain libs/community libs/experimental
poetry run pip install -e libs/core libs/langchain libs/community
- name: Check doc imports
shell: bash
Expand Down
1 change: 0 additions & 1 deletion docs/api_reference/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
_DIR = Path(__file__).parent.absolute()
sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath("../../libs/langchain"))
sys.path.insert(0, os.path.abspath("../../libs/experimental"))

with (_DIR.parents[1] / "libs" / "langchain" / "pyproject.toml").open("r") as f:
data = toml.load(f)
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/contributing/code/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ make docker_tests

There are also [integration tests and code-coverage](/docs/contributing/testing/) available.

### Only develop langchain_core or langchain_experimental
### Only develop langchain_core or langchain_community

If you are only developing `langchain_core` or `langchain_experimental`, you can simply install the dependencies for the respective projects and run tests:
If you are only developing `langchain_core` or `langchain_community`, you can simply install the dependencies for the respective projects and run tests:

```bash
cd libs/core
Expand All @@ -86,7 +86,7 @@ make test
Or:

```bash
cd libs/experimental
cd libs/community
poetry install --with test
make test
```
Expand Down
1 change: 0 additions & 1 deletion docs/vercel_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-e ../libs/core
-e ../libs/langchain
-e ../libs/community
-e ../libs/experimental
-e ../libs/text-splitters
langchain-cohere
urllib3==1.26.19
Expand Down
21 changes: 0 additions & 21 deletions libs/experimental/LICENSE

This file was deleted.

67 changes: 0 additions & 67 deletions libs/experimental/Makefile

This file was deleted.

17 changes: 2 additions & 15 deletions libs/experimental/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# 🦜️🧪 LangChain Experimental
This package has moved!

This package holds experimental LangChain code, intended for research and experimental
uses.

> [!WARNING]
> Portions of the code in this package may be dangerous if not properly deployed
> in a sandboxed environment. Please be wary of deploying experimental code
> to production unless you've taken appropriate precautions and
> have already discussed it with your security team.
Some of the code here may be marked with security notices. However,
given the exploratory and experimental nature of the code in this package,
the lack of a security notice on a piece of code does not mean that
the code in question does not require additional security considerations
in order to be safe to use.
https://github.com/langchain-ai/langchain-experimental/tree/main/libs/experimental
8 changes: 0 additions & 8 deletions libs/experimental/extended_testing_deps.txt

This file was deleted.

8 changes: 0 additions & 8 deletions libs/experimental/langchain_experimental/__init__.py

This file was deleted.

23 changes: 0 additions & 23 deletions libs/experimental/langchain_experimental/agents/__init__.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 2ea5f60

Please sign in to comment.