File tree 3 files changed +64
-4
lines changed
3 files changed +64
-4
lines changed Original file line number Diff line number Diff line change 13
13
steps :
14
14
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15
15
- name : Build a binary wheel and a source tarball
16
- run : |
17
- python3 -m venv build-env
18
- build-env/bin/python -m pip install --no-deps --only-binary :all: --require-hashes -r build-requirements.txt
19
- build-env/bin/python -m build --no-isolation
16
+ run : ./build-project.py
20
17
- name : Store the distribution packages
21
18
uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
22
19
with :
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ include pyproject.toml
7
7
8
8
include build-requirements.in
9
9
include build-requirements.txt
10
+ include build-project.py
10
11
11
12
include src/pip/_vendor/README.rst
12
13
include src/pip/_vendor/vendor.txt
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ """Build pip using pinned build requirements."""
3
+
4
+ import subprocess
5
+ import sys
6
+ import tempfile
7
+ from pathlib import Path
8
+
9
+
10
+ def get_git_head_timestamp () -> str :
11
+ return subprocess .run (
12
+ [
13
+ "git" ,
14
+ "log" ,
15
+ "-1" ,
16
+ "--pretty=format:%ct" ,
17
+ ],
18
+ text = True ,
19
+ stdout = subprocess .PIPE ,
20
+ ).stdout .strip ()
21
+
22
+
23
+ def main () -> None :
24
+ with tempfile .TemporaryDirectory () as build_env :
25
+ subprocess .run (
26
+ [
27
+ sys .executable ,
28
+ "-m" ,
29
+ "venv" ,
30
+ build_env ,
31
+ ],
32
+ check = True ,
33
+ )
34
+ build_python = Path (build_env ) / "bin" / "python"
35
+ subprocess .run (
36
+ [
37
+ build_python ,
38
+ "-Im" ,
39
+ "pip" ,
40
+ "install" ,
41
+ "--no-deps" ,
42
+ "--only-binary=:all:" ,
43
+ "--require-hashes" ,
44
+ "-r" ,
45
+ Path (__file__ ).parent / "build-requirements.txt" ,
46
+ ],
47
+ check = True ,
48
+ )
49
+ subprocess .run (
50
+ [
51
+ build_python ,
52
+ "-Im" ,
53
+ "build" ,
54
+ "--no-isolation" ,
55
+ ],
56
+ check = True ,
57
+ env = {"SOURCE_DATE_EPOCH" : get_git_head_timestamp ()},
58
+ )
59
+
60
+
61
+ if __name__ == "__main__" :
62
+ main ()
You can’t perform that action at this time.
0 commit comments