diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3f7fab7..709e3cf87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +- Updated Poetry from 1.8.5 to 2.0.1. ([#1734](https://github.com/heroku/heroku-buildpack-python/pull/1734)) ## [v274] - 2025-01-08 diff --git a/lib/poetry.sh b/lib/poetry.sh index 062639b3a..a227ae1cd 100644 --- a/lib/poetry.sh +++ b/lib/poetry.sh @@ -99,8 +99,8 @@ function poetry::install_poetry() { # Note: We cache site-packages since: # - It results in faster builds than only caching Poetry's download/wheel cache. -# - It's safe to do so, since `poetry install --sync` fully manages the environment -# (including e.g. uninstalling packages when they are removed from the lockfile). +# - It's safe to do so, since `poetry sync` fully manages the environment (including +# e.g. uninstalling packages when they are removed from the lockfile). # # With site-packages cached there is no need to persist Poetry's download/wheel cache in the build # cache, so we let Poetry write it to the home directory where it will be discarded at the end of @@ -109,8 +109,7 @@ function poetry::install_poetry() { function poetry::install_dependencies() { local poetry_install_command=( poetry - install - --sync + sync ) # On Heroku CI, all default Poetry dependency groups are installed (i.e. all groups minus those diff --git a/requirements/poetry.txt b/requirements/poetry.txt index b7c67421a..d1c8013e2 100644 --- a/requirements/poetry.txt +++ b/requirements/poetry.txt @@ -1 +1 @@ -poetry==1.8.5 +poetry==2.0.1 diff --git a/spec/hatchet/ci_spec.rb b/spec/hatchet/ci_spec.rb index 824564447..fcd7198ba 100644 --- a/spec/hatchet/ci_spec.rb +++ b/spec/hatchet/ci_spec.rb @@ -161,7 +161,7 @@ -----> Using Python #{DEFAULT_PYTHON_MAJOR_VERSION} specified in .python-version -----> Installing Python #{DEFAULT_PYTHON_FULL_VERSION} -----> Installing Poetry #{POETRY_VERSION} - -----> Installing dependencies using 'poetry install --sync' + -----> Installing dependencies using 'poetry sync' Installing dependencies from lock file Package operations: 5 installs, 0 updates, 0 removals @@ -223,7 +223,7 @@ -----> Restoring cache -----> Using cached install of Python #{DEFAULT_PYTHON_FULL_VERSION} -----> Installing Poetry #{POETRY_VERSION} - -----> Installing dependencies using 'poetry install --sync' + -----> Installing dependencies using 'poetry sync' Installing dependencies from lock file No dependencies to install or update diff --git a/spec/hatchet/poetry_spec.rb b/spec/hatchet/poetry_spec.rb index 0429c0310..24e23c236 100644 --- a/spec/hatchet/poetry_spec.rb +++ b/spec/hatchet/poetry_spec.rb @@ -14,7 +14,7 @@ remote: -----> Using Python #{DEFAULT_PYTHON_MAJOR_VERSION} specified in .python-version remote: -----> Installing Python #{DEFAULT_PYTHON_FULL_VERSION} remote: -----> Installing Poetry #{POETRY_VERSION} - remote: -----> Installing dependencies using 'poetry install --sync --only main' + remote: -----> Installing dependencies using 'poetry sync --only main' remote: Installing dependencies from lock file remote: remote: Package operations: 1 install, 0 updates, 0 removals @@ -51,7 +51,7 @@ remote: -----> Restoring cache remote: -----> Using cached install of Python #{DEFAULT_PYTHON_FULL_VERSION} remote: -----> Using cached Poetry #{POETRY_VERSION} - remote: -----> Installing dependencies using 'poetry install --sync --only main' + remote: -----> Installing dependencies using 'poetry sync --only main' remote: Installing dependencies from lock file remote: remote: No dependencies to install or update @@ -78,7 +78,7 @@ remote: - The Poetry version has changed from 1.8.4 to #{POETRY_VERSION} remote: -----> Installing Python #{LATEST_PYTHON_3_13} remote: -----> Installing Poetry #{POETRY_VERSION} - remote: -----> Installing dependencies using 'poetry install --sync --only main' + remote: -----> Installing dependencies using 'poetry sync --only main' remote: Installing dependencies from lock file remote: remote: Package operations: 1 install, 0 updates, 0 removals @@ -107,7 +107,7 @@ remote: - The package manager has changed from pip to poetry remote: -----> Installing Python #{DEFAULT_PYTHON_FULL_VERSION} remote: -----> Installing Poetry #{POETRY_VERSION} - remote: -----> Installing dependencies using 'poetry install --sync --only main' + remote: -----> Installing dependencies using 'poetry sync --only main' remote: Installing dependencies from lock file remote: remote: Package operations: 1 install, 0 updates, 0 removals @@ -221,7 +221,7 @@ remote: ! See: https://devcenter.heroku.com/articles/python-runtimes remote: remote: -----> Installing Poetry #{POETRY_VERSION} - remote: -----> Installing dependencies using 'poetry install --sync --only main' + remote: -----> Installing dependencies using 'poetry sync --only main' remote: Installing dependencies from lock file remote: remote: Package operations: 1 install, 0 updates, 0 removals @@ -240,10 +240,10 @@ it 'fails the build' do app.deploy do |app| expect(clean_output(app.output)).to include(<<~OUTPUT) - remote: -----> Installing dependencies using 'poetry install --sync --only main' + remote: -----> Installing dependencies using 'poetry sync --only main' remote: Installing dependencies from lock file remote: - remote: pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock [--no-update]` to fix the lock file. + remote: pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock` to fix the lock file. remote: remote: ! Error: Unable to install dependencies using Poetry. remote: !