Skip to content

Commit a4bdbbb

Browse files
authored
Merge branch 'master' into master
2 parents 6f1a884 + 91f36fb commit a4bdbbb

File tree

7 files changed

+24
-42
lines changed

7 files changed

+24
-42
lines changed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,8 @@ custom:
9595

9696

9797
## Poetry support :sparkles::pencil::sparkles:
98-
NOTE: Only poetry version 1 supports the required `export` command for this
99-
feature. As of the point this feature was added, poetry 1.0.0 was in preview
100-
and requires that poetry is installed with the --preview flag.
101-
102-
TL;DR Install poetry with the `--preview` flag.
103-
10498
If you include a `pyproject.toml` and have `poetry` installed instead of a `requirements.txt` this will use
105-
`poetry export --without-hashes -f requirements.txt` to generate them. It is fully compatible with all options such as `zip` and
99+
`poetry export --without-hashes -f requirements.txt -o requirements.txt` to generate them. It is fully compatible with all options such as `zip` and
106100
`dockerizePip`. If you don't want this plugin to generate it for you, set the following option:
107101
```yaml
108102
custom:

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: '{build}'
22
init:
3-
- cmd: python -m pip install -U pip
4-
- cmd: pip install pipenv
5-
- cmd: pip install poetry==1.0.0a2
6-
- ps: npm i -g serverless
3+
- cmd: python3 -m pip install -U pip
4+
- cmd: pip3 install pipenv
5+
- cmd: pip3 install poetry
6+
- cmd: npm i -g serverless
77
build: off
88
test_script:
99
- cmd: >-

circle.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ jobs:
3333
python get-poetry.py --preview --yes
3434
rm get-poetry.py
3535
# install nodejs
36-
- run: curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - && sudo apt -y install nodejs
36+
- run: curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - && sudo apt -y install nodejs
3737
# install serverless & depcheck
38-
- run: npm install -g serverless depcheck
38+
- run: npm install -g serverless
3939
# install deps
4040
- run: npm i
41-
# depcheck
42-
- run: depcheck .
4341
# lint:
4442
- run: npm run lint
4543
# test!

lib/pip.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,18 @@ function installRequirements(targetFolder, serverless, options) {
119119
);
120120

121121
const dockerCmd = [];
122-
const pipCmd = [
123-
options.pythonBin,
124-
'-m',
125-
'pip',
126-
'install'
127-
];
128-
129-
if (Array.isArray(options.pipCmdExtraArgs) && options.pipCmdExtraArgs.length > 0) {
122+
const pipCmd = [options.pythonBin, '-m', 'pip', 'install'];
123+
124+
if (
125+
Array.isArray(options.pipCmdExtraArgs) &&
126+
options.pipCmdExtraArgs.length > 0
127+
) {
130128
options.pipCmdExtraArgs.forEach(cmd => {
131129
const parts = cmd.split(/\s+/, 2);
132130
pipCmd.push(...parts);
133131
});
134132
}
135-
133+
136134
const pipCmds = [pipCmd];
137135
const postCmds = [];
138136
// Check if we're using the legacy --cache-dir command...

lib/poetry.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ function pyprojectTomlToRequirements() {
1616

1717
const res = spawnSync(
1818
'poetry',
19-
['export', '--without-hashes', '-f', 'requirements.txt'],
19+
[
20+
'export',
21+
'--without-hashes',
22+
'-f',
23+
'requirements.txt',
24+
'-o',
25+
'requirements.txt'
26+
],
2027
{
2128
cwd: this.servicePath
2229
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "serverless-python-requirements",
33
"version": "5.0.1",
44
"engines": {
5-
"node": ">=6.0"
5+
"node": ">=10.0"
66
},
77
"description": "Serverless Python Requirements Plugin",
88
"author": "United Income <[email protected]>",
@@ -61,7 +61,7 @@
6161
"lodash.set": "^4.3.2",
6262
"lodash.uniqby": "^4.0.0",
6363
"lodash.values": "^4.3.0",
64-
"rimraf": "^2.6.2",
64+
"rimraf": "^3.0.2",
6565
"sha256-file": "1.0.0",
6666
"shell-quote": "^1.6.1"
6767
},

test.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const sls = mkCommand('sls');
5252
const git = mkCommand('git');
5353
const npm = mkCommand('npm');
5454
const perl = mkCommand('perl');
55-
const poetry = mkCommand('poetry');
5655

5756
const setup = () => {
5857
removeSync(getUserCachePath());
@@ -1910,17 +1909,3 @@ test(
19101909
},
19111910
{ skip: !canUseDocker() }
19121911
);
1913-
1914-
// From this point on, the version of the poetry is 1.0.0a0
1915-
test('poetry1.0.0a0 py3.6 can package flask with default options', t => {
1916-
process.chdir('tests/poetry');
1917-
const path = npm(['pack', '../..']);
1918-
npm(['i', path]);
1919-
poetry(['self', 'update', '--preview', '1.0.0a0']);
1920-
sls(['package']);
1921-
const zipfiles = listZipFiles('.serverless/sls-py-req-test.zip');
1922-
t.true(zipfiles.includes(`flask${sep}__init__.py`), 'flask is packaged');
1923-
t.true(zipfiles.includes(`bottle.py`), 'bottle is packaged');
1924-
t.true(zipfiles.includes(`boto3${sep}__init__.py`), 'boto3 is packaged');
1925-
t.end();
1926-
});

0 commit comments

Comments
 (0)