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 May 25, 2024
1 parent 25b145a commit 4fee994
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 36 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/.tests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,25 +75,44 @@ jobs:
if: inputs.run-pytest-export
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
path: poetry

- uses: ./.github/actions/bootstrap-poetry
- uses: ./poetry/.github/actions/bootstrap-poetry
with:
python-version: ${{ inputs.python-version }}

- uses: ./.github/actions/poetry-install
with:
args: --with github-actions
- 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

- run: poetry run pip list --format json | jq -r '.[] | "\(.name)=\(.version)"' >> $GITHUB_OUTPUT
id: package-versions

- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check out poetry-plugin-export
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
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.8.0"
build = "^1.2.1"
cachecontrol = { version = "^0.14.0", extras = ["filecache"] }
cleo = "^2.1.0"
Expand Down

0 comments on commit 4fee994

Please sign in to comment.