Skip to content

Commit 08f156a

Browse files
J0joel@joellee.org
and
joel@joellee.org
authored
feat: add support for 3.11 (#188)
* fix: add StrEnum * fix: add 3.11 to ci * fix: run black and autoflake Co-authored-by: joel@joellee.org <joel@joellee.org>
1 parent 7e87364 commit 08f156a

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest]
11-
python-version: [3.7, 3.8, 3.9, '3.10']
11+
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
1212
runs-on: ${{ matrix.os }}
1313
steps:
1414
- name: Clone Repository

poetry.lock

+18-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postgrest/types.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
from __future__ import annotations
22

3-
from enum import Enum
3+
import sys
44

5+
if sys.version_info >= (3, 11):
6+
from enum import StrEnum
7+
else:
8+
from strenum import StrEnum
59

6-
class CountMethod(str, Enum):
10+
11+
class CountMethod(StrEnum):
712
exact = "exact"
813
planned = "planned"
914
estimated = "estimated"
1015

1116

12-
class Filters(str, Enum):
17+
class Filters(StrEnum):
1318
NOT = "not"
1419
EQ = "eq"
1520
NEQ = "neq"
@@ -35,7 +40,7 @@ class Filters(str, Enum):
3540
ADJ = "adj"
3641

3742

38-
class RequestMethod(str, Enum):
43+
class RequestMethod(StrEnum):
3944
GET = "GET"
4045
POST = "POST"
4146
PATCH = "PATCH"
@@ -44,6 +49,6 @@ class RequestMethod(str, Enum):
4449
HEAD = "HEAD"
4550

4651

47-
class ReturnMethod(str, Enum):
52+
class ReturnMethod(StrEnum):
4853
minimal = "minimal"
4954
representation = "representation"

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ python = "^3.7"
2222
httpx = "^0.23.0"
2323
deprecation = "^2.1.0"
2424
pydantic = "^1.9.0"
25+
strenum = "^0.4.9"
2526

2627
[tool.poetry.dev-dependencies]
2728
pytest = "^7.1.3"

0 commit comments

Comments
 (0)