File tree 1 file changed +19
-9
lines changed
packages/build/src/extensions
1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,7 @@ class PythonExtension implements BuildExtension {
58
58
context . logger . debug ( `Adding ${ this . name } to the build` ) ;
59
59
60
60
context . addLayer ( {
61
- id : "python-extension" ,
62
- build : {
63
- env : {
64
- REQUIREMENTS_CONTENT : this . options . requirements ?. join ( "\n" ) || "" ,
65
- } ,
66
- } ,
61
+ id : "python-installation" ,
67
62
image : {
68
63
instructions : splitAndCleanComments ( `
69
64
# Install Python
@@ -74,7 +69,25 @@ class PythonExtension implements BuildExtension {
74
69
# Set up Python environment
75
70
RUN python3 -m venv /opt/venv
76
71
ENV PATH="/opt/venv/bin:$PATH"
72
+ ` ) ,
73
+ } ,
74
+ deploy : {
75
+ env : {
76
+ PYTHON_BIN_PATH : `/opt/venv/bin/python` ,
77
+ } ,
78
+ override : true ,
79
+ } ,
80
+ } ) ;
77
81
82
+ context . addLayer ( {
83
+ id : "python-dependencies" ,
84
+ build : {
85
+ env : {
86
+ REQUIREMENTS_CONTENT : this . options . requirements ?. join ( "\n" ) || "" ,
87
+ } ,
88
+ } ,
89
+ image : {
90
+ instructions : splitAndCleanComments ( `
78
91
ARG REQUIREMENTS_CONTENT
79
92
RUN echo "$REQUIREMENTS_CONTENT" > requirements.txt
80
93
@@ -83,9 +96,6 @@ class PythonExtension implements BuildExtension {
83
96
` ) ,
84
97
} ,
85
98
deploy : {
86
- env : {
87
- PYTHON_BIN_PATH : `/opt/venv/bin/python` ,
88
- } ,
89
99
override : true ,
90
100
} ,
91
101
} ) ;
You can’t perform that action at this time.
0 commit comments