Skip to content

chore(ci): get CI working again #462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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: >-
Expand Down
6 changes: 2 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
16 changes: 7 additions & 9 deletions lib/pip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down
9 changes: 8 additions & 1 deletion lib/poetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
Expand Down
15 changes: 0 additions & 15 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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();
});