File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,17 +9,18 @@ class GitignoreBuildHook(BuildHookInterface):
99 def initialize (self , _version , _build_data ):
1010 """Temporarily modify .gitignore so data is included when the sdist is installed using pip. """
1111
12- # On Windows .gitignore.tmp may already exist and cause an error, when calling rename later.
13- Path ('.gitignore.tmp' ).unlink (missing_ok = True )
14-
1512 gi = Path ('.gitignore' )
1613 if gi .exists ():
1714 cleaned = gi .read_text ().replace ('geonamescache/data/' , '' )
15+ # On Windows .gitignore.tmp may already exist and cause an error, when calling rename.
16+ Path ('.gitignore.tmp' ).unlink (missing_ok = True )
1817 gi .rename ('.gitignore.tmp' )
1918 Path ('.gitignore' ).write_text (cleaned )
2019
2120
2221 def finalize (self , _version , _build_data , _artifact ):
2322 gi = Path ('.gitignore.tmp' )
2423 if gi .exists ():
24+ # On Windows .gitignore may already exist and cause an error, when calling rename.
25+ Path ('.gitignore' ).unlink (missing_ok = True )
2526 gi .rename ('.gitignore' )
You can’t perform that action at this time.
0 commit comments