Skip to content

Commit

Permalink
Update pip to 23.1.2 and setuptools to 67.7.2 (#1441)
Browse files Browse the repository at this point in the history
- Updates pip from 23.0.1 to 23.1.2
- Updates setuptools from 67.6.1 to 67.7.2

See:
https://pip.pypa.io/en/stable/news/#v23-1-2
https://setuptools.pypa.io/en/stable/history.html#v67-7-2

The new pip version now outputs the origin of each requirement (eg the requirements
file path which listed it). As such, the `pip install` invocations have also been adjusted
to use a relative path to the app's requirements file, so that the log output doesn't end
up including the full tmp directory path (eg `(/tmp/build_d73c77c7/requirements.txt`),
which would make the logs more cluttered and harder to diff between builds.

GUS-W-12345615.
GUS-W-13108504.
  • Loading branch information
edmorley committed Apr 27, 2023
1 parent 69a2603 commit 54d3c85
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Updated pip from 23.0.1 to 23.1.2. ([#1441](https://github.com/heroku/heroku-buildpack-python/pull/1441))
- Updated setuptools from 67.6.1 to 67.7.2. ([#1441](https://github.com/heroku/heroku-buildpack-python/pull/1441))
- The pip bootstrap step is now performed using the pip wheel bundled with the Python stdlib, rather than one downloaded from S3. ([#1442](https://github.com/heroku/heroku-buildpack-python/pull/1442))

## v231 (2023-04-12)
Expand Down
6 changes: 3 additions & 3 deletions bin/steps/pip-install
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
exit 1
fi

/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
/app/.heroku/python/bin/pip install -r 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
PIP_STATUS="${PIPESTATUS[0]}"
set -e

Expand All @@ -44,9 +44,9 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then

# Install test dependencies, for CI.
if [ "$INSTALL_TEST" ]; then
if [[ -f "$1/requirements-test.txt" ]]; then
if [[ -f requirements-test.txt ]]; then
puts-step "Installing test dependencies…"
/app/.heroku/python/bin/pip install -r "$1/requirements-test.txt" --exists-action=w --src=./.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | cleanup | indent
/app/.heroku/python/bin/pip install -r requirements-test.txt --exists-action=w --src=./.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | cleanup | indent
fi
fi
fi
4 changes: 2 additions & 2 deletions bin/steps/python
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ else
hash -r
fi

PIP_VERSION='23.0.1'
SETUPTOOLS_VERSION='67.6.1'
PIP_VERSION='23.1.2'
SETUPTOOLS_VERSION='67.7.2'
WHEEL_VERSION='0.40.0'

puts-step "Installing pip ${PIP_VERSION}, setuptools ${SETUPTOOLS_VERSION} and wheel ${WHEEL_VERSION}"
Expand Down
8 changes: 4 additions & 4 deletions spec/hatchet/pip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
remote: -----> Installing pip #{PIP_VERSION}, setuptools #{SETUPTOOLS_VERSION} and wheel #{WHEEL_VERSION}
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting urllib3
remote: Collecting urllib3 \\(from -r requirements.txt \\(line 1\\)\\)
remote: Downloading urllib3-.*
remote: Installing collected packages: urllib3
remote: Successfully installed urllib3-.*
Expand Down Expand Up @@ -64,9 +64,9 @@
remote: -----> Installing pip #{PIP_VERSION}, setuptools #{SETUPTOOLS_VERSION} and wheel #{WHEEL_VERSION}
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting urllib3
remote: Collecting urllib3 \\(from -r requirements.txt \\(line 1\\)\\)
remote: Downloading urllib3-.*
remote: Collecting six
remote: Collecting six \\(from -r requirements.txt \\(line 2\\)\\)
remote: Downloading six-.*
remote: Installing collected packages: urllib3, six
remote: Successfully installed six-.* urllib3-.*
Expand Down Expand Up @@ -248,7 +248,7 @@
app.deploy do |app|
expect(clean_output(app.output)).to include(<<~OUTPUT)
remote: -----> Installing requirements with pip
remote: Collecting urllib3
remote: Collecting urllib3 (from -r requirements.txt (line 1))
OUTPUT
expect(app.output).not_to include('Running setup.py develop')
end
Expand Down
6 changes: 3 additions & 3 deletions spec/hatchet/python_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
remote: -----> Installing pip #{PIP_VERSION}, setuptools #{SETUPTOOLS_VERSION} and wheel #{WHEEL_VERSION}
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting urllib3
remote: Collecting urllib3 (from -r requirements.txt (line 1))
OUTPUT
expect(app.run('python -V')).to include("Python #{python_version}")
end
Expand Down Expand Up @@ -230,7 +230,7 @@
remote: -----> Installing pip #{PIP_VERSION}, setuptools #{SETUPTOOLS_VERSION} and wheel #{WHEEL_VERSION}
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting urllib3
remote: Collecting urllib3 (from -r requirements.txt (line 1))
OUTPUT
expect(app.run('python -V')).to include("Python #{LATEST_PYTHON_3_7}")
end
Expand Down Expand Up @@ -342,7 +342,7 @@
remote: -----> Installing pip #{PIP_VERSION}, setuptools #{SETUPTOOLS_VERSION} and wheel #{WHEEL_VERSION}
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting urllib3
remote: Collecting urllib3 (from -r requirements.txt (line 1))
OUTPUT
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/hatchet/stack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
remote: -----> Installing pip #{PIP_VERSION}, setuptools #{SETUPTOOLS_VERSION} and wheel #{WHEEL_VERSION}
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting urllib3
remote: Collecting urllib3 (from -r requirements.txt (line 1))
OUTPUT
end
end
Expand Down Expand Up @@ -66,7 +66,7 @@
remote: -----> Installing pip #{PIP_VERSION}, setuptools #{SETUPTOOLS_VERSION} and wheel #{WHEEL_VERSION}
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting urllib3
remote: Collecting urllib3 (from -r requirements.txt (line 1))
OUTPUT
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
LATEST_PYTHON_3_11 = '3.11.3'
DEFAULT_PYTHON_VERSION = LATEST_PYTHON_3_11

PIP_VERSION = '23.0.1'
SETUPTOOLS_VERSION = '67.6.1'
PIP_VERSION = '23.1.2'
SETUPTOOLS_VERSION = '67.7.2'
WHEEL_VERSION = '0.40.0'

# Work around the return value for `default_buildpack` changing after deploy:
Expand Down

0 comments on commit 54d3c85

Please sign in to comment.