Skip to content

Commit 8a5c73e

Browse files
authored
Update pip to 22.0.4, setuptools to 60.10.0 and wheel to 0.37.1 (#1310)
- Update pip from 21.3.1 to 22.0.4 for Python 3.7+ - Update setuptools from 57.5.0 to: - 59.6.0 for Python 3.6 - 60.10.0 for Python 3.7+ - Update wheel from 0.37.0 to 0.37.1 for Python 2.7 and Python 3.5+ The setuptools upgrade should resolve issues Pipenv users are seeing with conflicting setuptools versions causing errors like: ``` Traceback (most recent call last): ... File "/app/.heroku/python/lib/python3.10/site-packages/pipenv/environment.py", line 553, in get_distributions pkg_resources = self.safe_import("pkg_resources") File "/app/.heroku/python/lib/python3.10/site-packages/pipenv/environment.py", line 92, in safe_import six.moves.reload_module(module) File "/app/.heroku/python/lib/python3.10/importlib/__init__.py", line 169, in reload _bootstrap._exec(spec, module) File "<frozen importlib._bootstrap>", line 619, in _exec File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/app/.heroku/python/lib/python3.10/site-packages/pkg_resources/__init__.py", line 74, in <module> from pkg_resources.extern.jaraco.text import ( ModuleNotFoundError: No module named 'pkg_resources.extern.jaraco' ``` However, the setuptools upgrade also drops support for the deprecated `2to3` feature, which may be used be a small number of legacy dependencies. For example: ``` Collecting Flask-OpenID==1.2.5 Downloading Flask-OpenID-1.2.5.tar.gz (43 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'error' error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] error in Flask-OpenID setup command: use_2to3 is invalid. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed ``` Affected apps should either: - Update to a newer version of affected dependencies. - Use a wheel rather than an sdist of those dependencies (wheels don't require the use of setuptools once created). For example by ensuring the Python version in use matches that of any published wheels (see the package's "Download files" section on pypi.org for which wheels exist), or by asking the package maintainer to upload wheels for an existing release. - Pin to the previous buildpack release (v209), using: https://devcenter.heroku.com/articles/buildpacks#buildpack-references Note: Pinning buildpack version should be used as a short-term workaround only, and after any affected dependencies are fixed, apps should switch back to the default stable-release buildpack alias of `heroku/python`. Release notes: https://pip.pypa.io/en/stable/news/#v22-0-4 https://setuptools.pypa.io/en/latest/history.html#v60-10-0 https://github.com/pypa/wheel/blob/0.37.1/docs/news.rst Commits: pypa/pip@21.3.1...22.0.4 pypa/setuptools@v57.5.0...v60.10.0 pypa/wheel@0.37.0...0.37.1 Note: The new version of pip includes new progress bars, which have had to be disabled using `--progress off` in order to reduce build log noise. GUS-W-10538676.
1 parent 43baa43 commit 8a5c73e

File tree

7 files changed

+65
-30
lines changed

7 files changed

+65
-30
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
- Fix typo in the `BUILD_WITH_GEO_LIBRARIES` end-of-life error message ([#1307](https://github.com/heroku/heroku-buildpack-python/pull/1307)).
66
- No longer set a fallback value for `$STACK`, since it is always set on Heroku ([#1308](https://github.com/heroku/heroku-buildpack-python/pull/1308)).
77
- Adjust the configure options and packaging process for Python 3.7 releases, to enable loadable extensions in the `_sqlite` module, and to remove the `idle_test` module ([#1309](https://github.com/heroku/heroku-buildpack-python/pull/1309)). This change will only take effect as of the next Python 3.7 release (3.7.14).
8+
- Update pip from 21.3.1 to 22.0.4 for Python 3.7+ ([#1310](https://github.com/heroku/heroku-buildpack-python/pull/1310))
9+
- Update setuptools from 57.5.0 to: ([#1310](https://github.com/heroku/heroku-buildpack-python/pull/1310))
10+
- 59.6.0 for Python 3.6
11+
- 60.10.0 for Python 3.7+
12+
- Update wheel from 0.37.0 to 0.37.1 for Python 2.7 and Python 3.5+ ([#1310](https://github.com/heroku/heroku-buildpack-python/pull/1310))
813

914
## v209 (2022-03-24)
1015

@@ -52,7 +57,7 @@
5257
- Update setuptools from 47.1.1 to: ([#1254](https://github.com/heroku/heroku-buildpack-python/pull/1254))
5358
- 50.3.2 for Python 3.5
5459
- 57.5.0 for Python 3.6+
55-
- Update wheel from 0.36.2 to 0.37.0 ([#1254](https://github.com/heroku/heroku-buildpack-python/pull/1254)).
60+
- Update wheel from 0.36.2 to 0.37.0 for Python 2.7 and Python 3.5+ ([#1254](https://github.com/heroku/heroku-buildpack-python/pull/1254)).
5661
- Perform editable package `.pth` and `.egg-link` path rewriting at runtime ([#1252](https://github.com/heroku/heroku-buildpack-python/pull/1252)).
5762

5863
## v200 (2021-10-04)

bin/steps/pip-install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
4141
exit 1
4242
fi
4343

44-
/app/.heroku/python/bin/pip install -r "$BUILD_DIR/requirements.txt" --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee "$WARNINGS_LOG" | cleanup | indent
44+
/app/.heroku/python/bin/pip install -r "$BUILD_DIR/requirements.txt" --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir --progress-bar off 2>&1 | tee "$WARNINGS_LOG" | cleanup | indent
4545
PIP_STATUS="${PIPESTATUS[0]}"
4646
set -e
4747

bin/steps/python

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ fi
150150

151151
set -e
152152

153-
PIP_VERSION='21.3.1'
154-
SETUPTOOLS_VERSION='57.5.0'
155-
WHEEL_VERSION='0.37.0'
153+
PIP_VERSION='22.0.4'
154+
SETUPTOOLS_VERSION='60.10.0'
155+
WHEEL_VERSION='0.37.1'
156156

157157
if [[ "${PYTHON_VERSION}" == ${PY34}* ]]; then
158158
# Python 3.4 support was dropped in pip 19.2+, setuptools 44+ and wheel 0.34+.
@@ -167,6 +167,10 @@ elif [[ "${PYTHON_VERSION}" == ${PY35}* ]]; then
167167
# Python 3.5 support was dropped in pip 21+ and setuptools 51+.
168168
PIP_VERSION='20.3.4'
169169
SETUPTOOLS_VERSION='50.3.2'
170+
elif [[ "${PYTHON_VERSION}" == ${PY36}* || "${PYTHON_VERSION}" == ${PYPY36}* ]]; then
171+
# Python 3.6 support was dropped in pip 22+ and setuptools 59.7.0+.
172+
PIP_VERSION='21.3.1'
173+
SETUPTOOLS_VERSION='59.6.0'
170174
fi
171175

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

spec/hatchet/pip_spec.rb

Lines changed: 3 additions & 3 deletions
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 21.3.1, setuptools 57.5.0 and wheel 0.37.0
25+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
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 21.3.1, setuptools 57.5.0 and wheel 0.37.0
41+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
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 21.3.1, setuptools 57.5.0 and wheel 0.37.0
64+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
6565
remote: -----> Installing SQLite3
6666
remote: -----> Installing requirements with pip
6767
remote: Collecting urllib3

spec/hatchet/pipenv_spec.rb

Lines changed: 22 additions & 9 deletions
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 21.3.1, setuptools 57.5.0 and wheel 0.37.0
14+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
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 21.3.1, setuptools 57.5.0 and wheel 0.37.0
36+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
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 21.3.1, setuptools 57.5.0 and wheel 0.37.0
56+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
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.3.4, setuptools 44.1.1 and wheel 0.37.0
79+
remote: -----> Installing pip 20.3.4, setuptools 44.1.1 and wheel 0.37.1
8080
remote: -----> Installing dependencies with Pipenv 2020.11.15
8181
remote: Installing dependencies from Pipfile.lock \\(b8efa9\\)...
8282
remote: -----> Installing SQLite3
@@ -114,7 +114,20 @@
114114
context 'with a Pipfile.lock containing python_version 3.6' do
115115
let(:app) { Hatchet::Runner.new('spec/fixtures/pipenv_python_3.6') }
116116

117-
include_examples 'builds using Pipenv with the requested Python version', LATEST_PYTHON_3_6
117+
it 'builds with the latest Python 3.6' do
118+
app.deploy do |app|
119+
expect(clean_output(app.output)).to match(Regexp.new(<<~REGEX))
120+
remote: -----> Python app detected
121+
remote: -----> Using Python version specified in Pipfile.lock
122+
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
123+
remote: -----> Installing python-#{LATEST_PYTHON_3_6}
124+
remote: -----> Installing pip 21.3.1, setuptools 59.6.0 and wheel 0.37.1
125+
remote: -----> Installing dependencies with Pipenv 2020.11.15
126+
remote: Installing dependencies from Pipfile.lock \\(.*\\)...
127+
remote: -----> Installing SQLite3
128+
REGEX
129+
end
130+
end
118131
end
119132

120133
context 'with a Pipfile.lock containing python_version 3.7' do
@@ -153,7 +166,7 @@
153166
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
154167
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
155168
remote: -----> Installing python-3.10.0
156-
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
169+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
157170
remote: -----> Installing dependencies with Pipenv 2020.11.15
158171
remote: Installing dependencies from Pipfile.lock \\(99d8c9\\)...
159172
remote: -----> Installing SQLite3
@@ -203,7 +216,7 @@
203216
remote: -----> Using Python version specified in runtime.txt
204217
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
205218
remote: -----> Installing python-#{LATEST_PYTHON_3_10}
206-
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
219+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
207220
remote: -----> Installing dependencies with Pipenv 2020.11.15
208221
remote: Installing dependencies from Pipfile.lock \\(75eae0\\)...
209222
remote: -----> Installing SQLite3
@@ -221,7 +234,7 @@
221234
remote: -----> Python app detected
222235
remote: -----> Using Python version specified in Pipfile.lock
223236
remote: -----> Installing python-#{LATEST_PYTHON_3_10}
224-
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
237+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
225238
remote: -----> Installing dependencies with Pipenv 2020.11.15
226239
remote: Installing dependencies from Pipfile.lock (2d32e8)...
227240
remote: -----> Installing SQLite3
@@ -241,7 +254,7 @@
241254
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
242255
remote: cp: cannot stat '/tmp/build_.*/requirements.txt': No such file or directory
243256
remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
244-
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
257+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
245258
remote: -----> Installing dependencies with Pipenv 2020.11.15
246259
remote: Your Pipfile.lock \\(aad8b1\\) is out of date. Expected: \\(2d32e8\\).
247260
remote: \\[DeployException\\]: .*

spec/hatchet/python_version_spec.rb

Lines changed: 20 additions & 7 deletions
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 21.3.1, setuptools 57.5.0 and wheel 0.37.0
12+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
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.3.4, setuptools 44.1.1 and wheel 0.37.0
92+
remote: -----> Installing pip 20.3.4, setuptools 44.1.1 and wheel 0.37.1
9393
remote: -----> Installing SQLite3
9494
remote: -----> Installing requirements with pip
9595
remote: Collecting urllib3
@@ -151,7 +151,7 @@
151151
remote: -----> Python app detected
152152
remote: -----> Using Python version specified in runtime.txt
153153
remote: -----> Installing python-#{LATEST_PYTHON_3_5}
154-
remote: -----> Installing pip 20.3.4, setuptools 50.3.2 and wheel 0.37.0
154+
remote: -----> Installing pip 20.3.4, setuptools 50.3.2 and wheel 0.37.1
155155
remote: -----> Installing SQLite3
156156
remote: -----> Installing requirements with pip
157157
remote: Collecting urllib3
@@ -172,7 +172,20 @@
172172
context 'when runtime.txt contains python-3.6.15' do
173173
let(:app) { Hatchet::Runner.new('spec/fixtures/python_3.6') }
174174

175-
include_examples 'builds with the requested Python version', LATEST_PYTHON_3_6
175+
it 'builds with Python 3.6.15' do
176+
app.deploy do |app|
177+
expect(clean_output(app.output)).to include(<<~OUTPUT)
178+
remote: -----> Python app detected
179+
remote: -----> Using Python version specified in runtime.txt
180+
remote: -----> Installing python-#{LATEST_PYTHON_3_6}
181+
remote: -----> Installing pip 21.3.1, setuptools 59.6.0 and wheel 0.37.1
182+
remote: -----> Installing SQLite3
183+
remote: -----> Installing requirements with pip
184+
remote: Collecting urllib3
185+
OUTPUT
186+
expect(app.run('python -V')).to include("Python #{LATEST_PYTHON_3_6}")
187+
end
188+
end
176189
end
177190

178191
context 'when runtime.txt contains python-3.7.13' do
@@ -208,7 +221,7 @@
208221
remote: -----> Python app detected
209222
remote: -----> Using Python version specified in runtime.txt
210223
remote: -----> Installing pypy2.7-#{LATEST_PYPY_2_7}
211-
remote: -----> Installing pip 20.3.4, setuptools 44.1.1 and wheel 0.37.0
224+
remote: -----> Installing pip 20.3.4, setuptools 44.1.1 and wheel 0.37.1
212225
remote: -----> Installing SQLite3
213226
remote: -----> Installing requirements with pip
214227
remote: Collecting urllib3
@@ -227,7 +240,7 @@
227240
remote: -----> Python app detected
228241
remote: -----> Using Python version specified in runtime.txt
229242
remote: -----> Installing pypy3.6-#{LATEST_PYPY_3_6}
230-
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
243+
remote: -----> Installing pip 21.3.1, setuptools 59.6.0 and wheel 0.37.1
231244
remote: -----> Installing SQLite3
232245
remote: -----> Installing requirements with pip
233246
remote: Collecting urllib3
@@ -270,7 +283,7 @@
270283
remote: -----> Python version has changed from python-#{LATEST_PYTHON_3_6} to python-#{LATEST_PYTHON_3_10}, clearing cache
271284
remote: -----> No change in requirements detected, installing from cache
272285
remote: -----> Installing python-#{LATEST_PYTHON_3_10}
273-
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
286+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
274287
remote: -----> Installing SQLite3
275288
remote: -----> Installing requirements with pip
276289
remote: Collecting urllib3

spec/hatchet/stack_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# can successfully read the stack metadata written to the build cache in the past.
1010
# The buildpack version chosen is one which had an older default Python version, so
1111
# we can also prove that clearing the cache didn't lose the Python version metadata.
12-
let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v189'] }
12+
let(:buildpacks) { ['https://github.com/heroku/heroku-buildpack-python#v208'] }
1313
let(:app) { Hatchet::Runner.new('spec/fixtures/python_version_unspecified', buildpacks: buildpacks) }
1414

1515
it 'clears the cache before installing again whilst preserving the sticky Python version' do
@@ -22,14 +22,14 @@
2222
# TODO: The requirements output shouldn't say "installing from cache", since it's not.
2323
expect(clean_output(app.output)).to include(<<~OUTPUT)
2424
remote: -----> Python app detected
25-
remote: -----> No Python version was specified. Using the same version as the last build: python-3.6.12
25+
remote: -----> No Python version was specified. Using the same version as the last build: python-3.10.3
2626
remote: To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
27-
remote: ! Python has released a security update! Please consider upgrading to python-#{LATEST_PYTHON_3_6}
27+
remote: ! Python has released a security update! Please consider upgrading to python-#{LATEST_PYTHON_3_10}
2828
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
2929
remote: -----> Stack has changed from heroku-18 to heroku-20, clearing cache
3030
remote: -----> No change in requirements detected, installing from cache
31-
remote: -----> Installing python-3.6.12
32-
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
31+
remote: -----> Installing python-3.10.3
32+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
3333
remote: -----> Installing SQLite3
3434
remote: -----> Installing requirements with pip
3535
remote: Collecting urllib3
@@ -59,7 +59,7 @@
5959
remote: -----> Stack has changed from heroku-20 to heroku-18, clearing cache
6060
remote: -----> No change in requirements detected, installing from cache
6161
remote: -----> Installing python-#{DEFAULT_PYTHON_VERSION}
62-
remote: -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
62+
remote: -----> Installing pip 22.0.4, setuptools 60.10.0 and wheel 0.37.1
6363
remote: -----> Installing SQLite3
6464
remote: -----> Installing requirements with pip
6565
remote: Collecting urllib3

0 commit comments

Comments
 (0)