Skip to content

Commit

Permalink
feat: add support for 3.11 (#188)
Browse files Browse the repository at this point in the history
* fix: add StrEnum

* fix: add 3.11 to ci

* fix: run black and autoflake

Co-authored-by: joel@joellee.org <joel@joellee.org>
  • Loading branch information
J0 and joel@joellee.org authored Jan 24, 2023
1 parent 7e87364 commit 08f156a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
runs-on: ${{ matrix.os }}
steps:
- name: Clone Repository
Expand Down
19 changes: 18 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions postgrest/types.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
from __future__ import annotations

from enum import Enum
import sys

if sys.version_info >= (3, 11):
from enum import StrEnum
else:
from strenum import StrEnum

class CountMethod(str, Enum):

class CountMethod(StrEnum):
exact = "exact"
planned = "planned"
estimated = "estimated"


class Filters(str, Enum):
class Filters(StrEnum):
NOT = "not"
EQ = "eq"
NEQ = "neq"
Expand All @@ -35,7 +40,7 @@ class Filters(str, Enum):
ADJ = "adj"


class RequestMethod(str, Enum):
class RequestMethod(StrEnum):
GET = "GET"
POST = "POST"
PATCH = "PATCH"
Expand All @@ -44,6 +49,6 @@ class RequestMethod(str, Enum):
HEAD = "HEAD"


class ReturnMethod(str, Enum):
class ReturnMethod(StrEnum):
minimal = "minimal"
representation = "representation"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ python = "^3.7"
httpx = "^0.23.0"
deprecation = "^2.1.0"
pydantic = "^1.9.0"
strenum = "^0.4.9"

[tool.poetry.dev-dependencies]
pytest = "^7.1.3"
Expand Down

0 comments on commit 08f156a

Please sign in to comment.