Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 5986055

Browse files
committed
Missed a bindPath failure.
Remove circle config. Skip DockerizePip tests on windows.
1 parent 91eca49 commit 5986055

File tree

6 files changed

+69
-73
lines changed

6 files changed

+69
-73
lines changed

.circleci/config.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [ubuntu-latest]
12+
node-version: [12]
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up Node ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
21+
- name: Install deps
22+
run: npm install
23+
24+
- name: Lint
25+
run: npm run ci:lint

.github/workflows/test.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ jobs:
4646
- name: Install deps
4747
run: npm install
4848

49-
- name: Lint
50-
run: npm run ci:lint
51-
# Don't run lint a hundred times, also it breaks on windows.
52-
if: matrix.python-version == 3.6 && matrix.node-version == 12 && matrix.os == 'ubuntu-latest'
53-
5449
- name: Test
5550
run: npm run test
5651
env:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Serverless Python Requirements
22

33
[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)
4-
[![CircleCI](https://circleci.com/gh/UnitedIncome/serverless-python-requirements.svg?style=shield)](https://circleci.com/gh/UnitedIncome/serverless-python-requirements)
4+
![Github Actions](https://github.com/UnitedIncome/serverless-python-requirements/workflows/Test/badge.svg)
55
[![npm](https://img.shields.io/npm/v/serverless-python-requirements.svg)](https://www.npmjs.com/package/serverless-python-requirements)
66
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
77

8-
A Serverless v1.x plugin to automatically bundle dependencies from
8+
A Serverless v5.x plugin to automatically bundle dependencies from
99
`requirements.txt` and make them available in your `PYTHONPATH`.
1010

1111
## Requires Serverless >= v1.34

lib/pip.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,8 @@ function copyVendors(vendorFolder, targetFolder, serverless) {
444444
function requirementsFileExists(servicePath, options, fileName) {
445445
if (
446446
options.usePoetry &&
447-
fse.existsSync(
448-
path.join(servicePath, 'pyproject.toml') && isPoetryProject(servicePath)
449-
)
447+
fse.existsSync(path.join(servicePath, 'pyproject.toml')) &&
448+
isPoetryProject(servicePath)
450449
) {
451450
return true;
452451
}

test.js

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,18 @@ const teardown = () => {
9191
removeSync('tests/base with a space');
9292
};
9393

94+
const testFilter = (() => {
95+
const elems = process.argv.slice(2); // skip ['node', 'test.js']
96+
if (elems.length) {
97+
return desc =>
98+
elems.some(text => desc.search(text) != -1) ? tape.test : tape.test.skip;
99+
} else {
100+
return () => tape.test;
101+
}
102+
})();
103+
94104
const test = (desc, func, opts = {}) =>
95-
tape.test(desc, opts, async t => {
105+
testFilter(desc)(desc, opts, async t => {
96106
setup();
97107
let ended = false;
98108
try {
@@ -262,7 +272,7 @@ test(
262272
t.true(zipfiles.includes(`flask${sep}__init__.py`), 'flask is packaged');
263273
t.end();
264274
},
265-
{ skip: !hasPython(3) }
275+
{ skip: !hasPython(3) || brokenOn('win32') }
266276
);
267277

268278
test(
@@ -392,7 +402,7 @@ test(
392402
t.true(zipfiles.includes(`boto3${sep}__init__.py`), 'boto3 is packaged');
393403
t.end();
394404
},
395-
{ skip: !canUseDocker() || !hasPython(3.6) }
405+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
396406
);
397407

398408
test(
@@ -415,7 +425,7 @@ test(
415425
);
416426
t.end();
417427
},
418-
{ skip: !canUseDocker() || !hasPython(3.6) }
428+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
419429
);
420430

421431
test(
@@ -440,7 +450,7 @@ test(
440450
);
441451
t.end();
442452
},
443-
{ skip: !canUseDocker() || !hasPython(3.6) }
453+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
444454
);
445455

446456
test(
@@ -473,7 +483,7 @@ test(
473483
);
474484
t.end();
475485
},
476-
{ skip: !canUseDocker() || !hasPython(3.6) }
486+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
477487
);
478488

479489
test(
@@ -506,7 +516,7 @@ test(
506516
);
507517
t.end();
508518
},
509-
{ skip: !canUseDocker() || !hasPython(3.6) }
519+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
510520
);
511521

512522
test(
@@ -927,6 +937,20 @@ test(
927937
{ skip: !hasPython(3.6) }
928938
);
929939

940+
test(
941+
'non poetry pyproject.toml without requirements.txt packages handler only',
942+
async t => {
943+
process.chdir('tests/non_poetry_pyproject');
944+
const path = npm(['pack', '../..']);
945+
npm(['i', path]);
946+
sls(['package']);
947+
const zipfiles = await listZipFiles('.serverless/sls-py-req-test.zip');
948+
t.true(zipfiles.includes(`handler.py`), 'handler is packaged');
949+
t.end();
950+
},
951+
{ skip: !hasPython(3.6) }
952+
);
953+
930954
test(
931955
'poetry py3.6 can package flask with default options',
932956
async t => {
@@ -1163,7 +1187,7 @@ test(
11631187
t.true(zipfiles.includes(`boto3${sep}__init__.py`), 'boto3 is packaged');
11641188
t.end();
11651189
},
1166-
{ skip: !canUseDocker() || !hasPython(3.6) }
1190+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
11671191
);
11681192

11691193
test(
@@ -1287,7 +1311,7 @@ test(
12871311
);
12881312
t.end();
12891313
},
1290-
{ skip: !canUseDocker() || !hasPython(3.6) }
1314+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
12911315
);
12921316

12931317
test(
@@ -1347,7 +1371,7 @@ test(
13471371
);
13481372
t.end();
13491373
},
1350-
{ skip: !canUseDocker() || !hasPython(2.7) }
1374+
{ skip: !canUseDocker() || !hasPython(2.7) || brokenOn('win32') }
13511375
);
13521376

13531377
test(
@@ -1975,7 +1999,7 @@ test(
19751999
);
19762000

19772001
test(
1978-
'py3.6 uses download cache by defaul option',
2002+
'py3.6 uses download cache by default',
19792003
async t => {
19802004
process.chdir('tests/base');
19812005
const path = npm(['pack', '../..']);
@@ -2004,7 +2028,7 @@ test(
20042028
);
20052029
t.end();
20062030
},
2007-
{ skip: !canUseDocker() || !hasPython(3.6) }
2031+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
20082032
);
20092033

20102034
test(
@@ -2024,7 +2048,7 @@ test(
20242048
);
20252049
t.end();
20262050
},
2027-
{ skip: !canUseDocker() || !hasPython(3.6) }
2051+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
20282052
);
20292053

20302054
test(
@@ -2068,7 +2092,7 @@ test(
20682092
);
20692093
t.end();
20702094
},
2071-
{ skip: !canUseDocker() || !hasPython(3.6) }
2095+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
20722096
);
20732097

20742098
test(
@@ -2173,7 +2197,7 @@ test(
21732197

21742198
t.end();
21752199
},
2176-
{ skip: !canUseDocker() || !hasPython(3.6) }
2200+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
21772201
);
21782202

21792203
test(
@@ -2199,5 +2223,5 @@ test(
21992223

22002224
t.end();
22012225
},
2202-
{ skip: !canUseDocker() || !hasPython(3.6) }
2226+
{ skip: !canUseDocker() || !hasPython(3.6) || brokenOn('win32') }
22032227
);

0 commit comments

Comments
 (0)