This repository was archived by the owner on Oct 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +26
-20
lines changed Expand file tree Collapse file tree 4 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 4848 run : python -m pip install --force setuptools wheel
4949
5050 - name : Install pipenv / poetry
51- run : python -m pip install pipenv==2021.11.5 poetry
51+ run : python -m pip install pipenv poetry
5252
5353 - name : Install serverless
5454 run : npm install -g serverless@${{ matrix.sls-version }}
9999 run : python -m pip install --force setuptools wheel
100100
101101 - name : Install pipenv / poetry
102- run : python -m pip install pipenv==2021.11.5 poetry
102+ run : python -m pip install pipenv poetry
103103
104104 - name : Install serverless
105105 run : npm install -g serverless@${{ matrix.sls-version }}
@@ -147,7 +147,7 @@ jobs:
147147 run : python -m pip install --force setuptools wheel
148148
149149 - name : Install pipenv / poetry
150- run : python -m pip install pipenv==2021.11.5 poetry
150+ run : python -m pip install pipenv poetry
151151
152152 - name : Install serverless
153153 run : npm install -g serverless@${{ matrix.sls-version }}
Original file line number Diff line number Diff line change 6161 run : python -m pip install --force setuptools wheel
6262
6363 - name : Install pipenv / poetry
64- run : python -m pip install pipenv==2021.11.5 poetry
64+ run : python -m pip install pipenv poetry
6565
6666 - name : Install serverless
6767 run : npm install -g serverless@${{ matrix.sls-version }}
@@ -128,7 +128,7 @@ jobs:
128128 run : python -m pip install --force setuptools wheel
129129
130130 - name : Install pipenv / poetry
131- run : python -m pip install pipenv==2021.11.5 poetry
131+ run : python -m pip install pipenv poetry
132132
133133 - name : Install serverless
134134 run : npm install -g serverless@${{ matrix.sls-version }}
@@ -181,7 +181,7 @@ jobs:
181181 run : python -m pip install --force setuptools wheel
182182
183183 - name : Install pipenv / poetry
184- run : python -m pip install pipenv==2021.11.5 poetry
184+ run : python -m pip install pipenv poetry
185185
186186 - name : Install serverless
187187 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() {
2828 }
2929
3030 try {
31- let res ;
3231 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+ } ) ;
4035 } 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' ) ) {
4545 throw new this . serverless . classes . Error (
4646 `pipenv not found! Install it according to the poetry docs.` ,
4747 'PYTHON_REQUIREMENTS_PIPENV_NOT_FOUND'
4848 ) ;
49+ } else {
50+ throw e ;
4951 }
50- throw e ;
5152 }
53+ const res = await spawn ( 'pipenv' , [ 'requirements' ] , {
54+ cwd : this . servicePath ,
55+ } ) ;
56+
5257 fse . ensureDirSync ( path . join ( this . servicePath , '.serverless' ) ) ;
5358 fse . writeFileSync (
5459 path . join ( this . servicePath , '.serverless/requirements.txt' ) ,
Original file line number Diff line number Diff line change 11[[source ]]
2- url = " https://pypi.python. org/simple"
2+ url = " https://pypi.org/simple"
33verify_ssl = true
4+ name = " pypi"
45
56[packages ]
67Flask = " ==2.0.3"
You can’t perform that action at this time.
0 commit comments