Skip to content

Commit 0e26fb6

Browse files
ci: fix poetry issues
1 parent 9b1b711 commit 0e26fb6

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Diff for: .circleci/config.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,21 @@ jobs:
3434
- << pipeline.parameters.cache-prefix >>-{{ arch }}-{{ .Environment.BASE_BRANCH }}
3535
- << pipeline.parameters.cache-prefix >>-{{ arch }}-
3636
- run:
37-
name: Install Poetry 2.0.1
37+
name: Install Poetry 2.0.1 locally
3838
command: |
39-
curl -sSL https://install.python-poetry.org | POETRY_VERSION='2.0.1' python3 -
39+
python3 -m venv .poetry-venv
40+
.poetry-venv/bin/pip install poetry==2.0.1
41+
ln -s .poetry-venv/bin/poetry poetry-binary
4042
- run:
4143
name: Install python dependencies
4244
command: |
43-
poetry config virtualenvs.in-project true
44-
poetry install
45+
./poetry-binary config virtualenvs.in-project true
46+
./poetry-binary install
4547
- save_cache:
4648
key: << pipeline.parameters.cache-prefix >>-{{ arch }}-{{ checksum "poetry.lock" }}
4749
paths:
4850
- .venv
51+
- .poetry-venv
4952
- persist_to_workspace:
5053
root: .
5154
paths:
@@ -62,8 +65,8 @@ jobs:
6265
# ruff check --select I . : check linting and imports sorting without fixing (to fix, use --fix)
6366
# ruff format --check . : check code formatting without fixing (to fix, remove --check)
6467
command: |
65-
poetry run ruff check --select I .
66-
poetry run ruff format --check .
68+
./poetry-binary run ruff check --select I .
69+
./poetry-binary run ruff format --check .
6770
6871
tests:
6972
docker:
@@ -90,7 +93,7 @@ jobs:
9093
echo "$TESTFILES"
9194
# Run the found tests
9295
if [ -n "$TESTFILES" ]; then
93-
poetry run pytest --junitxml=reports/python/tests.xml -p no:sugar --color=yes $TESTFILES
96+
./poetry-binary run pytest --junitxml=reports/python/tests.xml -p no:sugar --color=yes $TESTFILES
9497
else
9598
echo "No tests to run in this split"
9699
exit 1
@@ -133,8 +136,8 @@ jobs:
133136
command: |
134137
RELEASE_VERSION=$(cat version.txt)
135138
# Set the version in pyproject.toml
136-
poetry version $RELEASE_VERSION
137-
poetry build
139+
./poetry-binary version $RELEASE_VERSION
140+
./poetry-binary build
138141
- store_artifacts:
139142
path: dist
140143
- persist_to_workspace:
@@ -152,7 +155,7 @@ jobs:
152155
- run:
153156
name: Publish on PyPI
154157
command: |
155-
poetry publish --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" --no-interaction
158+
./poetry-binary publish --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" --no-interaction
156159
157160
trigger-gitlab-pipeline:
158161
docker:

0 commit comments

Comments
 (0)