Skip to content

Commit 66db819

Browse files
authored
Update setuptools and wheel (#1254)
Updates: - setuptools from 47.1.1 to: - 50.3.2 for Python 3.5 - 57.5.0 for Python 3.6+ - wheel from 0.36.2 to 0.37.0. Of note, the newer setuptools is fully compatible with Python 3.10, thereby fixing #1248. Updating to newer setuptools was blocked on #1006, but that's now been fixed by #1252. The setuptools version hasn't been updated all the way to the latest (58.2.0), since v58 dropped support for 2to3, which caused breakage in a few packages, so I would rather hold off as long as possible (and there are no fixes that we need since then). Release notes: https://setuptools.pypa.io/en/latest/history.html#v57-5-0 https://wheel.readthedocs.io/en/stable/news.html Full changelogs: pypa/setuptools@v47.1.1...v57.5.0 pypa/wheel@0.36.2...0.37.0 Fixes #1248. GUS-W-10052807.
1 parent 24b892e commit 66db819

File tree

6 files changed

+57
-24
lines changed

6 files changed

+57
-24
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
- Update setuptools from 47.1.1 to: ([#1253](https://github.com/heroku/heroku-buildpack-python/pull/1254))
6+
- 50.3.2 for Python 3.5
7+
- 57.5.0 for Python 3.6+
8+
- Update wheel from 0.36.2 to 0.37.0 ([#1253](https://github.com/heroku/heroku-buildpack-python/pull/1254)).
59
- Perform editable package `.pth` and `.egg-link` path rewriting at runtime ([#1252](https://github.com/heroku/heroku-buildpack-python/pull/1252)).
610

711
## v200 (2021-10-04)

bin/steps/python

+5-4
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,8 @@ fi
151151
set -e
152152

153153
PIP_VERSION='20.2.4'
154-
# Must use setuptools <47.2.0 until we fix:
155-
# https://github.com/heroku/heroku-buildpack-python/issues/1006
156-
SETUPTOOLS_VERSION='47.1.1'
157-
WHEEL_VERSION='0.36.2'
154+
SETUPTOOLS_VERSION='57.5.0'
155+
WHEEL_VERSION='0.37.0'
158156

159157
if [[ "${PYTHON_VERSION}" == ${PY34}* ]]; then
160158
# Python 3.4 support was dropped in pip 19.2+, setuptools 44+ and wheel 0.34+.
@@ -164,6 +162,9 @@ if [[ "${PYTHON_VERSION}" == ${PY34}* ]]; then
164162
elif [[ "${PYTHON_VERSION}" == ${PY27}* || "${PYTHON_VERSION}" == ${PYPY27}* ]]; then
165163
# Python 2.7 support was dropped in setuptools 45+.
166164
SETUPTOOLS_VERSION='44.1.1'
165+
elif [[ "${PYTHON_VERSION}" == ${PY35}* ]]; then
166+
# Python 3.5 support was dropped in setuptools 51+.
167+
SETUPTOOLS_VERSION='50.3.2'
167168
fi
168169

169170
puts-step "Installing pip ${PIP_VERSION}, setuptools ${SETUPTOOLS_VERSION} and wheel ${WHEEL_VERSION}"

spec/hatchet/pip_spec.rb

+19-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
remote: -----> No Python version was specified. Using the buildpack default: python-#{DEFAULT_PYTHON_VERSION}
2323
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
2424
remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
25-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
25+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
2626
remote: -----> Installing SQLite3
2727
remote: -----> Installing requirements with pip
2828
remote: Collecting urllib3
@@ -38,7 +38,7 @@
3838
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
3939
remote: -----> No change in requirements detected, installing from cache
4040
remote: -----> Using cached install of python-#{DEFAULT_PYTHON_VERSION}
41-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
41+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
4242
remote: -----> Installing SQLite3
4343
remote: -----> Installing requirements with pip
4444
remote: -----> Discovering process types
@@ -61,7 +61,7 @@
6161
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
6262
remote: -----> Requirements file has been changed, clearing cached dependencies
6363
remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
64-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
64+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
6565
remote: -----> Installing SQLite3
6666
remote: -----> Installing requirements with pip
6767
remote: Collecting urllib3
@@ -103,6 +103,9 @@
103103
remote: Running setup.py develop for local-package
104104
remote: Successfully installed gunicorn local-package
105105
remote: -----> Running post-compile hook
106+
remote: ==> .heroku/python/lib/python.*/site-packages/distutils-precedence.pth <==
107+
remote: import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get\\(var, 'stdlib'\\) == 'local'; enabled and __import__\\('_distutils_hack'\\).add_shim\\(\\);
108+
remote:
106109
remote: ==> .heroku/python/lib/python.*/site-packages/easy-install.pth <==
107110
remote: /app/.heroku/src/gunicorn
108111
remote: /tmp/build_.*/local_package
@@ -116,6 +119,9 @@
116119
remote: Running entrypoint for the local package: Hello!
117120
remote: Running entrypoint for the VCS package: gunicorn \\(version 20.1.0\\)
118121
remote: -----> Inline app detected
122+
remote: ==> .heroku/python/lib/python.*/site-packages/distutils-precedence.pth <==
123+
remote: import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get\\(var, 'stdlib'\\) == 'local'; enabled and __import__\\('_distutils_hack'\\).add_shim\\(\\);
124+
remote:
119125
remote: ==> .heroku/python/lib/python.*/site-packages/easy-install.pth <==
120126
remote: /app/.heroku/src/gunicorn
121127
remote: /tmp/build_.*/local_package
@@ -132,6 +138,9 @@
132138

133139
# Test rewritten paths work at runtime.
134140
expect(app.run('bin/test-entrypoints')).to match(Regexp.new(<<~REGEX))
141+
==> .heroku/python/lib/python.*/site-packages/distutils-precedence.pth <==
142+
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get\\(var, 'stdlib'\\) == 'local'; enabled and __import__\\('_distutils_hack'\\).add_shim\\(\\);
143+
135144
==> .heroku/python/lib/python.*/site-packages/easy-install.pth <==
136145
/app/.heroku/src/gunicorn
137146
/app/local_package
@@ -152,7 +161,7 @@
152161
expect(clean_output(app.output)).to match(Regexp.new(<<~REGEX))
153162
remote: -----> No change in requirements detected, installing from cache
154163
remote: -----> Using cached install of python-#{DEFAULT_PYTHON_VERSION}
155-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
164+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
156165
remote: -----> Installing SQLite3
157166
remote: -----> Installing requirements with pip
158167
remote: Obtaining file:///tmp/build_.*/local_package \\(from -r /tmp/build_.*/requirements.txt \\(line 1\\)\\)
@@ -163,6 +172,9 @@
163172
remote: Running setup.py develop for local-package
164173
remote: Successfully installed gunicorn local-package
165174
remote: -----> Running post-compile hook
175+
remote: ==> .heroku/python/lib/python.*/site-packages/distutils-precedence.pth <==
176+
remote: import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get\\(var, 'stdlib'\\) == 'local'; enabled and __import__\\('_distutils_hack'\\).add_shim\\(\\);
177+
remote:
166178
remote: ==> .heroku/python/lib/python.*/site-packages/easy-install.pth <==
167179
remote: /app/.heroku/src/gunicorn
168180
remote: /tmp/build_.*/local_package
@@ -176,6 +188,9 @@
176188
remote: Running entrypoint for the local package: Hello!
177189
remote: Running entrypoint for the VCS package: gunicorn \\(version 20.1.0\\)
178190
remote: -----> Inline app detected
191+
remote: ==> .heroku/python/lib/python.*/site-packages/distutils-precedence.pth <==
192+
remote: import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get\\(var, 'stdlib'\\) == 'local'; enabled and __import__\\('_distutils_hack'\\).add_shim\\(\\);
193+
remote:
179194
remote: ==> .heroku/python/lib/python.*/site-packages/easy-install.pth <==
180195
remote: /app/.heroku/src/gunicorn
181196
remote: /tmp/build_.*/local_package

spec/hatchet/pipenv_spec.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
remote: -----> Using Python version specified in Pipfile.lock
1212
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
1313
remote: -----> Installing python-#{python_version}
14-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
14+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
1515
remote: -----> Installing dependencies with Pipenv 2020.11.15
1616
remote: Installing dependencies from Pipfile.lock \\(.*\\)...
1717
remote: -----> Installing SQLite3
@@ -33,7 +33,7 @@
3333
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
3434
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
3535
remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
36-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
36+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
3737
remote: -----> Installing dependencies with Pipenv 2020.11.15
3838
remote: Installing dependencies from Pipfile...
3939
remote: -----> Installing SQLite3
@@ -53,7 +53,7 @@
5353
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
5454
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
5555
remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
56-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
56+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
5757
remote: -----> Installing dependencies with Pipenv 2020.11.15
5858
remote: Installing dependencies from Pipfile.lock \\(aad8b1\\)...
5959
remote: -----> Installing SQLite3
@@ -76,7 +76,7 @@
7676
remote: Learn More: https://devcenter.heroku.com/articles/python-2-7-eol-faq
7777
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
7878
remote: -----> Installing python-#{LATEST_PYTHON_2_7}
79-
remote: -----> Installing pip 20.2.4, setuptools 44.1.1 and wheel 0.36.2
79+
remote: -----> Installing pip 20.2.4, setuptools 44.1.1 and wheel 0.37.0
8080
remote: -----> Installing dependencies with Pipenv 2020.11.15
8181
remote: Installing dependencies from Pipfile.lock \\(b8efa9\\)...
8282
remote: -----> Installing SQLite3
@@ -153,7 +153,7 @@
153153
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
154154
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
155155
remote: -----> Installing python-3.9.1
156-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
156+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
157157
remote: -----> Installing dependencies with Pipenv 2020.11.15
158158
remote: Installing dependencies from Pipfile.lock \\(e13df1\\)...
159159
remote: -----> Installing SQLite3
@@ -203,7 +203,7 @@
203203
remote: -----> Using Python version specified in runtime.txt
204204
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
205205
remote: -----> Installing python-#{LATEST_PYTHON_3_9}
206-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
206+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
207207
remote: -----> Installing dependencies with Pipenv 2020.11.15
208208
remote: Installing dependencies from Pipfile.lock \\(75eae0\\)...
209209
remote: -----> Installing SQLite3
@@ -221,7 +221,7 @@
221221
remote: -----> Python app detected
222222
remote: -----> Using Python version specified in Pipfile.lock
223223
remote: -----> Installing python-#{LATEST_PYTHON_3_9}
224-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
224+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
225225
remote: -----> Installing dependencies with Pipenv 2020.11.15
226226
remote: Installing dependencies from Pipfile.lock (ef68d1)...
227227
remote: -----> Installing SQLite3
@@ -241,7 +241,7 @@
241241
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
242242
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
243243
remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
244-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
244+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
245245
remote: -----> Installing dependencies with Pipenv 2020.11.15
246246
remote: Your Pipfile.lock \\(aad8b1\\) is out of date. Expected: \\(ef68d1\\).
247247
remote: \\[DeployException\\]: .*

spec/hatchet/python_version_spec.rb

+19-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
remote: -----> Python app detected
1010
remote: -----> Using Python version specified in runtime.txt
1111
remote: -----> Installing python-#{python_version}
12-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
12+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
1313
remote: -----> Installing SQLite3
1414
remote: -----> Installing requirements with pip
1515
remote: Collecting urllib3
@@ -89,7 +89,7 @@
8989
remote: ! Python 2 has reached its community EOL. Upgrade your Python runtime to maintain a secure application as soon as possible.
9090
remote: Learn More: https://devcenter.heroku.com/articles/python-2-7-eol-faq
9191
remote: -----> Installing python-#{LATEST_PYTHON_2_7}
92-
remote: -----> Installing pip 20.2.4, setuptools 44.1.1 and wheel 0.36.2
92+
remote: -----> Installing pip 20.2.4, setuptools 44.1.1 and wheel 0.37.0
9393
remote: -----> Installing SQLite3
9494
remote: -----> Installing requirements with pip
9595
remote: Collecting urllib3
@@ -145,7 +145,20 @@
145145
let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.5', allow_failure: allow_failure) }
146146

147147
context 'when using Heroku-18', stacks: %w[heroku-18] do
148-
include_examples 'builds with the requested Python version', LATEST_PYTHON_3_5
148+
it 'builds with Python 3.5.10' do
149+
app.deploy do |app|
150+
expect(clean_output(app.output)).to include(<<~OUTPUT)
151+
remote: -----> Python app detected
152+
remote: -----> Using Python version specified in runtime.txt
153+
remote: -----> Installing python-#{LATEST_PYTHON_3_5}
154+
remote: -----> Installing pip 20.2.4, setuptools 50.3.2 and wheel 0.37.0
155+
remote: -----> Installing SQLite3
156+
remote: -----> Installing requirements with pip
157+
remote: Collecting urllib3
158+
OUTPUT
159+
expect(app.run('python -V')).to include("Python #{LATEST_PYTHON_3_5}")
160+
end
161+
end
149162
end
150163

151164
context 'when using Heroku-20', stacks: %w[heroku-20] do
@@ -195,7 +208,7 @@
195208
remote: -----> Python app detected
196209
remote: -----> Using Python version specified in runtime.txt
197210
remote: -----> Installing pypy2.7-#{LATEST_PYPY_2_7}
198-
remote: -----> Installing pip 20.2.4, setuptools 44.1.1 and wheel 0.36.2
211+
remote: -----> Installing pip 20.2.4, setuptools 44.1.1 and wheel 0.37.0
199212
remote: -----> Installing SQLite3
200213
remote: -----> Installing requirements with pip
201214
remote: Collecting urllib3
@@ -214,7 +227,7 @@
214227
remote: -----> Python app detected
215228
remote: -----> Using Python version specified in runtime.txt
216229
remote: -----> Installing pypy3.6-#{LATEST_PYPY_3_6}
217-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
230+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
218231
remote: -----> Installing SQLite3
219232
remote: -----> Installing requirements with pip
220233
remote: Collecting urllib3
@@ -257,7 +270,7 @@
257270
remote: -----> Python version has changed from python-#{LATEST_PYTHON_3_6} to python-#{LATEST_PYTHON_3_9}, clearing cache
258271
remote: -----> No change in requirements detected, installing from cache
259272
remote: -----> Installing python-#{LATEST_PYTHON_3_9}
260-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
273+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
261274
remote: -----> Installing SQLite3
262275
remote: -----> Installing requirements with pip
263276
remote: Collecting urllib3

spec/hatchet/stack_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
remote: -----> Stack has changed from heroku-18 to heroku-20, clearing cache
3030
remote: -----> No change in requirements detected, installing from cache
3131
remote: -----> Installing python-3.6.12
32-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
32+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
3333
remote: -----> Installing SQLite3
3434
remote: -----> Installing requirements with pip
3535
remote: Collecting urllib3
@@ -58,7 +58,7 @@
5858
remote: -----> Stack has changed from heroku-20 to heroku-18, clearing cache
5959
remote: -----> No change in requirements detected, installing from cache
6060
remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
61-
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
61+
remote: -----> Installing pip 20.2.4, setuptools 57.5.0 and wheel 0.37.0
6262
remote: -----> Installing SQLite3
6363
remote: -----> Installing requirements with pip
6464
remote: Collecting urllib3

0 commit comments

Comments
 (0)