Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump python runtime to v3.11 #93

Merged
merged 10 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
lint:
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.11"]
poetry-version: ["1.4"]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
Expand All @@ -28,7 +28,7 @@ jobs:
test:
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.11"]
poetry-version: ["1.4"]
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
release:
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.11"]
poetry-version: ["1.4"]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ repos:
rev: 22.3.0
hooks:
- id: black
language_version: python3.9
language_version: python3.11
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9
FROM python:3.11
RUN apt-get update
RUN apt-get install -y zip

Expand Down
1,796 changes: 630 additions & 1,166 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
[tool.poetry]
name = "aws-log-ingestion"
version = "2.8.0"
version = "2.9.0"
description = ""
authors = ["New Relic <[email protected]>"]
license = "Apache 2.0"

[tool.poetry.dependencies]
python = "^3.9"
python = "^3.11"
aiohttp = "^3.8.4"

[tool.poetry.group.dev.dependencies]
asynctest = "^0.13.0"
aws-sam-cli = "^1.33.0"
black = "^23.3.0"
boto3 = "^1.19.2"
Expand All @@ -20,14 +19,15 @@ mock = "^4.0.3"
pytest = "^6.2.5"
pytest-asyncio = "^0.16.0"
serverlessrepo = {git = "https://github.com/kolanos/aws-serverlessrepo-python.git", rev = "master"}
pyyaml = "!=5.4.1, !=5.4.0" # pyyaml is broken with cython 3

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 88
target-version = ['py39']
target-version = ['py311']
include = '\.pyi?$'
exclude = '''
/(
Expand Down
2 changes: 1 addition & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ service: newrelic-log-ingestion

provider:
name: aws
runtime: python3.9
runtime: python3.11
stage: production
timeout: 30

Expand Down
2 changes: 1 addition & 1 deletion src/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class EntryType(Enum):
r"(?P<request_id>[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"
)

LOGGING_LAMBDA_VERSION = "1.0.3"
LOGGING_LAMBDA_VERSION = "2.9.0"
LOGGING_PLUGIN_METADATA = {"type": "lambda", "version": LOGGING_LAMBDA_VERSION}


Expand Down
18 changes: 9 additions & 9 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
aiohttp==3.8.4 ; python_version >= "3.9" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
async-timeout==4.0.2 ; python_version >= "3.9" and python_version < "4.0"
attrs==23.1.0 ; python_version >= "3.9" and python_version < "4.0"
charset-normalizer==3.1.0 ; python_version >= "3.9" and python_version < "4.0"
frozenlist==1.3.3 ; python_version >= "3.9" and python_version < "4.0"
idna==3.4 ; python_version >= "3.9" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.9" and python_version < "4.0"
yarl==1.9.1 ; python_version >= "3.9" and python_version < "4.0"
aiohttp==3.8.4 ; python_version >= "3.11" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.11" and python_version < "4.0"
async-timeout==4.0.2 ; python_version >= "3.11" and python_version < "4.0"
attrs==23.1.0 ; python_version >= "3.11" and python_version < "4.0"
charset-normalizer==3.1.0 ; python_version >= "3.11" and python_version < "4.0"
frozenlist==1.3.3 ; python_version >= "3.11" and python_version < "4.0"
idna==3.4 ; python_version >= "3.11" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.11" and python_version < "4.0"
yarl==1.9.1 ; python_version >= "3.11" and python_version < "4.0"
6 changes: 3 additions & 3 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Metadata:
LicenseUrl: LICENSE
ReadmeUrl: README.md
HomePageUrl: https://github.com/newrelic/aws-log-ingestion
SemanticVersion: 2.8.0
SemanticVersion: 2.9.0
SourceCodeUrl: https://github.com/newrelic/aws-log-ingestion

Resources:
Expand All @@ -77,7 +77,7 @@ Resources:
FunctionName: !Join ['-', ['newrelic-log-ingestion', !Select [4, !Split ['-', !Select [2, !Split ['/', !Ref AWS::StackId]]]]]]
MemorySize:
Ref: MemorySize
Runtime: python3.9
Runtime: python3.11
PermissionsBoundary: !If [ HasPermissionBoundary, !Ref PermissionsBoundary, !Ref AWS::NoValue ]
Role: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${FunctionRole}
Timeout:
Expand All @@ -99,7 +99,7 @@ Resources:
FunctionName: !Join ['-', ['newrelic-log-ingestion', !Select [4, !Split ['-', !Select [2, !Split ['/', !Ref AWS::StackId]]]]]]
MemorySize:
Ref: MemorySize
Runtime: python3.9
Runtime: python3.11
PermissionsBoundary: !If [ HasPermissionBoundary, !Ref PermissionsBoundary, !Ref AWS::NoValue ]
Timeout:
Ref: Timeout
Expand Down
2 changes: 1 addition & 1 deletion terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ resource "aws_lambda_function" "ingestion_function" {
? var.function_role
: aws_iam_role.lambda_role.0.arn
)
runtime = "python3.9"
runtime = "python3.11"
filename = local.archive_name
handler = "function.lambda_handler"
memory_size = var.memory_size
Expand Down
4 changes: 2 additions & 2 deletions test/log_ingestion_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from test.aws_log_events import AwsLogEvents

import asyncio
from asynctest import CoroutineMock, MagicMock
from unittest.mock import MagicMock, AsyncMock

US_URL = "https://log-api.newrelic.com/log/v1"
EU_URL = "https://log-api.eu.newrelic.com/log/v1"
Expand Down Expand Up @@ -56,7 +56,7 @@ def event_loop():

@pytest.fixture
def mock_aio_post():
with patch("aiohttp.ClientSession.post", new=CoroutineMock()) as mocked_aio_post:
with patch("aiohttp.ClientSession.post", new=AsyncMock()) as mocked_aio_post:
yield mocked_aio_post


Expand Down
Loading