File tree 4 files changed +26
-20
lines changed
4 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 48
48
run : python -m pip install --force setuptools wheel
49
49
50
50
- name : Install pipenv / poetry
51
- run : python -m pip install pipenv==2021.11.5 poetry
51
+ run : python -m pip install pipenv poetry
52
52
53
53
- name : Install serverless
54
54
run : npm install -g serverless@${{ matrix.sls-version }}
99
99
run : python -m pip install --force setuptools wheel
100
100
101
101
- name : Install pipenv / poetry
102
- run : python -m pip install pipenv==2021.11.5 poetry
102
+ run : python -m pip install pipenv poetry
103
103
104
104
- name : Install serverless
105
105
run : npm install -g serverless@${{ matrix.sls-version }}
@@ -147,7 +147,7 @@ jobs:
147
147
run : python -m pip install --force setuptools wheel
148
148
149
149
- name : Install pipenv / poetry
150
- run : python -m pip install pipenv==2021.11.5 poetry
150
+ run : python -m pip install pipenv poetry
151
151
152
152
- name : Install serverless
153
153
run : npm install -g serverless@${{ matrix.sls-version }}
Original file line number Diff line number Diff line change 61
61
run : python -m pip install --force setuptools wheel
62
62
63
63
- name : Install pipenv / poetry
64
- run : python -m pip install pipenv==2021.11.5 poetry
64
+ run : python -m pip install pipenv poetry
65
65
66
66
- name : Install serverless
67
67
run : npm install -g serverless@${{ matrix.sls-version }}
@@ -128,7 +128,7 @@ jobs:
128
128
run : python -m pip install --force setuptools wheel
129
129
130
130
- name : Install pipenv / poetry
131
- run : python -m pip install pipenv==2021.11.5 poetry
131
+ run : python -m pip install pipenv poetry
132
132
133
133
- name : Install serverless
134
134
run : npm install -g serverless@${{ matrix.sls-version }}
@@ -181,7 +181,7 @@ jobs:
181
181
run : python -m pip install --force setuptools wheel
182
182
183
183
- name : Install pipenv / poetry
184
- run : python -m pip install pipenv==2021.11.5 poetry
184
+ run : python -m pip install pipenv poetry
185
185
186
186
- name : Install serverless
187
187
run : npm install -g serverless@${{ matrix.sls-version }}
Original file line number Diff line number Diff line change @@ -28,27 +28,32 @@ async function pipfileToRequirements() {
28
28
}
29
29
30
30
try {
31
- let res ;
32
31
try {
33
- res = await spawn (
34
- 'pipenv' ,
35
- [ 'lock' , '--requirements' , '--keep-outdated' ] ,
36
- {
37
- cwd : this . servicePath ,
38
- }
39
- ) ;
32
+ await spawn ( 'pipenv' , [ 'lock' , '--keep-outdated' ] , {
33
+ cwd : this . servicePath ,
34
+ } ) ;
40
35
} catch ( e ) {
41
- if (
42
- e . stderrBuffer &&
43
- e . stderrBuffer . toString ( ) . includes ( 'command not found' )
44
- ) {
36
+ const stderrBufferContent =
37
+ ( e . stderrBuffer && e . stderrBuffer . toString ( ) ) || '' ;
38
+
39
+ if ( stderrBufferContent . includes ( 'must exist to use' ) ) {
40
+ // No previous Pipfile.lock, we will try to generate it here
41
+ await spawn ( 'pipenv' , [ 'lock' ] , {
42
+ cwd : this . servicePath ,
43
+ } ) ;
44
+ } else if ( stderrBufferContent . includes ( 'command not found' ) ) {
45
45
throw new this . serverless . classes . Error (
46
46
`pipenv not found! Install it according to the poetry docs.` ,
47
47
'PYTHON_REQUIREMENTS_PIPENV_NOT_FOUND'
48
48
) ;
49
+ } else {
50
+ throw e ;
49
51
}
50
- throw e ;
51
52
}
53
+ const res = await spawn ( 'pipenv' , [ 'requirements' ] , {
54
+ cwd : this . servicePath ,
55
+ } ) ;
56
+
52
57
fse . ensureDirSync ( path . join ( this . servicePath , '.serverless' ) ) ;
53
58
fse . writeFileSync (
54
59
path . join ( this . servicePath , '.serverless/requirements.txt' ) ,
Original file line number Diff line number Diff line change 1
1
[[source ]]
2
- url = " https://pypi.python. org/simple"
2
+ url = " https://pypi.org/simple"
3
3
verify_ssl = true
4
+ name = " pypi"
4
5
5
6
[packages ]
6
7
Flask = " ==2.0.3"
You can’t perform that action at this time.
0 commit comments