Skip to content

Commit 1d364bf

Browse files
nadobandoheitorlessamichaelbrewer
authored
merge (#4)
* chore: typo in parser docs Signed-off-by: heitorlessa <lessa@amazon.co.uk> * docs(appconfig): Use correct import for docstring (aws-powertools#271) * docs(appconfig): Use correct import for docstring * docs: Rename variable back * chore: fix immer and socket.io CVEs (aws-powertools#278) * fix: upgrade amplify to fix immer CVE * fix: forcefully upgrade socket.io as gatsby can't be upgraded * fix: remove unnecessary typing-extensions for py3.8 (#3) Co-authored-by: heitorlessa <lessa@amazon.co.uk> Co-authored-by: Michael Brewer <michael.brewer@gyft.com>
1 parent dd73ff2 commit 1d364bf

File tree

12 files changed

+909
-1889
lines changed

12 files changed

+909
-1889
lines changed

aws_lambda_powertools/utilities/parameters/appconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AppConfigProvider(BaseProvider):
3232
-------
3333
**Retrieves the latest configuration value from App Config**
3434
35-
>>> from aws_lambda_powertools.utilities.parameters import AppConfigProvider
35+
>>> from aws_lambda_powertools.utilities import parameters
3636
>>> appconf_provider = parameters.AppConfigProvider(environment="my_env", application="my_app")
3737
>>>
3838
>>> value : bytes = appconf_provider.get("my_conf")
@@ -43,7 +43,7 @@ class AppConfigProvider(BaseProvider):
4343
**Retrieves a configuration value from App Config in another AWS region**
4444
4545
>>> from botocore.config import Config
46-
>>> from aws_lambda_powertools.utilities.parameters import AppConfigProvider
46+
>>> from aws_lambda_powertools.utilities import parameters
4747
>>>
4848
>>> config = Config(region_name="us-west-1")
4949
>>> appconf_provider = parameters.AppConfigProvider(environment="my_env", application="my_app", config=config)

aws_lambda_powertools/utilities/parser/models/dynamodb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from typing import Any, Dict, List, Optional
33

44
from pydantic import BaseModel
5-
from typing_extensions import Literal
5+
6+
from ..types import Literal
67

78

89
class DynamoDBStreamChangedRecordModel(BaseModel):

aws_lambda_powertools/utilities/parser/models/kinesis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
from pydantic import BaseModel, validator
77
from pydantic.types import PositiveInt
8-
from typing_extensions import Literal
8+
9+
from ..types import Literal
910

1011
logger = logging.getLogger(__name__)
1112

aws_lambda_powertools/utilities/parser/models/s3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from pydantic.fields import Field
66
from pydantic.networks import IPvAnyNetwork
77
from pydantic.types import PositiveInt
8-
from typing_extensions import Literal
8+
9+
from ..types import Literal
910

1011

1112
class S3EventRecordGlacierRestoreEventData(BaseModel):

aws_lambda_powertools/utilities/parser/models/ses.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
from pydantic import BaseModel, Field
55
from pydantic.networks import EmailStr
66
from pydantic.types import PositiveInt
7-
from typing_extensions import Literal
7+
8+
from ..types import Literal
89

910

1011
class SesReceiptVerdict(BaseModel):

aws_lambda_powertools/utilities/parser/models/sns.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
from pydantic import BaseModel, root_validator
55
from pydantic.networks import HttpUrl
6-
from typing_extensions import Literal
6+
7+
from ..types import Literal
78

89

910
class SnsMsgAttributeModel(BaseModel):

aws_lambda_powertools/utilities/parser/models/sqs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from typing import Dict, List, Optional
33

44
from pydantic import BaseModel
5-
from typing_extensions import Literal
5+
6+
from ..types import Literal
67

78

89
class SqsAttributesModel(BaseModel):
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
"""Generics and other shared types used across parser"""
2+
import sys
23
from typing import TypeVar
34

45
from pydantic import BaseModel
56

7+
# Workaround for not importing typing_extensions on python ^3.8
8+
if sys.version_info[0] > 3 or (sys.version_info[0] == 3 and sys.version_info[1] >= 8):
9+
from typing import Literal # noqa: F401
10+
else:
11+
try:
12+
from typing_extensions import Literal # noqa: F401
13+
except ImportError:
14+
raise Exception("please install typing-extensions or upgrade to Python >= 3.8")
15+
616
Model = TypeVar("Model", bound=BaseModel)

docs/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"build": "gatsby build --prefix-paths"
55
},
66
"dependencies": {
7-
"@aws-amplify/analytics": "^3.3.6",
7+
"@aws-amplify/analytics": "^4.0.6",
88
"antd": "^4.7.0",
9-
"aws-amplify": "^3.3.3",
10-
"gatsby": "^2.24.77",
9+
"aws-amplify": "^3.3.15",
10+
"gatsby": "^2.4.0",
1111
"gatsby-plugin-antd": "^2.2.0",
1212
"gatsby-plugin-catch-links": "^2.3.15",
1313
"gatsby-plugin-sitemap": "^2.4.16",
@@ -21,7 +21,8 @@
2121
"bl": "^4.0.3",
2222
"semver": "^7.3.2",
2323
"node-fetch": "^2.6.1",
24-
"axios": "^0.21.1"
24+
"axios": "^0.21.1",
25+
"socket.io": "^2.4.0"
2526
},
2627
"keywords": [],
2728
"license": "MIT-0",

0 commit comments

Comments
 (0)