Skip to content

Commit 0ae2aab

Browse files
Arjun Sreedharanrobdimsdale
authored andcommitted
vendored apps w sdist: install common build deps in staging
sdist packages have 2 kinds of dependencies: build-time deps and runtime-deps. Before PEP-517, there was no standard to specify a package's build-time deps, but with PEP-517, a package defines its build-time deps in its pyproject.toml. In an online install, pip reads it and downloads build-time deps and builds the sdist. In a vendored (offline) install, this is not possible because "pip download" is not smart enough to download build-time deps during vendoring (github.com/pypa/pip/issues/8302). Before pip 23.1, when build-time deps were missing, pip fell back to using the legacy 'setup.py install' method. pip 23.1 removed this fallback and started enforcing PEP 517 (https://discuss.python.org/t/announcement-pip-23-1-release/25844). Therefore, for vendored apps with sdists, we install the 2 most common build-time dependencies - wheel and setuptools. These are packaged by the dependency pipeline within the "pip" dependency.
1 parent eeb2440 commit 0ae2aab

22 files changed

+128
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: python3 -m http.server 8080
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Vendored sdist app pre-PEP517
2+
3+
This is a vendored app that installs sdist of a package (oss2) that does not
4+
follow PEP-517.
5+
6+
`pip download` (i.e. vendoring) only downloads the run-time dependencies to the
7+
output directory, and not build-time dependencies.
8+
9+
Before PEP-517, the python ecosystem did not have a standard to specify
10+
build-time dependencies of packages. This app installs such a package.
11+
12+
oss2 is only officially supported until python 3.8. See https://pypi.org/project/oss2
13+
14+
Vendoring for this app is done with the following command on a bionic env:
15+
16+
```
17+
apt-get install -y python3.8 && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && pip install pip==24.0 && pip download --no-binary=:none: -d vendor -r requirements.txt'
18+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
oss2
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.8.x
Binary file not shown.
Binary file not shown.
Binary file not shown.
87.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)