Skip to content

Commit 9b7f686

Browse files
authored
Add support for python 3.10 and 3.11 (#16)
* Add support for python 3.10 and 3.11 * move kafka tests, update their README
1 parent 82e158c commit 9b7f686

File tree

14 files changed

+27
-19
lines changed

14 files changed

+27
-19
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
fail-fast: false
5151
matrix:
5252
operating-system: [ubuntu-latest, macos-latest]
53-
python-version: [3.7, 3.8, 3.9]
53+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
5454

5555
steps:
5656
- uses: actions/checkout@v2

.python-version

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
3.11.4
2+
3.10.12
13
3.9.7
24
3.8.12
35
3.7.12

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = aws-glue-schema-registry
3-
version = 1.1.2
3+
version = 1.1.3
44
description = Use the AWS Glue Schema Registry.
55
long_description = file: README.md
66
long_description_content_type = text/markdown
@@ -34,7 +34,8 @@ install_requires =
3434
boto3>=1.17.102
3535
typing-extensions>=3.7.4.3;python_version<"3.8"
3636
fastavro>=1.4.5
37-
orjson~=3.6.0
37+
orjson~=3.6.0;python_version<"3.11"
38+
orjson>=3.7.7;python_version>="3.11"
3839
fastjsonschema~=2.15
3940
setup_requires =
4041
setuptools

src/aws_schema_registry/adapter/kafka.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
https://pypi.org/project/kafka-python/
44
"""
55

6-
from kafka import Serializer, Deserializer
6+
from kafka.serializer import Serializer, Deserializer
77

88
from aws_schema_registry import (
99
KafkaSerializer as _KafkaSerializer,

src/aws_schema_registry/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import time
44
import random
55
import string
6-
from typing import ContextManager, Mapping
6+
from typing import ContextManager, Mapping, Optional
77
from uuid import UUID
88

99
from aws_schema_registry.schema import (
@@ -138,7 +138,7 @@ def get_or_register_schema_version(
138138
schema_name: str,
139139
data_format: DataFormat,
140140
compatibility_mode: CompatibilityMode = DEFAULT_COMPATIBILITY_MODE,
141-
metadata: Mapping[str, str] = None
141+
metadata: Optional[Mapping[str, str]] = None
142142
) -> SchemaVersion:
143143
"""Get Schema Version ID by following below steps:
144144
@@ -193,7 +193,7 @@ def register_schema_version(
193193
self,
194194
definition: str,
195195
schema_name: str,
196-
metadata: Mapping[str, str] = None
196+
metadata: Optional[Mapping[str, str]] = None
197197
) -> UUID:
198198
"""Register a new version to an existing schema.
199199
@@ -281,7 +281,7 @@ def create_schema(
281281
data_format: DataFormat,
282282
definition: str,
283283
compatibility_mode: CompatibilityMode = DEFAULT_COMPATIBILITY_MODE,
284-
metadata: Mapping[str, str] = None
284+
metadata: Optional[Mapping[str, str]] = None
285285
) -> UUID:
286286
"""Create a new schema and return the version id."""
287287
try:

tests/integration/kafka/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Kafka integration tests
2+
3+
Tests that the serializer and deserializer works correctly with a real Kafka cluster.
4+
5+
Requires [Docker](https://www.docker.com/). Tested with Docker v20.
6+
7+
Run `docker compose -f tests/integration/kafka_test/docker-compose.yml up -d` before running these tests. Destroy the docker stack with `docker compose -f tests/integration/kafka_test/docker-compose.yml down`.
File renamed without changes.

0 commit comments

Comments
 (0)