Skip to content

Commit d162be3

Browse files
jdufresnedschep
authored andcommitted
Trim trailing white space throughout the project (#289)
Many editors clean up trailing white space on save. By removing it all in one go, it helps keep future diffs cleaner by avoiding spurious white space changes on unrelated lines.
1 parent 1479829 commit d162be3

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This will automatically add the plugin to your project's `package.json` and the
2121
`serverless.yml`. That's all that's needed for basic use! The plugin will now bundle your python
2222
dependencies specified in your `requirements.txt` or `Pipfile` when you run `sls deploy`.
2323

24-
For a more in depth introduction on how to user this plugin, check out
24+
For a more in depth introduction on how to user this plugin, check out
2525
[this post on the Serverless Blog](https://serverless.com/blog/serverless-python-packaging/)
2626

2727
If you're on a mac, check out [these notes](#applebeersnake-mac-brew-installed-python-notes) about using python installed by brew.
@@ -113,17 +113,17 @@ except ImportError:
113113
pass
114114
```
115115
### Slim Package
116-
_Works on non 'win32' environments: Docker, WSL are included_
117-
To remove the tests, information and caches from the installed packages,
118-
enable the `slim` option. This will: `strip` the `.so` files, remove `__pycache__`
119-
and `dist-info` directories as well as `.pyc` and `.pyo` files.
116+
_Works on non 'win32' environments: Docker, WSL are included_
117+
To remove the tests, information and caches from the installed packages,
118+
enable the `slim` option. This will: `strip` the `.so` files, remove `__pycache__`
119+
and `dist-info` directories as well as `.pyc` and `.pyo` files.
120120
```yaml
121121
custom:
122122
pythonRequirements:
123123
slim: true
124-
```
125-
#### Custom Removal Patterns
126-
To specify additional directories to remove from the installed packages,
124+
```
125+
#### Custom Removal Patterns
126+
To specify additional directories to remove from the installed packages,
127127
define a list of patterns in the serverless config using the `slimPatterns`
128128
option and glob syntax. These paterns will be added to the default ones (`**/*.py[c|o]`, `**/__pycache__*`, `**/*.dist-info*`).
129129
Note, the glob syntax matches against whole paths, so to match a file in any
@@ -134,7 +134,7 @@ custom:
134134
slim: true
135135
slimPatterns:
136136
- "**/*.egg-info*"
137-
```
137+
```
138138
To overwrite the default patterns set the option `slimPatternsAppendDefaults` to `false` (`true` by default).
139139
```yaml
140140
custom:
@@ -143,10 +143,10 @@ custom:
143143
slimPatternsAppendDefaults: false
144144
slimPatterns:
145145
- "**/*.egg-info*"
146-
```
147-
This will remove all folders within the installed requirements that match
148-
the names in `slimPatterns`
149-
## Omitting Packages
146+
```
147+
This will remove all folders within the installed requirements that match
148+
the names in `slimPatterns`
149+
## Omitting Packages
150150
You can omit a package from deployment with the `noDeploy` option. Note that
151151
dependencies of omitted packages must explicitly be omitted too. By default,
152152
the following packages are omitted as they are already installed on Lambda:
@@ -199,7 +199,7 @@ custom:
199199
useDownloadCache: true
200200
cacheLocation: '/home/user/.my_cache_goes_here'
201201
staticCacheMaxVersions: 10
202-
202+
203203
```
204204

205205
### Extra pip arguments

test.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ setup() {
88
export LANG=C.UTF-8
99
fi
1010
export USR_CACHE_DIR=`node -e 'console.log(require("./lib/shared").getUserCachePath())'`
11-
# Please note: If you update change the requirements.txt in test/base this value will
11+
# Please note: If you update change the requirements.txt in test/base this value will
1212
# change. Run a test which uses this variable manually step by step and list the cache
1313
# folder to find the new hash if you do this
1414
if [ -d "${USR_CACHE_DIR}" ] ; then
@@ -71,7 +71,7 @@ teardown() {
7171
unzip .serverless/sls-py-req-test.zip -d puck
7272
ls puck/flask
7373
test $(find puck -name "*.pyc" | wc -l) -eq 0
74-
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
74+
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
7575
}
7676

7777
@test "py3.6 doesn't package boto3 by default" {
@@ -143,7 +143,7 @@ teardown() {
143143
unzip .serverless/sls-py-req-test.zip -d puck
144144
ls puck/flask
145145
test $(find puck -name "*.pyc" | wc -l) -eq 0
146-
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
146+
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
147147
}
148148

149149
@test "py3.6 uses download cache with useDownloadCache option" {
@@ -279,7 +279,7 @@ teardown() {
279279
@test "py2.7 can package flask with slim option" {
280280
cd tests/base
281281
npm i $(npm pack ../..)
282-
sls --runtime=python2.7 --slim=true package
282+
sls --runtime=python2.7 --slim=true package
283283
unzip .serverless/sls-py-req-test.zip -d puck
284284
ls puck/flask
285285
test $(find puck -name "*.pyc" | wc -l) -eq 0
@@ -301,7 +301,7 @@ teardown() {
301301
unzip .serverless/sls-py-req-test.zip -d puck
302302
ls puck/flask
303303
test $(find puck -name "*.pyc" | wc -l) -eq 0
304-
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
304+
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
305305
}
306306

307307
@test "py2.7 doesn't package boto3 by default" {
@@ -372,7 +372,7 @@ teardown() {
372372
unzip .serverless/sls-py-req-test.zip -d puck
373373
ls puck/flask
374374
test $(find puck -name "*.pyc" | wc -l) -eq 0
375-
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
375+
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
376376
}
377377

378378
@test "pipenv py3.6 can package flask with default options" {
@@ -400,7 +400,7 @@ teardown() {
400400
unzip .serverless/sls-py-req-test.zip -d puck
401401
ls puck/flask
402402
test $(find puck -name "*.pyc" | wc -l) -eq 0
403-
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
403+
test $(find puck -type d -name "*.egg-info*" | wc -l) -eq 0
404404
}
405405

406406
@test "pipenv py3.6 can package flask with zip option" {

0 commit comments

Comments
 (0)