]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
Remove code examples for Python 3.9
authorYurii Motov <yurii.motov.monte@gmail.com>
Fri, 20 Feb 2026 23:17:35 +0000 (00:17 +0100)
committerYurii Motov <yurii.motov.monte@gmail.com>
Fri, 20 Feb 2026 23:17:35 +0000 (00:17 +0100)
docs_src/tutorial/str_fields_and_column_length/tutorial001_py39.py [deleted file]
docs_src/tutorial/str_fields_and_column_length/tutorial002_py39.py [deleted file]
docs_src/tutorial/str_fields_and_column_length/tutorial003_py39.py [deleted file]
docs_src/tutorial/str_fields_and_column_length/tutorial004_py39.py [deleted file]
tests/test_tutorial/test_str_fields_and_column_length/test_tutorial001.py
tests/test_tutorial/test_str_fields_and_column_length/test_tutorial002.py
tests/test_tutorial/test_str_fields_and_column_length/test_tutorial003.py
tests/test_tutorial/test_str_fields_and_column_length/test_tutorial004.py

diff --git a/docs_src/tutorial/str_fields_and_column_length/tutorial001_py39.py b/docs_src/tutorial/str_fields_and_column_length/tutorial001_py39.py
deleted file mode 100644 (file)
index ff33483..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-from typing import Optional
-
-from sqlmodel import Field, SQLModel, create_engine
-
-
-class Hero(SQLModel, table=True):
-    id: Optional[int] = Field(default=None, primary_key=True)
-    name: str
-
-
-database_url = "mysql://user:password@localhost/dbname"
-
-engine = create_engine(database_url, echo=True)
-
-
-def create_db_and_tables():
-    SQLModel.metadata.create_all(engine)
-
-
-if __name__ == "__main__":
-    create_db_and_tables()
diff --git a/docs_src/tutorial/str_fields_and_column_length/tutorial002_py39.py b/docs_src/tutorial/str_fields_and_column_length/tutorial002_py39.py
deleted file mode 100644 (file)
index 32e7052..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-from typing import Optional
-
-from sqlmodel import Field, SQLModel, create_engine
-
-
-class Hero(SQLModel, table=True):
-    id: Optional[int] = Field(default=None, primary_key=True)
-    name: str = Field(max_length=100)
-
-
-database_url = "mysql://user:password@localhost/dbname"
-
-engine = create_engine(database_url, echo=True)
-
-
-def create_db_and_tables():
-    SQLModel.metadata.create_all(engine)
-
-
-if __name__ == "__main__":
-    create_db_and_tables()
diff --git a/docs_src/tutorial/str_fields_and_column_length/tutorial003_py39.py b/docs_src/tutorial/str_fields_and_column_length/tutorial003_py39.py
deleted file mode 100644 (file)
index 4ca5ff0..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-from typing import Optional
-
-from sqlmodel import Field, SQLModel, String, create_engine
-
-
-class Hero(SQLModel, table=True):
-    id: Optional[int] = Field(default=None, primary_key=True)
-    name: str = Field(sa_type=String)
-
-
-database_url = "mysql://user:password@localhost/dbname"
-
-engine = create_engine(database_url, echo=True)
-
-
-def create_db_and_tables():
-    SQLModel.metadata.create_all(engine)
-
-
-if __name__ == "__main__":
-    create_db_and_tables()
diff --git a/docs_src/tutorial/str_fields_and_column_length/tutorial004_py39.py b/docs_src/tutorial/str_fields_and_column_length/tutorial004_py39.py
deleted file mode 100644 (file)
index c1ef56a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-from typing import Optional
-
-from sqlmodel import Field, SQLModel, String, create_engine
-
-
-class Hero(SQLModel, table=True):
-    id: Optional[int] = Field(default=None, primary_key=True)
-    name: str = Field(sa_type=String(length=255))
-
-
-database_url = "mysql://user:password@localhost/dbname"
-
-engine = create_engine(database_url, echo=True)
-
-
-def create_db_and_tables():
-    SQLModel.metadata.create_all(engine)
-
-
-if __name__ == "__main__":
-    create_db_and_tables()
index 755457eb858e8e6ae439716730120d37e5eedfa5..25ac2e2a32416e10079ccaeb4ef5369a4b67a714 100644 (file)
@@ -10,8 +10,6 @@ from sqlalchemy import create_mock_engine
 from sqlalchemy.sql.type_api import TypeEngine
 from sqlmodel import create_engine
 
