From a03003f5fddadc7b0eda4825c3e27b43c74afe38 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> Date: Mon, 21 Aug 2023 10:35:56 -0400 Subject: [PATCH] Upgrade CI poetry version to 1.5.1. (#9479) Poetry v1.5.1 was released on May 29, almost 3 months ago. Probably a safe upgrade. --- .github/CONTRIBUTING.md | 17 ++++++++--------- .github/workflows/_lint.yml | 4 ++-- .github/workflows/_release.yml | 4 ++-- .github/workflows/_test.yml | 4 ++-- .github/workflows/scheduled_test.yml | 4 ++-- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e4deedda773..a3e2e5912b8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -33,7 +33,7 @@ best way to get our attention. ### 🚩GitHub Issues Our [issues](https://github.com/hwchase17/langchain/issues) page is kept up to date -with bugs, improvements, and feature requests. +with bugs, improvements, and feature requests. There is a taxonomy of labels to help with sorting and discovery of issues of interest. Please use these to help organize issues. @@ -61,11 +61,11 @@ we do not want these to get in the way of getting good code into the codebase. > **Note:** You can run this repository locally (which is described below) or in a [development container](https://containers.dev/) (which is described in the [.devcontainer folder](https://github.com/hwchase17/langchain/tree/master/.devcontainer)). -This project uses [Poetry](https://python-poetry.org/) as a dependency manager. Check out Poetry's [documentation on how to install it](https://python-poetry.org/docs/#installation) on your system before proceeding. +This project uses [Poetry](https://python-poetry.org/) v1.5.1 as a dependency manager. Check out Poetry's [documentation on how to install it](https://python-poetry.org/docs/#installation) on your system before proceeding. ❗Note: If you use `Conda` or `Pyenv` as your environment / package manager, avoid dependency conflicts by doing the following first: 1. *Before installing Poetry*, create and activate a new Conda env (e.g. `conda create -n langchain python=3.9`) -2. Install Poetry (see above) +2. Install Poetry v1.5.1 (see above) 3. Tell Poetry to use the virtualenv python environment (`poetry config virtualenvs.prefer-active-python true`) 4. Continue with the following steps. @@ -73,7 +73,7 @@ There are two separate projects in this repository: - `langchain`: core langchain code, abstractions, and use cases - `langchain.experimental`: more experimental code -Each of these has their OWN development environment. +Each of these has their OWN development environment. In order to run any of the commands below, please move into their respective directories. For example, to contribute to `langchain` run `cd libs/langchain` before getting started with the below. @@ -85,7 +85,7 @@ poetry install -E all This will install all requirements for running the package, examples, linting, formatting, tests, and coverage. Note the `-E all` flag will install all optional dependencies necessary for integration testing. -❗Note: If you're running Poetry 1.4.1 and receive a `WheelFileValidationError` for `debugpy` during installation, you can try either downgrading to Poetry 1.4.0 or disabling "modern installation" (`poetry config installer.modern-installation false`) and re-install requirements. See [this `debugpy` issue](https://github.com/microsoft/debugpy/issues/1246) for more details. +❗Note: If during installation you receive a `WheelFileValidationError` for `debugpy`, please make sure you are running Poetry v1.5.1. This bug was present in older versions of Poetry (e.g. 1.4.1) and has been resolved in newer releases. If you are still seeing this bug on v1.5.1, you may also try disabling "modern installation" (`poetry config installer.modern-installation false`) and re-installing requirements. See [this `debugpy` issue](https://github.com/microsoft/debugpy/issues/1246) for more details. Now, you should be able to run the common tasks in the following section. To double check, run `make test`, all tests should pass. If they don't you may need to pip install additional dependencies, such as `numexpr` and `openapi_schema_pydantic`. @@ -175,9 +175,9 @@ If you're adding a new dependency to Langchain, assume that it will be an option that most users won't have it installed. Users that do not have the dependency installed should be able to **import** your code without -any side effects (no warnings, no errors, no exceptions). +any side effects (no warnings, no errors, no exceptions). -To introduce the dependency to the pyproject.toml file correctly, please do the following: +To introduce the dependency to the pyproject.toml file correctly, please do the following: 1. Add the dependency to the main group as an optional dependency ```bash @@ -220,7 +220,7 @@ If you add new logic, please add a unit test. Integration tests cover logic that requires making calls to outside APIs (often integration with other services). -**warning** Almost no tests should be integration tests. +**warning** Almost no tests should be integration tests. Tests that require making network connections make it difficult for other developers to test the code. @@ -307,4 +307,3 @@ even patch releases may contain [non-backwards-compatible changes](https://semve If your contribution has made its way into a release, we will want to give you credit on Twitter (only if you want though)! If you have a Twitter account you would like us to mention, please let us know in the PR or in another manner. - diff --git a/.github/workflows/_lint.yml b/.github/workflows/_lint.yml index c5038e64341..aab4effa077 100644 --- a/.github/workflows/_lint.yml +++ b/.github/workflows/_lint.yml @@ -9,7 +9,7 @@ on: description: "From which folder this pipeline executes" env: - POETRY_VERSION: "1.4.2" + POETRY_VERSION: "1.5.1" WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }} jobs: @@ -91,7 +91,7 @@ jobs: key: pip-editable-langchain-deps-${{ runner.os }}-${{ runner.arch }}-py-${{ matrix.python-version }} - name: Install poetry run: | - pipx install poetry==$POETRY_VERSION + pipx install "poetry==$POETRY_VERSION" - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 env: diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index b8f5679739c..6d8094d0679 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -9,7 +9,7 @@ on: description: "From which folder this pipeline executes" env: - POETRY_VERSION: "1.4.2" + POETRY_VERSION: "1.5.1" jobs: if_release: @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Install poetry - run: pipx install poetry==$POETRY_VERSION + run: pipx install "poetry==$POETRY_VERSION" - name: Set up Python 3.10 uses: actions/setup-python@v4 with: diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index ebb07917377..3cc424cb7a1 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -13,7 +13,7 @@ on: default: '["core", "extended", "core-pydantic-2"]' env: - POETRY_VERSION: "1.4.2" + POETRY_VERSION: "1.5.1" jobs: build: @@ -37,7 +37,7 @@ jobs: with: python-version: ${{ matrix.python-version }} working-directory: ${{ inputs.working-directory }} - poetry-version: "1.4.2" + poetry-version: ${{ env.POETRY_VERSION }} cache-key: ${{ matrix.test_type }} install-command: | if [ "${{ matrix.test_type }}" == "core" ]; then diff --git a/.github/workflows/scheduled_test.yml b/.github/workflows/scheduled_test.yml index 29ca8c119d5..39b553d5c28 100644 --- a/.github/workflows/scheduled_test.yml +++ b/.github/workflows/scheduled_test.yml @@ -6,7 +6,7 @@ on: - cron: '0 13 * * *' env: - POETRY_VERSION: "1.4.2" + POETRY_VERSION: "1.5.1" jobs: build: @@ -29,7 +29,7 @@ jobs: uses: "./.github/actions/poetry_setup" with: python-version: ${{ matrix.python-version }} - poetry-version: "1.4.2" + poetry-version: ${{ env.POETRY_VERSION }} working-directory: libs/langchain install-command: | echo "Running scheduled tests, installing dependencies with poetry..."