Skip to content

Commit 5b6496f

Browse files
committed
feat(compile): Warn that the buildpack is deprecated + no longer required
This buildpack is no longer required now that the Heroku Python buildpack supports Poetry natively: - https://devcenter.heroku.com/changelog-items/3050 - heroku/heroku-buildpack-python#1682 As such, a deprecation warning has been added to both the build log and the README. The warning borrows from the implementation here (which uses colour, and also makes sure to ANSI wrap each line individually to prevent issues with streaming logs from `git push` etc): https://github.com/heroku/heroku-buildpack-python/blob/ca99c39f9e3627fff727788206f7fcc4ff064b7f/lib/output.sh#L50-L66 Closes moneymeets#75.
1 parent 0e627ce commit 5b6496f

16 files changed

+437
-4
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

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

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

713
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).

bin/compile

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
set -euo pipefail
44

5+
export BUILD_DIR="$1"
6+
export ENV_DIR="$3"
7+
58
function log() {
69
echo "-----> $*"
710
}
@@ -10,8 +13,48 @@ function indent() {
1013
sed -e 's/^/ /'
1114
}
1215

13-
export BUILD_DIR="$1"
14-
export ENV_DIR="$3"
16+
function warning() {
17+
local ansi_yellow='\033[1;33m'
18+
local ansi_reset='\033[0m'
19+
echo >&2
20+
while IFS= read -r line; do
21+
echo -e "${ansi_yellow} ! ${line}${ansi_reset}" >&2
22+
done
23+
echo >&2
24+
}
25+
26+
warning <<-'EOF'
27+
Warning: This buildpack is no longer required!
28+
29+
The Heroku Python buildpack now supports Poetry itself,
30+
and so an additional Poetry buildpack is no longer
31+
required to deploy an app that uses Poetry to Heroku.
32+
33+
We recommend migrating away from this buildpack, since:
34+
- It is deprecated and no longer being maintained.
35+
- The native Poetry support installs dependencies using
36+
Poetry directly, rather than by exporting them to a
37+
requirements.txt file for use with pip. It also caches
38+
the Poetry install for faster rebuilds.
39+
40+
To migrate:
41+
1. Run 'heroku buildpacks' to find the exact URL/alias
42+
configured on your app for the Poetry buildpack.
43+
2. Remove the Poetry buildpack using:
44+
'heroku buildpacks:remove <BUILDPACK_URL>'
45+
For example:
46+
'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
47+
3. Create a '.python-version' file in the root of your
48+
repository containing a Python version that matches
49+
the version listed in your 'poetry.lock' under
50+
'metadata.python-versions'. For syntax, see:
51+
https://devcenter.heroku.com/articles/python-runtimes
52+
4. Commit all changes and deploy your app as normal.
53+
54+
For more information, see:
55+
https://github.com/moneymeets/python-poetry-buildpack/issues/75
56+
https://github.com/heroku/heroku-buildpack-python/pull/1682
57+
EOF
1558

1659
BUILDPACK_VARIABLES="DISABLE_POETRY_CREATE_RUNTIME_FILE PYTHON_RUNTIME_VERSION"
1760

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
 ! Warning: This buildpack is no longer required!
3+
 ! 
4+
 ! The Heroku Python buildpack now supports Poetry itself,
5+
 ! and so an additional Poetry buildpack is no longer
6+
 ! required to deploy an app that uses Poetry to Heroku.
7+
 ! 
8+
 ! We recommend migrating away from this buildpack, since:
9+
 ! - It is deprecated and no longer being maintained.
10+
 ! - The native Poetry support installs dependencies using
11+
 ! Poetry directly, rather than by exporting them to a
12+
 ! requirements.txt file for use with pip. It also caches
13+
 ! the Poetry install for faster rebuilds.
14+
 ! 
15+
 ! To migrate:
16+
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
17+
 ! configured on your app for the Poetry buildpack.
18+
 ! 2. Remove the Poetry buildpack using:
19+
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
20+
 ! For example:
21+
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
22+
 ! 3. Create a '.python-version' file in the root of your
23+
 ! repository containing a Python version that matches
24+
 ! the version listed in your 'poetry.lock' under
25+
 ! 'metadata.python-versions'. For syntax, see:
26+
 ! https://devcenter.heroku.com/articles/python-runtimes
27+
 ! 4. Commit all changes and deploy your app as normal.
28+
 ! 
29+
 ! For more information, see:
30+
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
31+
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682
32+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
 ! Warning: This buildpack is no longer required!
3+
 ! 
4+
 ! The Heroku Python buildpack now supports Poetry itself,
5+
 ! and so an additional Poetry buildpack is no longer
6+
 ! required to deploy an app that uses Poetry to Heroku.
7+
 ! 
