Skip to content

Commit

Permalink
Remove circular dependency on export plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Mar 29, 2024
1 parent fe9f85b commit 0436e48
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 39 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/.tests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 0 additions & 9 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 2 additions & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0436e48

Please sign in to comment.