Skip to content

Commit 20cd0b6

Browse files
Bump poetry from 2.0.1 to 2.1.1 (#1758)
* Bump poetry from 2.0.1 to 2.1.1 Bumps [poetry](https://github.com/python-poetry/poetry) from 2.0.1 to 2.1.1. - [Release notes](https://github.com/python-poetry/poetry/releases) - [Changelog](https://github.com/python-poetry/poetry/blob/main/CHANGELOG.md) - [Commits](python-poetry/poetry@2.0.1...2.1.1) --- updated-dependencies: - dependency-name: poetry dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Set `POETRY_VIRTUALENVS_USE_POETRY_PYTHON` Since in theory it should force Poetry to not search for other Python versions if the project's `requires-python` (or `tool.poetry` equivalent) doesn't match the Python version we installed. * Add changelog entry * Update one fixture to PEP-621 style `pyproject.toml` So we have fixtures testing both the new and old style config. --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ed Morley <[email protected]>
1 parent caa1a19 commit 20cd0b6

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [Unreleased]
44

5+
- Updated Poetry from 2.0.1 to 2.1.1. ([#1758](https://github.com/heroku/heroku-buildpack-python/pull/1758))
56
- Stopped filtering out pip's `Requirement already satisfied:` log lines when installing dependencies. ([#1765](https://github.com/heroku/heroku-buildpack-python/pull/1765))
67
- Improved the error messages shown if installing pip/Poetry/Pipenv fails. ([#1764](https://github.com/heroku/heroku-buildpack-python/pull/1764))
78
- Stopped installing pip into Poetry's virtual environment. ([#1761](https://github.com/heroku/heroku-buildpack-python/pull/1761))

lib/poetry.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,15 @@ function poetry::install_poetry() {
101101
export PATH="${poetry_bin_dir}:${PATH}"
102102
# Force Poetry to manage the system Python site-packages instead of using venvs.
103103
export POETRY_VIRTUALENVS_CREATE="false"
104+
# Force Poetry to use our Python rather than scanning PATH (which might pick system Python).
105+
# Though this currently doesn't work as documented: https://github.com/python-poetry/poetry/issues/10226
106+
export POETRY_VIRTUALENVS_USE_POETRY_PYTHON="true"
104107

105108
# Set the same env vars in the environment used by later buildpacks.
106109
cat >>"${export_file}" <<-EOF
107110
export PATH="${poetry_bin_dir}:\${PATH}"
108111
export POETRY_VIRTUALENVS_CREATE="false"
112+
export POETRY_VIRTUALENVS_USE_POETRY_PYTHON="true"
109113
EOF
110114
}
111115

requirements/poetry.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
poetry==2.0.1
1+
poetry==2.1.1

spec/fixtures/poetry_basic/poetry.lock

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
[project]
2+
name = "poetry-basic"
3+
version = "0.0.0"
4+
requires-python = ">=3.13"
5+
dependencies = [
6+
"typing-extensions"
7+
]
8+
19
[tool.poetry]
210
package-mode = false
311

4-
[tool.poetry.dependencies]
5-
python = "^3.13"
6-
typing-extensions = "*"
7-
812
# This group shouldn't be installed due to us passing `--only main`.
9-
[tool.poetry.group.test.dependencies]
13+
[tool.poetry.group.dev.dependencies]
1014
pytest = "*"

spec/hatchet/ci_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,15 @@
189189
PIP_NO_PYTHON_VERSION_WARNING=1
190190
PKG_CONFIG_PATH=/app/.heroku/python/lib/pkg-config
191191
POETRY_VIRTUALENVS_CREATE=false
192+
POETRY_VIRTUALENVS_USE_POETRY_PYTHON=true
192193
PYTHONUNBUFFERED=1
193194
-----> Inline app detected
194195
LANG=en_US.UTF-8
195196
LD_LIBRARY_PATH=/app/.heroku/python/lib
196197
LIBRARY_PATH=/app/.heroku/python/lib
197198
PATH=/app/.heroku/python/bin:/tmp/cache.+/.heroku/python-poetry/bin:/usr/local/bin:/usr/bin:/bin:/app/.sprettur/bin/
198199
POETRY_VIRTUALENVS_CREATE=false
200+
POETRY_VIRTUALENVS_USE_POETRY_PYTHON=true
199201
PYTHONHASHSEED=random
200202
PYTHONHOME=/app/.heroku/python
201203
PYTHONPATH=/app

spec/hatchet/poetry_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
remote: LIBRARY_PATH=/app/.heroku/python/lib
2727
remote: PATH=/app/.heroku/python/bin:/tmp/codon/tmp/cache/.heroku/python-poetry/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2828
remote: POETRY_VIRTUALENVS_CREATE=false
29+
remote: POETRY_VIRTUALENVS_USE_POETRY_PYTHON=true
2930
remote: PYTHONHASHSEED=random
3031
remote: PYTHONHOME=/app/.heroku/python
3132
remote: PYTHONPATH=/app
@@ -62,7 +63,7 @@
6263
end
6364

6465
context 'when the Poetry and Python versions have changed since the last build' do
65-
let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v274'] }
66+
let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v275'] }
6667
let(:app) { Hatchet::Runner.new('spec/fixtures/poetry_basic', buildpacks:) }
6768

6869
it 'clears the cache before installing' do
@@ -75,7 +76,7 @@
7576
remote: -----> Using Python 3.13 specified in .python-version
7677
remote: -----> Discarding cache since:
7778
remote: - The Python version has changed from 3.13.1 to #{LATEST_PYTHON_3_13}
78-
remote: - The Poetry version has changed from 1.8.5 to #{POETRY_VERSION}
79+
remote: - The Poetry version has changed from 2.0.1 to #{POETRY_VERSION}
7980
remote: -----> Installing Python #{LATEST_PYTHON_3_13}
8081
remote: -----> Installing Poetry #{POETRY_VERSION}
8182
remote: -----> Installing dependencies using 'poetry sync --only main'

0 commit comments

Comments
 (0)