1717healthy = helpers .basic_healthy
1818
1919
20- def md5 (s : str ) -> str : # pragma: windows no cover
20+ def md5 (s : str ) -> str : # pragma: win32 no cover
2121 return hashlib .md5 (s .encode ()).hexdigest ()
2222
2323
24- def docker_tag (prefix : Prefix ) -> str : # pragma: windows no cover
24+ def docker_tag (prefix : Prefix ) -> str : # pragma: win32 no cover
2525 md5sum = md5 (os .path .basename (prefix .prefix_dir )).lower ()
2626 return f'pre-commit-{ md5sum } '
2727
2828
29- def docker_is_running () -> bool : # pragma: windows no cover
29+ def docker_is_running () -> bool : # pragma: win32 no cover
3030 try :
3131 cmd_output_b ('docker' , 'ps' )
3232 except CalledProcessError :
@@ -35,7 +35,7 @@ def docker_is_running() -> bool: # pragma: windows no cover
3535 return True
3636
3737
38- def assert_docker_available () -> None : # pragma: windows no cover
38+ def assert_docker_available () -> None : # pragma: win32 no cover
3939 assert docker_is_running (), (
4040 'Docker is either not running or not configured in this environment'
4141 )
@@ -45,7 +45,7 @@ def build_docker_image(
4545 prefix : Prefix ,
4646 * ,
4747 pull : bool ,
48- ) -> None : # pragma: windows no cover
48+ ) -> None : # pragma: win32 no cover
4949 cmd : Tuple [str , ...] = (
5050 'docker' , 'build' ,
5151 '--tag' , docker_tag (prefix ),
@@ -60,7 +60,7 @@ def build_docker_image(
6060
6161def install_environment (
6262 prefix : Prefix , version : str , additional_dependencies : Sequence [str ],
63- ) -> None : # pragma: windows no cover
63+ ) -> None : # pragma: win32 no cover
6464 helpers .assert_version_default ('docker' , version )
6565 helpers .assert_no_additional_deps ('docker' , additional_dependencies )
6666 assert_docker_available ()
@@ -76,14 +76,14 @@ def install_environment(
7676 os .mkdir (directory )
7777
7878
79- def get_docker_user () -> str : # pragma: windows no cover
79+ def get_docker_user () -> str : # pragma: win32 no cover
8080 try :
8181 return f'{ os .getuid ()} :{ os .getgid ()} '
8282 except AttributeError :
8383 return '1000:1000'
8484
8585
86- def docker_cmd () -> Tuple [str , ...]: # pragma: windows no cover
86+ def docker_cmd () -> Tuple [str , ...]: # pragma: win32 no cover
8787 return (
8888 'docker' , 'run' ,
8989 '--rm' ,
@@ -100,7 +100,7 @@ def run_hook(
100100 hook : Hook ,
101101 file_args : Sequence [str ],
102102 color : bool ,
103- ) -> Tuple [int , bytes ]: # pragma: windows no cover
103+ ) -> Tuple [int , bytes ]: # pragma: win32 no cover
104104 assert_docker_available ()
105105 # Rebuild the docker image in case it has gone missing, as many people do
106106 # automated cleanup of docker images.
0 commit comments