2626WINDOWS = os .name == "nt"
2727PTY = not WINDOWS and not CI
2828MULTIRUN = os .environ .get ("MULTIRUN" , "0" ) == "1"
29+ PY_VERSION = f"{ sys .version_info .major } { sys .version_info .minor } "
30+ PY_DEV = "314"
2931
3032
3133def pyprefix (title : str ) -> str :
@@ -84,7 +86,7 @@ def check(ctx: Context) -> None:
8486 """Check it all!"""
8587
8688
87- @duty
89+ @duty ( nofail = PY_VERSION == PY_DEV )
8890def check_quality (ctx : Context ) -> None :
8991 """Check the code quality."""
9092 ctx .run (
@@ -93,7 +95,7 @@ def check_quality(ctx: Context) -> None:
9395 )
9496
9597
96- @duty (skip_if = sys .version_info < (3 , 13 ), skip_reason = pyprefix ("Skipped: docs require modern generics syntax" ))
98+ @duty (nofail = PY_VERSION == PY_DEV , skip_if = sys .version_info < (3 , 13 ), skip_reason = pyprefix ("Skipped: docs require modern generics syntax" ))
9799def check_docs (ctx : Context ) -> None :
98100 """Check if the documentation builds correctly."""
99101 Path ("htmlcov" ).mkdir (parents = True , exist_ok = True )
@@ -105,7 +107,7 @@ def check_docs(ctx: Context) -> None:
105107 )
106108
107109
108- @duty
110+ @duty ( nofail = PY_VERSION == PY_DEV )
109111def check_types (ctx : Context ) -> None :
110112 """Check that the code is correctly typed."""
111113 os .environ ["MYPYPATH" ] = "src"
@@ -118,7 +120,7 @@ def check_types(ctx: Context) -> None:
118120 )
119121
120122
121- @duty
123+ @duty ( nofail = PY_VERSION == PY_DEV )
122124def check_api (ctx : Context , * cli_args : str ) -> None :
123125 """Check for API breaking changes."""
124126 ctx .run (
@@ -239,25 +241,31 @@ def coverage(ctx: Context) -> None:
239241 ctx .run (tools .coverage .html (rcfile = "config/coverage.ini" ))
240242
241243
242- @duty
244+ @duty ( nofail = PY_VERSION == PY_DEV )
243245def test (ctx : Context , * cli_args : str , match : str = "" , snapshot : str = "report" ) -> None : # noqa: PT028
244246 """Run the test suite.
245247
246248 Parameters:
247249 match: A pytest expression to filter selected tests.
248250 snapshot: Whether to "create", "fix", "trim", or "update" snapshots.
249251 """
250- py_version = f"{ sys . version_info . major } { sys . version_info . minor } "
251- os .environ ["COVERAGE_FILE " ] = f".coverage. { py_version } "
252+ os . environ [ "COVERAGE_FILE" ] = f".coverage. { PY_VERSION } "
253+ os .environ ["PYTHONWARNDEFAULTENCODING " ] = "1 "
252254 args = list (cli_args )
253255 if snapshot == "disable" or not snapshot :
254256 args = ["-n" , "auto" , "--inline-snapshot=disable" ]
255257 else :
256258 args = [f"--inline-snapshot={ snapshot } " ]
259+
260+ config_file = "config/pytest.ini"
261+ # YORE: EOL 3.9: Remove block.
262+ if sys .version_info [:2 ] < (3 , 10 ):
263+ config_file = "config/pytest_39.ini"
264+
257265 ctx .run (
258266 tools .pytest (
259267 "tests" ,
260- config_file = "config/pytest.ini" ,
268+ config_file = config_file ,
261269 select = match ,
262270 color = "yes" ,
263271 ).add_args (* args ),
0 commit comments