diff --git a/appveyor.yml b/appveyor.yml index 43b0e373..920d78a3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,9 @@ version: '{build}' init: - - cmd: python -m pip install -U pip - - cmd: pip install pipenv - - cmd: pip install poetry==1.0.0a2 - - ps: npm i -g serverless + - cmd: python3 -m pip install -U pip + - cmd: pip3 install pipenv + - cmd: pip3 install poetry + - cmd: npm i -g serverless build: off test_script: - cmd: >- diff --git a/circle.yml b/circle.yml index 3957bc4f..ef3ec251 100644 --- a/circle.yml +++ b/circle.yml @@ -33,13 +33,11 @@ jobs: python get-poetry.py --preview --yes rm get-poetry.py # install nodejs - - run: curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - && sudo apt -y install nodejs + - run: curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - && sudo apt -y install nodejs # install serverless & depcheck - - run: npm install -g serverless depcheck + - run: npm install -g serverless # install deps - run: npm i - # depcheck - - run: depcheck . # lint: - run: npm run lint # test! diff --git a/lib/pip.js b/lib/pip.js index 05fa9392..14864794 100644 --- a/lib/pip.js +++ b/lib/pip.js @@ -119,20 +119,18 @@ function installRequirements(targetFolder, serverless, options) { ); const dockerCmd = []; - const pipCmd = [ - options.pythonBin, - '-m', - 'pip', - 'install' - ]; - - if (Array.isArray(options.pipCmdExtraArgs) && options.pipCmdExtraArgs.length > 0) { + const pipCmd = [options.pythonBin, '-m', 'pip', 'install']; + + if ( + Array.isArray(options.pipCmdExtraArgs) && + options.pipCmdExtraArgs.length > 0 + ) { options.pipCmdExtraArgs.forEach(cmd => { const parts = cmd.split(/\s+/, 2); pipCmd.push(...parts); }); } - + const pipCmds = [pipCmd]; const postCmds = []; // Check if we're using the legacy --cache-dir command... diff --git a/lib/poetry.js b/lib/poetry.js index 2fa21440..7f041c83 100644 --- a/lib/poetry.js +++ b/lib/poetry.js @@ -16,7 +16,14 @@ function pyprojectTomlToRequirements() { const res = spawnSync( 'poetry', - ['export', '--without-hashes', '-f', 'requirements.txt', '-o', 'requirements.txt'], + [ + 'export', + '--without-hashes', + '-f', + 'requirements.txt', + '-o', + 'requirements.txt' + ], { cwd: this.servicePath } diff --git a/package.json b/package.json index a767eb34..60cd1ea2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "serverless-python-requirements", "version": "5.0.1", "engines": { - "node": ">=6.0" + "node": ">=10.0" }, "description": "Serverless Python Requirements Plugin", "author": "United Income ", diff --git a/test.js b/test.js index 5ba46f2c..987c862c 100644 --- a/test.js +++ b/test.js @@ -52,7 +52,6 @@ const sls = mkCommand('sls'); const git = mkCommand('git'); const npm = mkCommand('npm'); const perl = mkCommand('perl'); -const poetry = mkCommand('poetry'); const setup = () => { removeSync(getUserCachePath()); @@ -1910,17 +1909,3 @@ test( }, { skip: !canUseDocker() } ); - -// From this point on, the version of the poetry is 1.0.0a0 -test('poetry1.0.0a0 py3.6 can package flask with default options', t => { - process.chdir('tests/poetry'); - const path = npm(['pack', '../..']); - npm(['i', path]); - poetry(['self', 'update', '--preview', '1.0.0a0']); - sls(['package']); - const zipfiles = listZipFiles('.serverless/sls-py-req-test.zip'); - t.true(zipfiles.includes(`flask${sep}__init__.py`), 'flask is packaged'); - t.true(zipfiles.includes(`bottle.py`), 'bottle is packaged'); - t.true(zipfiles.includes(`boto3${sep}__init__.py`), 'boto3 is packaged'); - t.end(); -});