Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump poetry from 2.0.1 to 2.1.1 #1758

Merged
merged 4 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

- Updated Poetry from 2.0.1 to 2.1.1. ([#1758](https://github.com/heroku/heroku-buildpack-python/pull/1758))
- Stopped filtering out pip's `Requirement already satisfied:` log lines when installing dependencies. ([#1765](https://github.com/heroku/heroku-buildpack-python/pull/1765))
- Improved the error messages shown if installing pip/Poetry/Pipenv fails. ([#1764](https://github.com/heroku/heroku-buildpack-python/pull/1764))
- Stopped installing pip into Poetry's virtual environment. ([#1761](https://github.com/heroku/heroku-buildpack-python/pull/1761))
Expand Down
4 changes: 4 additions & 0 deletions lib/poetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,15 @@ function poetry::install_poetry() {
export PATH="${poetry_bin_dir}:${PATH}"
# Force Poetry to manage the system Python site-packages instead of using venvs.
export POETRY_VIRTUALENVS_CREATE="false"
# Force Poetry to use our Python rather than scanning PATH (which might pick system Python).
# Though this currently doesn't work as documented: https://github.com/python-poetry/poetry/issues/10226
export POETRY_VIRTUALENVS_USE_POETRY_PYTHON="true"

# Set the same env vars in the environment used by later buildpacks.
cat >>"${export_file}" <<-EOF
export PATH="${poetry_bin_dir}:\${PATH}"
export POETRY_VIRTUALENVS_CREATE="false"
export POETRY_VIRTUALENVS_USE_POETRY_PYTHON="true"
EOF
}

Expand Down
2 changes: 1 addition & 1 deletion requirements/poetry.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
poetry==2.0.1
poetry==2.1.1
15 changes: 11 additions & 4 deletions spec/fixtures/poetry_basic/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions spec/fixtures/poetry_basic/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[project]
name = "poetry-basic"
version = "0.0.0"
requires-python = ">=3.13"
dependencies = [
"typing-extensions"
]

[tool.poetry]
package-mode = false

[tool.poetry.dependencies]
python = "^3.13"
typing-extensions = "*"

# This group shouldn't be installed due to us passing `--only main`.
[tool.poetry.group.test.dependencies]
[tool.poetry.group.dev.dependencies]
pytest = "*"
2 changes: 2 additions & 0 deletions spec/hatchet/ci_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,15 @@
PIP_NO_PYTHON_VERSION_WARNING=1
PKG_CONFIG_PATH=/app/.heroku/python/lib/pkg-config
POETRY_VIRTUALENVS_CREATE=false
POETRY_VIRTUALENVS_USE_POETRY_PYTHON=true
PYTHONUNBUFFERED=1
-----> Inline app detected
LANG=en_US.UTF-8
LD_LIBRARY_PATH=/app/.heroku/python/lib
LIBRARY_PATH=/app/.heroku/python/lib
PATH=/app/.heroku/python/bin:/tmp/cache.+/.heroku/python-poetry/bin:/usr/local/bin:/usr/bin:/bin:/app/.sprettur/bin/
POETRY_VIRTUALENVS_CREATE=false
POETRY_VIRTUALENVS_USE_POETRY_PYTHON=true
PYTHONHASHSEED=random
PYTHONHOME=/app/.heroku/python
PYTHONPATH=/app
Expand Down
5 changes: 3 additions & 2 deletions spec/hatchet/poetry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
remote: LIBRARY_PATH=/app/.heroku/python/lib
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
remote: POETRY_VIRTUALENVS_CREATE=false
remote: POETRY_VIRTUALENVS_USE_POETRY_PYTHON=true
remote: PYTHONHASHSEED=random
remote: PYTHONHOME=/app/.heroku/python
remote: PYTHONPATH=/app
Expand Down Expand Up @@ -62,7 +63,7 @@
end

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

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