8+
 ! We recommend migrating away from this buildpack, since:
9+
 ! - It is deprecated and no longer being maintained.
10+
 ! - The native Poetry support installs dependencies using
11+
 ! Poetry directly, rather than by exporting them to a
12+
 ! requirements.txt file for use with pip. It also caches
13+
 ! the Poetry install for faster rebuilds.
14+
 ! 
15+
 ! To migrate:
16+
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
17+
 ! configured on your app for the Poetry buildpack.
18+
 ! 2. Remove the Poetry buildpack using:
19+
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
20+
 ! For example:
21+
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
22+
 ! 3. Create a '.python-version' file in the root of your
23+
 ! repository containing a Python version that matches
24+
 ! the version listed in your 'poetry.lock' under
25+
 ! 'metadata.python-versions'. For syntax, see:
26+
 ! https://devcenter.heroku.com/articles/python-runtimes
27+
 ! 4. Commit all changes and deploy your app as normal.
28+
 ! 
29+
 ! For more information, see:
30+
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
31+
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682
32+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
 ! Warning: This buildpack is no longer required!
3+
 ! 
4+
 ! The Heroku Python buildpack now supports Poetry itself,
5+
 ! and so an additional Poetry buildpack is no longer
6+
 ! required to deploy an app that uses Poetry to Heroku.
7+
 ! 
8+
 ! We recommend migrating away from this buildpack, since:
9+
 ! - It is deprecated and no longer being maintained.
10+
 ! - The native Poetry support installs dependencies using
11+
 ! Poetry directly, rather than by exporting them to a
12+
 ! requirements.txt file for use with pip. It also caches
13+
 ! the Poetry install for faster rebuilds.
14+
 ! 
15+
 ! To migrate:
16+
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
17+
 ! configured on your app for the Poetry buildpack.
18+
 ! 2. Remove the Poetry buildpack using:
19+
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
20+
 ! For example:
21+
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
22+
 ! 3. Create a '.python-version' file in the root of your
23+
 ! repository containing a Python version that matches
24+
 ! the version listed in your 'poetry.lock' under
25+
 ! 'metadata.python-versions'. For syntax, see:
26+
 ! https://devcenter.heroku.com/articles/python-runtimes
27+
 ! 4. Commit all changes and deploy your app as normal.
28+
 ! 
29+
 ! For more information, see:
30+
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
31+
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682
32+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
 ! Warning: This buildpack is no longer required!
3+
 ! 
4+
 ! The Heroku Python buildpack now supports Poetry itself,
5+
 ! and so an additional Poetry buildpack is no longer
6+
 ! required to deploy an app that uses Poetry to Heroku.
7+
 ! 
8+
 ! We recommend migrating away from this buildpack, since:
9+
 ! - It is deprecated and no longer being maintained.
10+
 ! - The native Poetry support installs dependencies using
11+
 ! Poetry directly, rather than by exporting them to a
12+
 ! requirements.txt file for use with pip. It also caches
13+
 ! the Poetry install for faster rebuilds.
14+
 ! 
15+
 ! To migrate:
16+
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
17+
 ! configured on your app for the Poetry buildpack.
18+
 ! 2. Remove the Poetry buildpack using:
19+
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
20+
 ! For example:
21+
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
22+
 ! 3. Create a '.python-version' file in the root of your
23+
 ! repository containing a Python version that matches
24+
 ! the version listed in your 'poetry.lock' under
25+
 ! 'metadata.python-versions'. For syntax, see:
26+
 ! https://devcenter.heroku.com/articles/python-runtimes
27+
 ! 4. Commit all changes and deploy your app as normal.
28+
 ! 
29+
 ! For more information, see:
30+
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
31+
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682
32+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
 ! Warning: This buildpack is no longer required!
3+
 ! 
4+
 ! The Heroku Python buildpack now supports Poetry itself,
5+
 ! and so an additional Poetry buildpack is no longer
6+
 ! required to deploy an app that uses Poetry to Heroku.
7+
 ! 
8+
 ! We recommend migrating away from this buildpack, since:
9+
 ! - It is deprecated and no longer being maintained.
10+
 ! - The native Poetry support installs dependencies using
11+
 ! Poetry directly, rather than by exporting them to a
12+
 ! requirements.txt file for use with pip. It also caches
13+
 ! the Poetry install for faster rebuilds.
14+
 ! 
15+
 ! To migrate:
16+
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
17+
 ! configured on your app for the Poetry buildpack.
18+
 ! 2. Remove the Poetry buildpack using:
19+
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
20+
 ! For example:
21+
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
22+
 ! 3. Create a '.python-version' file in the root of your
23+
 ! repository containing a Python version that matches
24+
 ! the version listed in your 'poetry.lock' under
