@@ -43,21 +43,19 @@ def tests(session):
4343 coverage = ["python" , "-m" , "coverage" ]
4444
4545 session .install (* nox .project .dependency_groups (PYPROJECT , "test" ))
46- session .install ("." )
46+ session .install ("-e ." )
4747 env = {} if session .python != "3.14" else {"COVERAGE_CORE" : "sysmon" }
4848
4949 if "pypy" not in session .python :
5050 session .run (
5151 * coverage ,
5252 "run" ,
53- "--source" ,
54- "packaging" ,
5553 "-m" ,
5654 "pytest" ,
5755 * session .posargs ,
5856 env = env ,
5957 )
60- session .run (* coverage , "report" , "-m" , "--fail-under" , "100" )
58+ session .run (* coverage , "report" )
6159 else :
6260 # Don't do coverage tracking for PyPy, since it's SLOW.
6361 session .run (
@@ -237,6 +235,7 @@ def _check_git_state(session, version_tag):
237235 ]
238236 result = subprocess .run (
239237 ["git" , "remote" , "get-url" , "--push" , "upstream" ],
238+ check = False ,
240239 capture_output = True ,
241240 encoding = "utf-8" ,
242241 )
@@ -245,6 +244,7 @@ def _check_git_state(session, version_tag):
245244 # Ensure we're on main branch for cutting a release.
246245 result = subprocess .run (
247246 ["git" , "rev-parse" , "--abbrev-ref" , "HEAD" ],
247+ check = False ,
248248 capture_output = True ,
249249 encoding = "utf-8" ,
250250 )
@@ -253,15 +253,21 @@ def _check_git_state(session, version_tag):
253253
254254 # Ensure there are no uncommitted changes.
255255 result = subprocess .run (
256- ["git" , "status" , "--porcelain" ], capture_output = True , encoding = "utf-8"
256+ ["git" , "status" , "--porcelain" ],
257+ check = False ,
258+ capture_output = True ,
259+ encoding = "utf-8" ,
257260 )
258261 if result .stdout :
259262 print (result .stdout , end = "" , file = sys .stderr )
260263 session .error ("The working tree has uncommitted changes" )
261264
262265 # Ensure this tag doesn't exist already.
263266 result = subprocess .run (
264- ["git" , "rev-parse" , version_tag ], capture_output = True , encoding = "utf-8"
267+ ["git" , "rev-parse" , version_tag ],
268+ check = False ,
269+ capture_output = True ,
270+ encoding = "utf-8" ,
265271 )
266272 if not result .returncode :
267273 session .error (f"Tag already exists! { version_tag } -- { result .stdout !r} " )
@@ -280,30 +286,26 @@ def _bump(session, *, version, file, kind):
280286 file .write_text (new_contents )
281287
282288 session .log ("git commit" )
283- subprocess .run (["git" , "add" , str (file )])
284- subprocess .run (["git" , "commit" , "-m" , f"Bump for { kind } " ])
289+ subprocess .run (["git" , "add" , str (file )], check = False )
290+ subprocess .run (["git" , "commit" , "-m" , f"Bump for { kind } " ], check = False )
285291
286292
287293@contextlib .contextmanager
288294def _replace_file (original_path ):
289295 # Create a temporary file.
290296 fh , replacement_path = tempfile .mkstemp ()
291297
292- try :
293- with os .fdopen (fh , "w" ) as replacement :
294- with open (original_path ) as original :
295- yield original , replacement
296- except Exception :
297- raise
298- else :
299- shutil .copymode (original_path , replacement_path )
300- os .remove (original_path )
301- shutil .move (replacement_path , original_path )
298+ with os .fdopen (fh , "w" ) as replacement , open (original_path ) as original :
299+ yield original , replacement
300+
301+ shutil .copymode (original_path , replacement_path )
302+ os .remove (original_path )
303+ shutil .move (replacement_path , original_path )
302304
303305
304306def _changelog_update_unreleased_title (version , * , file ):
305307 """Update an "*unreleased*" heading to "{version} - {date}" """
306- yyyy_mm_dd = datetime .datetime .today ( ).strftime ("%Y-%m-%d" )
308+ yyyy_mm_dd = datetime .datetime .now ( tz = datetime . timezone . utc ).strftime ("%Y-%m-%d" )
307309 title = f"{ version } - { yyyy_mm_dd } "
308310
309311 with _replace_file (file ) as (original , replacement ):
0 commit comments