Drop support for python3.6 (#444)

This commit is contained in:
James Hilton-Balfe 2023-02-09 08:35:41 +00:00 committed by GitHub
parent 0adcc9020c
commit 1b1bd47cb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 922 additions and 355 deletions

View File

@ -16,10 +16,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [Ubuntu, MacOS, Windows] os: [Ubuntu, MacOS, Windows]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] python-version: ['3.7', '3.8', '3.9', '3.10']
exclude:
- os: Windows
python-version: 3.6
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -7,7 +7,7 @@ This project aims to provide an improved experience when using Protobuf / gRPC i
- Protobuf 3 & gRPC code generation - Protobuf 3 & gRPC code generation
- Both binary & JSON serialization is built-in - Both binary & JSON serialization is built-in
- Python 3.6+ making use of: - Python 3.7+ making use of:
- Enums - Enums
- Dataclasses - Dataclasses
- `async`/`await` - `async`/`await`
@ -371,7 +371,7 @@ datetime.datetime(2019, 1, 1, 11, 59, 58, 800000, tzinfo=datetime.timezone.utc)
### Requirements ### Requirements
- Python (3.6 or higher) - Python (3.7 or higher)
- [poetry](https://python-poetry.org/docs/#installation) - [poetry](https://python-poetry.org/docs/#installation)
*Needed to install dependencies in a virtual environment* *Needed to install dependencies in a virtual environment*

View File

@ -1 +0,0 @@

1254
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -12,9 +12,8 @@ packages = [
] ]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.6.2,<4.0" python = "^3.7"
black = { version = ">=19.3b0", optional = true } black = { version = ">=19.3b0", optional = true }
dataclasses = { version = "^0.7", python = ">=3.6, <3.7" }
grpclib = "^0.4.1" grpclib = "^0.4.1"
jinja2 = { version = ">=3.0.3", optional = true } jinja2 = { version = ">=3.0.3", optional = true }
python-dateutil = "^2.8" python-dateutil = "^2.8"
@ -112,7 +111,7 @@ force_grid_wrap = 2
src_paths = ["src", "tests"] src_paths = ["src", "tests"]
[tool.black] [tool.black]
target-version = ['py36'] target-version = ['py37']
[tool.doc8] [tool.doc8]
paths = ["docs"] paths = ["docs"]
@ -130,7 +129,7 @@ omit = ["betterproto/tests/*"]
legacy_tox_ini = """ legacy_tox_ini = """
[tox] [tox]
isolated_build = true isolated_build = true
envlist = py36, py37, py38, py310 envlist = py37, py38, py310
[testenv] [testenv]
whitelist_externals = poetry whitelist_externals = poetry

View File

@ -887,10 +887,10 @@ class Message(ABC):
t = cls._type_hint(field.name) t = cls._type_hint(field.name)
if hasattr(t, "__origin__"): if hasattr(t, "__origin__"):
if t.__origin__ in (dict, Dict): if t.__origin__ is dict:
# This is some kind of map (dict in Python). # This is some kind of map (dict in Python).
return dict return dict
elif t.__origin__ in (list, List): elif t.__origin__ is list:
# This is some kind of list (repeated) field. # This is some kind of list (repeated) field.
return list return list
elif t.__origin__ is Union and t.__args__[1] is type(None): elif t.__origin__ is Union and t.__args__[1] is type(None):