Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use Poetry 2.x (#17307)

Patryk Zawadzki3bc4b0e5d103
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index f2536e2c03..c063b93f37 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -17,7 +17,7 @@ RUN apt-get update \
mime-support
WORKDIR /app
-RUN pip install poetry==1.8.4
+RUN pip install poetry==2.0.1
RUN poetry config virtualenvs.create false
COPY poetry.lock pyproject.toml /app/
-RUN poetry install --no-root
+RUN poetry sync
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 6e0557af0a..88779d2229 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -45,7 +45,7 @@ jobs:
- name: Install and configure poetry
run: |
- pip install poetry==1.8.4
+ pip install poetry==2.0.1
- name: Cache the venv
id: cached-poetry-dependencies
@@ -57,7 +57,7 @@ jobs:
- name: Install dependencies
run: |
poetry env use python3.12
- poetry install --no-root
+ poetry sync
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Add Python Virtual Environment to PATH
diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml
index 63593bc405..a62c2e8dfd 100644
--- a/.github/workflows/pytest.yml
+++ b/.github/workflows/pytest.yml
@@ -53,7 +53,7 @@ jobs:
- name: Install and configure poetry
run: |
- pip install poetry==1.8.4
+ pip install poetry==2.0.1
- name: Cache the venv
id: cached-poetry-dependencies
@@ -65,7 +65,7 @@ jobs:
- name: Install dependencies
run: |
poetry env use python3.12
- poetry install --no-root
+ poetry sync
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Add Python Virtual Environment to PATH
diff --git a/.github/workflows/test-migrations-compatibility.yml b/.github/workflows/test-migrations-compatibility.yml
index 8dfac77506..40767adc63 100644
--- a/.github/workflows/test-migrations-compatibility.yml
+++ b/.github/workflows/test-migrations-compatibility.yml
@@ -38,7 +38,7 @@ jobs:
- name: Install and configure poetry
run: |
- pip install poetry==1.8.4
+ pip install poetry==2.0.1
- name: Restore venv from cache
id: cached-poetry-dependencies-restore
@@ -55,7 +55,7 @@ jobs:
if: steps.cached-poetry-dependencies-restore.outputs.cache-hit != 'true'
run: |
poetry env use python3.12
- poetry install --sync --no-root
+ poetry sync
- name: Add Python Virtual Environment to PATH
run: |
@@ -84,7 +84,7 @@ jobs:
# Sync dependencies to ensure consistency with base branch
- name: Synchronize dependencies
run: |
- poetry install --sync --no-root
+ poetry sync
- name: Run tests
run: |
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7cc00b82b3..a766dc6498 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -31,7 +31,7 @@ Saleor uses various tools to maintain a common coding style and help with develo
To install all the development tools, use [Poetry](https://python-poetry.org):
```shell
-poetry install
+poetry sync
```
Saleor uses the [pre-commit](https://pre-commit.com/#install) tool to check and automatically fix any formatting issue before creating a git commit.
diff --git a/Dockerfile b/Dockerfile
index 507f3bf7eb..4abc138268 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,10 +9,10 @@ RUN apt-get -y update \
# Install Python dependencies
WORKDIR /app
-RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install poetry==1.8.4
+RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install poetry==2.0.1
RUN poetry config virtualenvs.create false
COPY poetry.lock pyproject.toml /app/
-RUN --mount=type=cache,mode=0755,target=/root/.cache/pypoetry poetry install --no-root
+RUN --mount=type=cache,mode=0755,target=/root/.cache/pypoetry poetry sync
### Final image
FROM python:3.12-slim