From 0436e48831dff17b1d11ab6e696e58182e8c4f30 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sun, 17 Sep 2023 13:39:11 +0100 Subject: [PATCH] Remove circular dependency on export plugin --- .github/workflows/.tests-matrix.yaml | 40 +++++++++++++++++++--------- .pre-commit-hooks.yaml | 9 ------- poetry.lock | 19 ++----------- pyproject.toml | 1 - 4 files changed, 30 insertions(+), 39 deletions(-) diff --git a/.github/workflows/.tests-matrix.yaml b/.github/workflows/.tests-matrix.yaml index 775466186a4..3265e45594f 100644 --- a/.github/workflows/.tests-matrix.yaml +++ b/.github/workflows/.tests-matrix.yaml @@ -75,25 +75,41 @@ jobs: if: inputs.run-pytest-export steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - - - uses: ./.github/actions/bootstrap-poetry with: - python-version: ${{ inputs.python-version }} + path: poetry - - uses: ./.github/actions/poetry-install + - uses: ./poetry/.github/actions/bootstrap-poetry with: - args: --with github-actions + python-version: ${{ inputs.python-version }} - - run: poetry run pip list --format json | jq -r '.[] | "\(.name)=\(.version)"' >> $GITHUB_OUTPUT - id: package-versions + - name: Get poetry-plugin-export version + run: | + PLUGIN_VERSION=$(curl -s https://pypi.org/pypi/poetry-plugin-export/json | jq -r ".info.version") + echo "Found version ${PLUGIN_VERSION}" + echo version=${PLUGIN_VERSION} >> $GITHUB_OUTPUT + id: poetry-plugin-export-version - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - name: Check out poetry-plugin-export + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: path: poetry-plugin-export repository: python-poetry/poetry-plugin-export - ref: refs/tags/${{ steps.package-versions.outputs.poetry-plugin-export }} + ref: refs/tags/${{ steps.poetry-plugin-export-version.outputs.version }} + + - name: Use local poetry + working-directory: poetry-plugin-export + run: poetry add --lock --group dev ../poetry + + - name: Install + working-directory: poetry-plugin-export + run: poetry install - - run: poetry run -C .. pytest -v - working-directory: ./poetry-plugin-export + - name: Run tests + working-directory: poetry-plugin-export + run: poetry run python -m pytest -p no:sugar -q tests - - run: git -C poetry-plugin-export diff --exit-code --stat HEAD + - name: Check for clean working tree + working-directory: poetry-plugin-export + run: | + git checkout -- pyproject.toml poetry.lock + git diff --exit-code --stat HEAD diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 8f4e23448a4..7d949abcfbb 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -14,15 +14,6 @@ pass_filenames: false files: ^(.*/)?(poetry\.lock|pyproject\.toml)$ -- id: poetry-export - name: poetry-export - description: run poetry export to sync lock file with requirements.txt - entry: poetry export - language: python - pass_filenames: false - files: ^(.*/)?poetry\.lock$ - args: ["-f", "requirements.txt", "-o", "requirements.txt"] - - id: poetry-install name: poetry-install description: run poetry install to install dependencies from the lock file diff --git a/poetry.lock b/poetry.lock index 86ff01bd0aa..409ae21b72d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.9.0.dev0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "build" @@ -955,21 +955,6 @@ files = [ {file = "poetry_core-1.9.0.tar.gz", hash = "sha256:fa7a4001eae8aa572ee84f35feb510b321bd652e5cf9293249d62853e1f935a2"}, ] -[[package]] -name = "poetry-plugin-export" -version = "1.7.0" -description = "Poetry plugin to export the dependencies to various formats" -optional = false -python-versions = ">=3.8,<4.0" -files = [ - {file = "poetry_plugin_export-1.7.0-py3-none-any.whl", hash = "sha256:2283b28e0209f9f9598c6fe44f30586ec91329ea1558f908708261e0516bf427"}, - {file = "poetry_plugin_export-1.7.0.tar.gz", hash = "sha256:e73f207fc0e08c2f59ead82cbe39ef259b351a318d5c0bddcec13990bcd324a7"}, -] - -[package.dependencies] -poetry = ">=1.8.0,<2.0.0" -poetry-core = ">=1.7.0,<2.0.0" - [[package]] name = "pre-commit" version = "3.5.0" @@ -1595,4 +1580,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "f561c063b73aa744ed0b11d2e6e2b36dd5334e96607be8b3f2ebc895a5708870" +content-hash = "2f18715a8374452a7b31c6ed462054a1c0d22827f44fe2732e707a1d130ca07a" diff --git a/pyproject.toml b/pyproject.toml index 07265de94eb..c287f78426e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,6 @@ Changelog = "https://python-poetry.org/history/" python = "^3.8" poetry-core = "1.9.0" -poetry-plugin-export = "^1.7.0" build = "^1.1.1" cachecontrol = { version = "^0.14.0", extras = ["filecache"] } cleo = "^2.1.0"