From 666df989be962c6156d11dd725a82768d5ab596d Mon Sep 17 00:00:00 2001 From: laike9m Date: Wed, 30 Oct 2024 21:52:50 -0700 Subject: [PATCH] Pin Python version to 3.12, fix #126 --- challenges/advanced-forward/solution.py | 2 +- .../advanced-variadic-generics/solution.py | 1 + challenges/extreme-self-casting/solution.py | 6 ++-- pyproject.toml | 32 +++++++++---------- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/challenges/advanced-forward/solution.py b/challenges/advanced-forward/solution.py index 6995bdd..c2cb781 100644 --- a/challenges/advanced-forward/solution.py +++ b/challenges/advanced-forward/solution.py @@ -14,7 +14,7 @@ def copy(self) -> "MyClass": # class MyClass: # def __init__(self, x: int) -> None: # self.x = x -# +# # # TODO: Fix the type hints of `copy` to make it type check # def copy(self) -> MyClass: # copied_object = MyClass(x=self.x) diff --git a/challenges/advanced-variadic-generics/solution.py b/challenges/advanced-variadic-generics/solution.py index 151e270..9d04f47 100644 --- a/challenges/advanced-variadic-generics/solution.py +++ b/challenges/advanced-variadic-generics/solution.py @@ -11,6 +11,7 @@ # def __add__(self, other: "Array[*Ts]") -> "Array[*Ts]": # ... + # For Python >= 3.12 class Array[*Ts]: def __add__(self, other: "Array[*Ts]") -> "Array[*Ts]": diff --git a/challenges/extreme-self-casting/solution.py b/challenges/extreme-self-casting/solution.py index f45ac09..d5281a6 100644 --- a/challenges/extreme-self-casting/solution.py +++ b/challenges/extreme-self-casting/solution.py @@ -15,12 +15,12 @@ # # For Python < 3.12 # R = TypeVar("R") # P = ParamSpec("P") -# -# +# +# # class Fn(Generic[R, P]): # def __init__(self, f: Callable[P, R]): # self.f = f -# +# # def transform_callable(self) -> Callable[Concatenate[object, P], R]: # ... diff --git a/pyproject.toml b/pyproject.toml index dca64ba..4b46b16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,19 +2,17 @@ name = "" version = "" description = "" -authors = [ - {name = "laike9m", email = "laike9m@gmail.com"}, -] +authors = [{ name = "laike9m", email = "laike9m@gmail.com" }] dependencies = [ - "flask>=3.0.0", - "pyright>=1.1.338", - "flask-sitemapper>=1.7.0", - "markdown>=3.5.1", - "flask-htmx>=0.3.2", + "flask>=3.0.0", + "pyright>=1.1.338", + "flask-sitemapper>=1.7.0", + "markdown>=3.5.1", + "flask-htmx>=0.3.2", ] -requires-python = ">=3.12" +requires-python = "~=3.12" readme = "README.md" -license = {text = "MIT"} +license = { text = "MIT" } [tool.pdm] plugins = ["pdm-autoexport"] @@ -24,16 +22,16 @@ dev = "flask --app app run --debug" test = "pytest -n auto" run_ruff = "ruff format" djhtml.cmd = "djhtml --tabwidth 2 templates" -djhtml.env = {PYTHONUTF8 = "1"} -format = {composite = ["run_ruff", "djhtml"]} +djhtml.env = { PYTHONUTF8 = "1" } +format = { composite = ["run_ruff", "djhtml"] } [tool.pdm.dev-dependencies] dev = [ - "pytest>=7.4.3", - "djhtml>=3.0.6", - "pre-commit>=3.5.0", - "pytest-xdist>=3.3.1", - "ruff>=0.1.14", + "pytest>=7.4.3", + "djhtml>=3.0.6", + "pre-commit>=3.5.0", + "pytest-xdist>=3.3.1", + "ruff>=0.1.14", ] [[tool.pdm.autoexport]]