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

Warn that the buildpack is deprecated + no longer required #76

Merged
merged 1 commit into from
Nov 19, 2024
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

A [Heroku](https://devcenter.heroku.com/) Buildpack for [Poetry](https://github.com/python-poetry/poetry) users.

> [!WARNING]
> The Heroku Python buildpack [now supports Poetry itself](https://github.com/heroku/heroku-buildpack-python/pull/1682), and so an additional Poetry
> buildpack is no longer required to deploy an app that uses Poetry to Heroku.
>
> As such, this buildpack is deprecated and you should no longer use it.

## How to use

The Python Poetry Buildpack prepares the build to be processed by a Python buildpack such as `heroku/python` by generating `requirements.txt` and `runtime.txt` from `poetry.lock`. With that said, your repo cannot have a `requirements.txt`, it will be exported from Poetry (for `runtime.txt` see below).
Expand Down
47 changes: 45 additions & 2 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -euo pipefail

export BUILD_DIR="$1"
export ENV_DIR="$3"

function log() {
echo "-----> $*"
}
Expand All @@ -10,8 +13,48 @@ function indent() {
sed -e 's/^/ /'
}

export BUILD_DIR="$1"
export ENV_DIR="$3"
function warning() {
local ansi_yellow='\033[1;33m'
local ansi_reset='\033[0m'
echo >&2
while IFS= read -r line; do
echo -e "${ansi_yellow} ! ${line}${ansi_reset}" >&2
done
echo >&2
}

warning <<-'EOF'
Warning: This buildpack is no longer required!

The Heroku Python buildpack now supports Poetry itself,
and so an additional Poetry buildpack is no longer
required to deploy an app that uses Poetry to Heroku.

We recommend migrating away from this buildpack, since:
- It is deprecated and no longer being maintained.
- The native Poetry support installs dependencies using
Poetry directly, rather than by exporting them to a
requirements.txt file for use with pip. It also caches
the Poetry install for faster rebuilds.

To migrate:
1. Run 'heroku buildpacks' to find the exact URL/alias
configured on your app for the Poetry buildpack.
2. Remove the Poetry buildpack using:
'heroku buildpacks:remove <BUILDPACK_URL>'
For example:
'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
3. Create a '.python-version' file in the root of your
repository containing a Python version that matches
the version listed in your 'poetry.lock' under
'metadata.python-versions'. For syntax, see:
https://devcenter.heroku.com/articles/python-runtimes
4. Commit all changes and deploy your app as normal.

For more information, see:
https://github.com/moneymeets/python-poetry-buildpack/issues/75
https://github.com/heroku/heroku-buildpack-python/pull/1682
EOF

BUILDPACK_VARIABLES="DISABLE_POETRY_CREATE_RUNTIME_FILE PYTHON_RUNTIME_VERSION"

Expand Down
32 changes: 32 additions & 0 deletions test/fixtures/compile-exact_version_specifier.stderr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

32 changes: 32 additions & 0 deletions test/fixtures/compile-export_dev.stderr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

32 changes: 32 additions & 0 deletions test/fixtures/compile-export_params-0.stderr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

32 changes: 32 additions & 0 deletions test/fixtures/compile-export_params-1.stderr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

32 changes: 32 additions & 0 deletions test/fixtures/compile-force_poetry_version.stderr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

32 changes: 32 additions & 0 deletions test/fixtures/compile-force_python_version.stderr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

32 changes: 32 additions & 0 deletions test/fixtures/compile-invalid_python_version.stderr.txt
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

-----> ^3.8 is not valid, please specify an exact Python version (e.g. 3.8.1 or ==3.8.1) in your pyproject.toml (and thus poetry.lock)
32 changes: 32 additions & 0 deletions test/fixtures/compile-no_vars_success.stderr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

32 changes: 32 additions & 0 deletions test/fixtures/compile-poetry_version_comment.stderr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

 ! Warning: This buildpack is no longer required!
 ! 
 ! The Heroku Python buildpack now supports Poetry itself,
 ! and so an additional Poetry buildpack is no longer
 ! required to deploy an app that uses Poetry to Heroku.
 ! 
 ! We recommend migrating away from this buildpack, since:
 ! - It is deprecated and no longer being maintained.
 ! - The native Poetry support installs dependencies using
 ! Poetry directly, rather than by exporting them to a
 ! requirements.txt file for use with pip. It also caches
 ! the Poetry install for faster rebuilds.
 ! 
 ! To migrate:
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
 ! configured on your app for the Poetry buildpack.
 ! 2. Remove the Poetry buildpack using:
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
 ! For example:
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
 ! 3. Create a '.python-version' file in the root of your
 ! repository containing a Python version that matches
 ! the version listed in your 'poetry.lock' under
 ! 'metadata.python-versions'. For syntax, see:
 ! https://devcenter.heroku.com/articles/python-runtimes
 ! 4. Commit all changes and deploy your app as normal.
 ! 
 ! For more information, see:
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682

2 changes: 1 addition & 1 deletion test/fixtures/compile-sanity-1.stderr.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../bin/compile: line 13: $1: unbound variable
../bin/compile: line 5: $1: unbound variable
2 changes: 1 addition & 1 deletion test/fixtures/compile-sanity-2.stderr.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
../bin/compile: line 14: $3: unbound variable
../bin/compile: line 6: $3: unbound variable
Loading