pygrestqlambda 0.0.2__tar.gz → 0.0.3__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.
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/.github/workflows/publish.yml +7 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/PKG-INFO +1 -1
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/pyproject.toml +1 -1
- pygrestqlambda-0.0.3/scripts/pre-publish.sh +7 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/pygrestqlambda/aws/lambda_function/json_transform.py +10 -3
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/tests/aws/lambda_function/test_json_transform.py +20 -1
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/.github/workflows/validate.yml +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/.gitignore +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/LICENSE +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/README.md +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/direct/README.md +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/direct/json_response.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/direct/requirements.txt +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/direct/string_response.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/lambda/Dockerfile +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/lambda/README.md +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/lambda/app.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/local_lambda_gateway_compose/README.md +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/local_lambda_gateway_compose/docker-compose.yaml +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/local_lambda_gateway_compose/lambda/Dockerfile +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/local_lambda_gateway_compose/lambda/app.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/local_lambda_gateway_compose/lambda/requirements.txt +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/local_lambda_gateway_compose/openapi.yaml +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/scripts/validate.sh +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/__init__.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/pygrestqlambda/__init__.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/pygrestqlambda/aws/__init__.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/pygrestqlambda/aws/lambda_function/__init__.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/pygrestqlambda/aws/lambda_function/rest_api_gateway_proxy_integration.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/pygrestqlambda/db/__init__.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/pygrestqlambda/db/record.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/tests/__init__.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/tests/aws/__init__.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/tests/aws/lambda_function/__init__.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/tests/aws/lambda_function/test_rest_api_gateway_proxy_integration.py +0 -0
- {pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/tests/test_record.py +0 -0
@@ -4,6 +4,9 @@ on:
|
|
4
4
|
push:
|
5
5
|
tags: [ '*.*.*' ]
|
6
6
|
|
7
|
+
env:
|
8
|
+
PROJECT_VERSION: ${{ github.ref_name }}
|
9
|
+
|
7
10
|
jobs:
|
8
11
|
publish:
|
9
12
|
runs-on: ubuntu-latest
|
@@ -19,6 +22,10 @@ jobs:
|
|
19
22
|
with:
|
20
23
|
python-version: '3.11'
|
21
24
|
|
25
|
+
# Run pre-publish step to update project version number to tag
|
26
|
+
- name: Pre-build
|
27
|
+
run: ./scripts/pre-publish.sh
|
28
|
+
|
22
29
|
# Re-run validation and build
|
23
30
|
- name: Validate
|
24
31
|
run: ./scripts/validate.sh
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pygrestqlambda
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.3
|
4
4
|
Summary: PostgreSQL REST API framework for AWS Lambda functions
|
5
5
|
Project-URL: Homepage, https://github.com/mesogate/pygrestqlambda
|
6
6
|
Project-URL: Issues, https://github.com/mesogate/pygrestqlambda/issues
|
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
set -euo pipefail
|
3
|
+
|
4
|
+
# Override pyproject version if environment variable is set
|
5
|
+
PROJECT_VERSION=${PROJECT_VERSION:=0.0.0}
|
6
|
+
echo "Setting project version: ${PROJECT_VERSION}"
|
7
|
+
sed -i -e "s/version.*=.*\".*\"/version = \"${PROJECT_VERSION}\"/" pyproject.toml
|
@@ -2,9 +2,9 @@
|
|
2
2
|
JSON output transformer for non-serialisable values
|
3
3
|
"""
|
4
4
|
|
5
|
+
from datetime import date, datetime
|
6
|
+
from decimal import Decimal
|
5
7
|
from uuid import UUID
|
6
|
-
from datetime import datetime
|
7
|
-
|
8
8
|
|
9
9
|
def json_output(value: object) -> str:
|
10
10
|
"""
|
@@ -15,8 +15,15 @@ def json_output(value: object) -> str:
|
|
15
15
|
if isinstance(value, UUID):
|
16
16
|
value = str(value)
|
17
17
|
|
18
|
-
# Handle timestamps
|
18
|
+
# Handle date/timestamps
|
19
19
|
if isinstance(value, datetime):
|
20
20
|
value = value.isoformat()
|
21
21
|
|
22
|
+
if isinstance(value, date):
|
23
|
+
value = value.isoformat()
|
24
|
+
|
25
|
+
# Handle decimals
|
26
|
+
if isinstance(value, Decimal):
|
27
|
+
value = float(value)
|
28
|
+
|
22
29
|
return value
|
{pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/tests/aws/lambda_function/test_json_transform.py
RENAMED
@@ -3,7 +3,8 @@ Test JSON transformation for lambda proxy integration response
|
|
3
3
|
"""
|
4
4
|
|
5
5
|
from uuid import uuid4
|
6
|
-
from datetime import datetime
|
6
|
+
from datetime import date, datetime
|
7
|
+
from decimal import Decimal
|
7
8
|
from pygrestqlambda.aws.lambda_function.json_transform import json_output
|
8
9
|
|
9
10
|
|
@@ -25,3 +26,21 @@ def test_datetime():
|
|
25
26
|
now = datetime.now()
|
26
27
|
|
27
28
|
assert json_output(now) == now.isoformat()
|
29
|
+
|
30
|
+
|
31
|
+
def test_date():
|
32
|
+
"""
|
33
|
+
Test dates are transformed correctly
|
34
|
+
"""
|
35
|
+
|
36
|
+
today = date.today()
|
37
|
+
assert json_output(today) == today.isoformat()
|
38
|
+
|
39
|
+
|
40
|
+
def test_decimal():
|
41
|
+
"""
|
42
|
+
Test decimals are transformed correctly
|
43
|
+
"""
|
44
|
+
|
45
|
+
assert json_output(Decimal('1.0005')) == 1.0005
|
46
|
+
assert json_output(Decimal('1.00050')) == 1.0005
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/docs/examples/local_lambda_gateway_compose/README.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pygrestqlambda-0.0.2 → pygrestqlambda-0.0.3}/src/pygrestqlambda/aws/lambda_function/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|