forked from serverless/serverless-python-requirements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for specifying custom dependency groups in Poetry
- Loading branch information
Showing
10 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
empty: [] | ||
poetryWithGroups: | ||
- custom1 | ||
- custom2 | ||
poetryWithoutGroups: | ||
- custom1 | ||
poetryOnlyGroups: | ||
- custom2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
slimPatterns: | ||
- '**/__main__.py' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import requests | ||
|
||
|
||
def hello(event, context): | ||
return requests.get('https://httpbin.org/get').json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "example", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"serverless-python-requirements": "file:serverless-python-requirements-6.0.0.tgz" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[tool.poetry] | ||
name = "poetry" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Your Name <[email protected]>"] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.6" | ||
Flask = "^1.0" | ||
|
||
[tool.poetry.group.custom1.dependencies] | ||
bottle = {git = "https://[email protected]/bottlepy/bottle.git", tag = "0.12.16"} | ||
|
||
[tool.poetry.group.custom2.dependencies] | ||
boto3 = "^1.9" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
service: sls-py-req-test | ||
|
||
provider: | ||
name: aws | ||
runtime: python3.7 | ||
|
||
plugins: | ||
- serverless-python-requirements | ||
custom: | ||
pythonRequirements: | ||
zip: ${env:zip, self:custom.defaults.zip} | ||
slim: ${env:slim, self:custom.defaults.slim} | ||
slimPatterns: ${file(./slimPatterns.yml):slimPatterns, self:custom.defaults.slimPatterns} | ||
slimPatternsAppendDefaults: ${env:slimPatternsAppendDefaults, self:custom.defaults.slimPatternsAppendDefaults} | ||
dockerizePip: ${env:dockerizePip, self:custom.defaults.dockerizePip} | ||
requirePoetryLockFile: ${env:requirePoetryLockFile, false} | ||
poetryWithGroups: ${file(./_poetryGroups.yml):${env:poetryWithGroups, "empty"}} | ||
poetryWithoutGroups: ${file(./_poetryGroups.yml):${env:poetryWithoutGroups, "empty"}} | ||
poetryOnlyGroups: ${file(./_poetryGroups.yml):${env:poetryOnlyGroups, "empty"}} | ||
defaults: | ||
zip: false | ||
slimPatterns: false | ||
slimPatternsAppendDefaults: true | ||
slim: false | ||
dockerizePip: false | ||
|
||
package: | ||
patterns: | ||
- '!**/*' | ||
- 'handler.py' | ||
|
||
functions: | ||
hello: | ||
handler: handler.hello |