25+
 ! 'metadata.python-versions'. For syntax, see:
26+
 ! https://devcenter.heroku.com/articles/python-runtimes
27+
 ! 4. Commit all changes and deploy your app as normal.
28+
 ! 
29+
 ! For more information, see:
30+
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
31+
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682
32+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
 ! Warning: This buildpack is no longer required!
3+
 ! 
4+
 ! The Heroku Python buildpack now supports Poetry itself,
5+
 ! and so an additional Poetry buildpack is no longer
6+
 ! required to deploy an app that uses Poetry to Heroku.
7+
 ! 
8+
 ! We recommend migrating away from this buildpack, since:
9+
 ! - It is deprecated and no longer being maintained.
10+
 ! - The native Poetry support installs dependencies using
11+
 ! Poetry directly, rather than by exporting them to a
12+
 ! requirements.txt file for use with pip. It also caches
13+
 ! the Poetry install for faster rebuilds.
14+
 ! 
15+
 ! To migrate:
16+
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
17+
 ! configured on your app for the Poetry buildpack.
18+
 ! 2. Remove the Poetry buildpack using:
19+
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
20+
 ! For example:
21+
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
22+
 ! 3. Create a '.python-version' file in the root of your
23+
 ! repository containing a Python version that matches
24+
 ! the version listed in your 'poetry.lock' under
25+
 ! 'metadata.python-versions'. For syntax, see:
26+
 ! https://devcenter.heroku.com/articles/python-runtimes
27+
 ! 4. Commit all changes and deploy your app as normal.
28+
 ! 
29+
 ! For more information, see:
30+
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
31+
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682
32+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1+
2+
 ! Warning: This buildpack is no longer required!
3+
 ! 
4+
 ! The Heroku Python buildpack now supports Poetry itself,
5+
 ! and so an additional Poetry buildpack is no longer
6+
 ! required to deploy an app that uses Poetry to Heroku.
7+
 ! 
8+
 ! We recommend migrating away from this buildpack, since:
9+
 ! - It is deprecated and no longer being maintained.
10+
 ! - The native Poetry support installs dependencies using
11+
 ! Poetry directly, rather than by exporting them to a
12+
 ! requirements.txt file for use with pip. It also caches
13+
 ! the Poetry install for faster rebuilds.
14+
 ! 
15+
 ! To migrate:
16+
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
17+
 ! configured on your app for the Poetry buildpack.
18+
 ! 2. Remove the Poetry buildpack using:
19+
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
20+
 ! For example:
21+
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
22+
 ! 3. Create a '.python-version' file in the root of your
23+
 ! repository containing a Python version that matches
24+
 ! the version listed in your 'poetry.lock' under
25+
 ! 'metadata.python-versions'. For syntax, see:
26+
 ! https://devcenter.heroku.com/articles/python-runtimes
27+
 ! 4. Commit all changes and deploy your app as normal.
28+
 ! 
29+
 ! For more information, see:
30+
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
31+
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682
32+
133
-----> ^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)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
 ! Warning: This buildpack is no longer required!
3+
 ! 
4+
 ! The Heroku Python buildpack now supports Poetry itself,
5+
 ! and so an additional Poetry buildpack is no longer
6+
 ! required to deploy an app that uses Poetry to Heroku.
7+
 ! 
8+
 ! We recommend migrating away from this buildpack, since:
9+
 ! - It is deprecated and no longer being maintained.
10+
 ! - The native Poetry support installs dependencies using
11+
 ! Poetry directly, rather than by exporting them to a
12+
 ! requirements.txt file for use with pip. It also caches
13+
 ! the Poetry install for faster rebuilds.
14+
 ! 
15+
 ! To migrate:
16+
 ! 1. Run 'heroku buildpacks' to find the exact URL/alias
17+
 ! configured on your app for the Poetry buildpack.
18+
 ! 2. Remove the Poetry buildpack using:
19+
 ! 'heroku buildpacks:remove <BUILDPACK_URL>'
20+
 ! For example:
21+
 ! 'heroku buildpacks:remove https://github.com/moneymeets/python-poetry-buildpack.git'
22+
 ! 3. Create a '.python-version' file in the root of your
23+
 ! repository containing a Python version that matches
24+
 ! the version listed in your 'poetry.lock' under
25+
 ! 'metadata.python-versions'. For syntax, see:
26+
 ! https://devcenter.heroku.com/articles/python-runtimes
27+
 ! 4. Commit all changes and deploy your app as normal.
28+
 ! 
29+
 ! For more information, see:
30+
 ! https://github.com/moneymeets/python-poetry-buildpack/issues/75
31+
 ! https://github.com/heroku/heroku-buildpack-python/pull/1682
32+

0 commit comments

Comments
 (0)