@@ -319,18 +319,27 @@ def update_vendored_files():
319319 fname .write_bytes (new )
320320
321321
322+ def has_diff (file_or_directory ):
323+ diff = ["git" , "diff" , "--no-patch" , "--exit-code" , "--" , file_or_directory ]
324+ return subprocess .call (diff ) != 0
325+
326+
322327@task ()
323328def upgrade_requirements ():
324329 update_vendored_files ()
325330 compile_requirements (upgrade = True )
326331 subprocess .call (["./build.sh" , "format" ], cwd = tools .ROOT ) # exits 1 if changed
327- diff = [ "git" , "diff" , "--no-patch" , "--exit-code" , "--" , hp .PYTHON_SRC ]
328- if subprocess . call ( diff ) != 0 and not os . path . isfile ( hp .RELEASE_FILE ):
329- with open ( hp . RELEASE_FILE , mode = "w" ) as f :
330- f . write (
331- "RELEASE_TYPE: patch \n \n This patch updates our autoformatting "
332- "tools, improving our code style without any API changes. \n "
332+ if has_diff ( hp . PYTHON_SRC ) and not os . path . isfile ( hp .RELEASE_FILE ):
333+ if has_diff ( f" { hp .PYTHON_SRC } /hypothesis/vendor/tlds-alpha-by-domain.txt" ):
334+ msg = (
335+ "our vendored `list of top-level domains "
336+ "<https://www.iana.org/domains/root/db>`__, \n which is used by the "
337+ "provisional :func:`~hypothesis.provisional.domains` strategy. "
333338 )
339+ else :
340+ msg = "our autoformatting tools, improving our code style without any API changes."
341+ with open (hp .RELEASE_FILE , mode = "w" ) as f :
342+ f .write (f"RELEASE_TYPE: patch\n \n This patch updates { msg } \n " )
334343 update_python_versions ()
335344 subprocess .call (["git" , "add" , "." ], cwd = tools .ROOT )
336345
0 commit comments