@@ -319,18 +319,27 @@ def update_vendored_files():
319
319
fname .write_bytes (new )
320
320
321
321
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
+
322
327
@task ()
323
328
def upgrade_requirements ():
324
329
update_vendored_files ()
325
330
compile_requirements (upgrade = True )
326
331
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. "
333
338
)
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 " )
334
343
update_python_versions ()
335
344
subprocess .call (["git" , "add" , "." ], cwd = tools .ROOT )
336
345
0 commit comments