Skip to content

Commit 4968a4c

Browse files
committed
Try to fix Windows issue
1 parent 8241d11 commit 4968a4c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

hatch_build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ 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+
1215
gi = Path('.gitignore')
1316
if gi.exists():
1417
cleaned = gi.read_text().replace('geonamescache/data/', '')

0 commit comments

Comments
 (0)