mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
2097eab028
Before: - if `wheel` was not already installed, then `get-pip.py` would automatically install the latest version on PyPI, which is `0.34.2` (or `0.33.6` for Python 3.4). - if `wheel` was already installed, then it was left unchanged regardless of the version installed. Now: - if `wheel` is not already installed, then the same versions will be installed as before, except these versions are pinned and will now not change unexpectedly after future `wheel` releases. - if `wheel` is already installed, then it's upgraded/downgraded to the target version as needed. Partly addresses #1000, though this change only helps builds where the pip/setuptools/wheel install flow is triggered (currently only new apps or ones where Python was purged or pip was not the correct version). Since the wheel version is now known, it's output to the build log to ease debugging and for parity with pip/setuptools. The rest of #1000 will be fixed in later commits.
Python Buildpack Install Steps
TODO: Add context on Python install steps, such as why symlinking vs copying
Installing the Pip tool
The Python Buildpack uses a tool called get-pip to install the pip tool. This
is done in the python script.
This is in part because Python historically did not come with pip by default.
Installing Python packages using Pip
Convention: Use python process to invoke Pip
We don't use this convention (yet) but this is an upcoming change being considered.
This is a bigger concern on Windows than it is in Linux environments, but an emerging convention in the Python community is to invoke pip using:
python3 -m pip [options]
Invoking pip this way ensures correct location - python knows where these packages are stored because it put them there (defaults to Python's pathing info).
All normal command line options are available using this method.