community, langchain, infra: revert store extended test deps outside of poetry (#19153)

Reverts langchain-ai/langchain#18995

Because it makes installing dependencies in python 3.11 extended testing
take 80 minutes
This commit is contained in:
Erick Friis
2024-03-15 10:10:47 -07:00
committed by GitHub
parent e3ff107e4f
commit 781aee0068
21 changed files with 11079 additions and 698 deletions

View File

@@ -206,7 +206,9 @@ ignore-words-list = 'momento,collison,ned,foor,reworkd,parth,whats,aapply,mysogy
`langchain-core` and partner packages **do not use** optional dependencies in this way.
You'll notice that `pyproject.toml` and `poetry.lock` are **not** touched when you add optional dependencies below.
You only need to add a new dependency if a **unit test** relies on the package.
If your package is only required for **integration tests**, then you can skip these
steps and leave all pyproject.toml and poetry.lock files alone.
If you're adding a new dependency to Langchain, assume that it will be an optional dependency, and
that most users won't have it installed.
@@ -214,12 +216,20 @@ that most users won't have it installed.
Users who do not have the dependency installed should be able to **import** your code without
any side effects (no warnings, no errors, no exceptions).
To introduce the dependency to a library, please do the following:
To introduce the dependency to the pyproject.toml file correctly, please do the following:
1. Open extended_requirements.txt and add the dependency
2. Add a unit test that the very least attempts to import the new code. Ideally, the unit
1. Add the dependency to the main group as an optional dependency
```bash
poetry add --optional [package_name]
```
2. Open pyproject.toml and add the dependency to the `extended_testing` extra
3. Relock the poetry file to update the extra.
```bash
poetry lock --no-update
```
4. Add a unit test that the very least attempts to import the new code. Ideally, the unit
test makes use of lightweight fixtures to test the logic of the code.
3. Please use the `@pytest.mark.requires(package_name)` decorator for any unit tests that require the dependency.
5. Please use the `@pytest.mark.requires(package_name)` decorator for any tests that require the dependency.
## Adding a Jupyter Notebook