aws-lambda-env-modeler 1.0.3__tar.gz → 1.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: aws-lambda-env-modeler
3
- Version: 1.0.3
2
+ Name: aws_lambda_env_modeler
3
+ Version: 1.0.6
4
4
  Summary: AWS-Lambda-Env-Modeler is a Python library designed to simplify the process of managing and validating environment variables in your AWS Lambda functions.
5
5
  Home-page: https://github.com/ran-isenberg/aws-lambda-env-modeler
6
6
  License: MIT-0
@@ -9,13 +9,14 @@ Author: Ran Isenberg
9
9
  Requires-Python: >=3.8.17,<4.0.0
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved
12
13
  Classifier: License :: OSI Approved :: MIT License
13
- Classifier: License :: Other/Proprietary License
14
14
  Classifier: Natural Language :: English
15
15
  Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
19
20
  Classifier: Programming Language :: Python :: 3.8
20
21
  Requires-Dist: pydantic (>=2.0.0,<3.0.0)
21
22
  Project-URL: Issue tracker, https://github.com/ran-isenberg/aws-lambda-env-modeler/issues
@@ -27,7 +28,7 @@ Description-Content-Type: text/markdown
27
28
  # AWS Lambda Environment Variables Modeler (Python)
28
29
 
29
30
  [![license](https://img.shields.io/github/license/ran-isenberg/aws-lambda-env-modeler)](https://github.com/ran-isenberg/aws-lambda-env-modeler/blob/master/LICENSE)
30
- ![PythonSupport](https://img.shields.io/static/v1?label=python&message=%203.8.17|%203.9|%203.10|%203.11&color=blue?style=flat-square&logo=python)
31
+ ![PythonSupport](https://img.shields.io/static/v1?label=python&message=%203.8.17|%203.9|%203.10|%203.11|%203.12&color=blue?style=flat-square&logo=python)
31
32
  ![PyPI version](https://badge.fury.io/py/aws-lambda-env-modeler.svg)
32
33
  ![PyPi monthly downloads](https://img.shields.io/pypi/dm/aws-lambda-env-modeler)
33
34
  [![codecov](https://codecov.io/gh/ran-isenberg/aws-lambda-env-modeler/branch/main/graph/badge.svg?token=P2K7K4KICF)](https://codecov.io/gh/ran-isenberg/aws-lambda-env-modeler)
@@ -87,13 +88,15 @@ Head over to the complete project documentation pages at GitHub pages at [https:
87
88
  First, define a Pydantic model for your environment variables:
88
89
 
89
90
  ```python
90
- from pydantic import BaseModel
91
+ from pydantic import BaseModel, HttpUrl
91
92
 
92
93
  class MyEnvVariables(BaseModel):
93
94
  DB_HOST: str
94
95
  DB_PORT: int
95
96
  DB_USER: str
96
97
  DB_PASS: str
98
+ FLAG_X: bool
99
+ API_URL: HttpUrl
97
100
  ```
98
101
 
99
102
  You must first use the `@init_environment_variables` decorator to automatically validate and initialize the environment variables before executing a function:
@@ -2,7 +2,7 @@
2
2
  # AWS Lambda Environment Variables Modeler (Python)
3
3
 
4
4
  [![license](https://img.shields.io/github/license/ran-isenberg/aws-lambda-env-modeler)](https://github.com/ran-isenberg/aws-lambda-env-modeler/blob/master/LICENSE)
5
- ![PythonSupport](https://img.shields.io/static/v1?label=python&message=%203.8.17|%203.9|%203.10|%203.11&color=blue?style=flat-square&logo=python)
5
+ ![PythonSupport](https://img.shields.io/static/v1?label=python&message=%203.8.17|%203.9|%203.10|%203.11|%203.12&color=blue?style=flat-square&logo=python)
6
6
  ![PyPI version](https://badge.fury.io/py/aws-lambda-env-modeler.svg)
7
7
  ![PyPi monthly downloads](https://img.shields.io/pypi/dm/aws-lambda-env-modeler)
8
8
  [![codecov](https://codecov.io/gh/ran-isenberg/aws-lambda-env-modeler/branch/main/graph/badge.svg?token=P2K7K4KICF)](https://codecov.io/gh/ran-isenberg/aws-lambda-env-modeler)
@@ -62,13 +62,15 @@ Head over to the complete project documentation pages at GitHub pages at [https:
62
62
  First, define a Pydantic model for your environment variables:
63
63
 
64
64
  ```python
65
- from pydantic import BaseModel
65
+ from pydantic import BaseModel, HttpUrl
66
66
 
67
67
  class MyEnvVariables(BaseModel):
68
68
  DB_HOST: str
69
69
  DB_PORT: int
70
70
  DB_USER: str
71
71
  DB_PASS: str
72
+ FLAG_X: bool
73
+ API_URL: HttpUrl
72
74
  ```
73
75
 
74
76
  You must first use the `@init_environment_variables` decorator to automatically validate and initialize the environment variables before executing a function:
@@ -33,11 +33,10 @@ def init_environment_variables(model: Type[Model]):
33
33
  """
34
34
 
35
35
  def decorator(lambda_handler_function: Callable):
36
-
37
36
  @wraps(lambda_handler_function)
38
- def wrapper(event: Dict[str, Any], context):
37
+ def wrapper(event: Dict[str, Any], context, **kwargs):
39
38
  __parse_model(model)
40
- return lambda_handler_function(event, context)
39
+ return lambda_handler_function(event, context, **kwargs)
41
40
 
42
41
  return wrapper
43
42
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "aws_lambda_env_modeler"
3
- version = "1.0.3"
3
+ version = "1.0.6"
4
4
  description = "AWS-Lambda-Env-Modeler is a Python library designed to simplify the process of managing and validating environment variables in your AWS Lambda functions."
5
5
  authors = ["Ran Isenberg"]
6
6
  classifiers=[
@@ -12,6 +12,7 @@ classifiers=[
12
12
  "Programming Language :: Python :: 3.9",
13
13
  "Programming Language :: Python :: 3.10",
14
14
  "Programming Language :: Python :: 3.11",
15
+ "Programming Language :: Python :: 3.12",
15
16
  ]
16
17
  repository="https://github.com/ran-isenberg/aws-lambda-env-modeler"
17
18
  readme = "README.md"
@@ -26,7 +27,7 @@ packages = [
26
27
 
27
28
 
28
29
  [tool.poetry.dependencies]
29
- python = "^3.8.17 || ^3.9.0 || ^3.10.0 || ^3.11.0"
30
+ python = "^3.8.17 || ^3.9.0 || ^3.10.0 || ^3.11.0 || ^3.12.0"
30
31
  pydantic = {version = "^2.0.0"}
31
32
 
32
33
  [tool.poetry.dev-dependencies]
@@ -38,12 +39,10 @@ pytest-html = "*"
38
39
  python-dateutil = "*"
39
40
  python-dotenv = "*"
40
41
  GitPython = "*"
41
- yapf = "*"
42
42
  radon = "*"
43
43
  xenon = "*"
44
44
  pre-commit = "*"
45
- flake8 = "*"
46
- isort = "*"
45
+ ruff = "*"
47
46
  mkdocs-material = "*"
48
47
  mkdocs-git-revision-date-plugin = "*"
49
48
  types-cachetools = "*"
@@ -52,3 +51,66 @@ types-requests = "*"
52
51
  toml = "*"
53
52
  wheel = "*"
54
53
  setuptools = "*"
54
+
55
+ [tool.ruff]
56
+ # Exclude a variety of commonly ignored directories.
57
+ exclude = [
58
+ ".bzr",
59
+ ".direnv",
60
+ ".eggs",
61
+ ".git",
62
+ ".git-rewrite",
63
+ ".hg",
64
+ ".mypy_cache",
65
+ ".nox",
66
+ ".pants.d",
67
+ ".pytype",
68
+ ".ruff_cache",
69
+ ".svn",
70
+ ".tox",
71
+ ".venv",
72
+ "__pypackages__",
73
+ "_build",
74
+ "buck-out",
75
+ "build",
76
+ "dist",
77
+ "node_modules",
78
+ "venv",
79
+ "cdk.out",
80
+ ".vscode",
81
+ ".pytest_cache",
82
+ ".build",
83
+ ".mypy_cache",
84
+ ".github"
85
+ ]
86
+
87
+ # Same as Black.
88
+ line-length = 150
89
+ indent-width = 4
90
+
91
+ # Assume Python 3.12
92
+ target-version = "py312"
93
+
94
+ [tool.ruff.lint]
95
+ # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
96
+ select = [
97
+ "E", # pycodestyle errors
98
+ "W", # pycodestyle warnings
99
+ "F", # pyflakes
100
+ "I", # isort
101
+ "C", # flake8-comprehensions
102
+ "B", # flake8-bugbear
103
+ ]
104
+ ignore = [ "E203", "E266", "E501", "W191"]
105
+
106
+ [tool.ruff.format]
107
+ quote-style = "single"
108
+
109
+ # Like Black, indent with spaces, rather than tabs.
110
+ indent-style = "space"
111
+
112
+ # Like Black, automatically detect the appropriate line ending.
113
+ line-ending = "auto"
114
+
115
+ [tool.ruff.isort]
116
+ known-third-party = ["pydantic", "aws_lambda_powertools"]