Skip to content

Commit

Permalink
Merge pull request #6 from workfloworchestrator/bumpversion-0.1.0
Browse files Browse the repository at this point in the history
Support python 3.9/3.10/3.11, bumpversion 0.1.0
  • Loading branch information
Mark90 authored Mar 7, 2023
2 parents 17e1cc1 + f37292b commit 7c25912
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.1
current_version = 0.1.0
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((\-rc)(?P<build>\d+))?
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/run-linting-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.9', '3.10', '3.11']
fail-fast: false

steps:
Expand All @@ -37,6 +37,6 @@ jobs:
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 .
# - name: Check with mypy
# run: |
# mypy .
- name: Check with mypy
run: |
mypy pydantic_forms
2 changes: 1 addition & 1 deletion .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
fail-fast: false
container: python:${{ matrix.python-version }}-slim
steps:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
rev: 23.1.0
hooks:
- id: black
language_version: python3.10
language_version: python3.9
- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
hooks:
Expand Down Expand Up @@ -44,7 +44,7 @@ repos:
rev: v1.0.1
hooks:
- id: mypy
language_version: python3.10
language_version: python3.9
additional_dependencies:
- pydantic
- types-toml
Expand Down
2 changes: 1 addition & 1 deletion pydantic_forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

"""This is the pydantic-forms engine."""

__version__ = "0.0.1"
__version__ = "0.1.0"
2 changes: 1 addition & 1 deletion pydantic_forms/core/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def post_form(

# Generate first form (we need to send None here, since the arguments are already given
# when we initialized the generator)
generated_form: InputForm | dict = await generator.asend(None)
generated_form: Union[InputForm, dict] = await generator.asend(None)

# Loop through user inputs and for each input validate and update current state and validation results
user_inputs = user_inputs.copy()
Expand Down
4 changes: 2 additions & 2 deletions pydantic_forms/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

try:
# python3.10 introduces types.UnionType for the new union and optional type defs.
from types import UnionType
from types import UnionType # type: ignore # 3.9 compatibility

union_types = [Union, UnionType]
except ImportError:
Expand Down Expand Up @@ -58,5 +58,5 @@ class SummaryData(TypedDict, total=False):
StateInputStepFunc = Union[StateSimpleInputFormGenerator, StateInputFormGenerator]
SubscriptionMapping = Dict[str, List[Dict[str, str]]]

FormGeneratorAsync = AsyncGenerator[Type[T] | State, T] # [YieldType, SendType]
FormGeneratorAsync = AsyncGenerator[Union[Type[T], State], T] # [YieldType, SendType]
StateInputFormGeneratorAsync = Callable[[State], FormGeneratorAsync]
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: AsyncIO",
"Framework :: FastAPI",
"Framework :: Flask",
"Intended Audience :: Developers",
"Intended Audience :: Telecommunications Industry",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Internet :: WWW/HTTP",
]
Expand All @@ -38,7 +40,7 @@ requires = [

]
description-file = "README.md"
requires-python = ">=3.7,<3.11"
requires-python = ">=3.9,<=3.11"

[tool.flit.metadata.urls]
Documentation = "https://github.com/workfloworchestrator/pydantic-forms/blob/main/README.md"
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ disallow_untyped_decorators = True
no_implicit_optional = True
strict_optional = True
namespace_packages = true
warn_unused_ignores = True
; TODO re-enable unused ignores when we stop supporting 3.9 https://github.com/python/mypy/issues/8823
warn_unused_ignores = False
warn_redundant_casts = True
; Disable due to flaky results in mypy itself
;warn_return_any = True
Expand Down

0 comments on commit 7c25912

Please sign in to comment.