-from ...conftest import needs_py310
-
 
 def mysql_dump(sql: TypeEngine, *args, **kwargs):
     dialect = sql.compile(dialect=mysql_engine.dialect)
@@ -26,8 +24,7 @@ mysql_engine = create_mock_engine("mysql://", mysql_dump)
 @pytest.fixture(
     name="mod",
     params=[
-        pytest.param("tutorial001_py39"),
-        pytest.param("tutorial001_py310", marks=needs_py310),
+        "tutorial001_py310",
     ],
 )
 def get_module(request: pytest.FixtureRequest) -> Generator[ModuleType, None, None]:
index 11be8afb7e518ef33dc7827499bd6171b520f0e9..647598e8fbcecd9ebcc69bce58422a36b85a7f88 100644 (file)
@@ -10,8 +10,6 @@ from sqlalchemy import create_mock_engine
 from sqlalchemy.sql.type_api import TypeEngine
 from sqlmodel import create_engine
 
-from ...conftest import needs_py310
-
 
 def mysql_dump(sql: TypeEngine, *args, **kwargs):
     dialect = sql.compile(dialect=mysql_engine.dialect)
@@ -26,8 +24,7 @@ mysql_engine = create_mock_engine("mysql://", mysql_dump)
 @pytest.fixture(
     name="mod",
     params=[
-        pytest.param("tutorial002_py39"),
-        pytest.param("tutorial002_py310", marks=needs_py310),
+        "tutorial002_py310",
     ],
 )
 def get_module(request: pytest.FixtureRequest) -> Generator[ModuleType, None, None]:
index 63027719179a4afbeac2417b1c8e88bcba59f81c..23404f9d7c566999eb5a89dded1e51a22c681547 100644 (file)
@@ -11,8 +11,6 @@ from sqlalchemy.exc import CompileError
 from sqlalchemy.sql.type_api import TypeEngine
 from sqlmodel import create_engine
 
-from ...conftest import needs_py310
-
 
 def mysql_dump(sql: TypeEngine, *args, **kwargs):
     dialect = sql.compile(dialect=mysql_engine.dialect)
@@ -27,8 +25,7 @@ mysql_engine = create_mock_engine("mysql://", mysql_dump)
 @pytest.fixture(
     name="mod",
     params=[
-        pytest.param("tutorial003_py39"),
-        pytest.param("tutorial003_py310", marks=needs_py310),
+        "tutorial003_py310",
     ],
 )
 def get_module(request: pytest.FixtureRequest) -> Generator[ModuleType, None, None]:
index f6367499c056479509d482be050d2f9289d54c77..ec024dfa66f742d316534d00c08e755948f664c3 100644 (file)
@@ -10,8 +10,6 @@ from sqlalchemy import create_mock_engine
 from sqlalchemy.sql.type_api import TypeEngine
 from sqlmodel import create_engine
 
-from ...conftest import needs_py310
-
 
 def mysql_dump(sql: TypeEngine, *args, **kwargs):
     dialect = sql.compile(dialect=mysql_engine.dialect)
@@ -26,8 +24,7 @@ mysql_engine = create_mock_engine("mysql://", mysql_dump)
 @pytest.fixture(
     name="mod",
     params=[
-        pytest.param("tutorial004_py39"),
-        pytest.param("tutorial004_py310", marks=needs_py310),
+        "tutorial004_py310",
     ],
 )
 def get_module(request: pytest.FixtureRequest) -> Generator[ModuleType, None, None]: