Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
include:
- os: windows-latest
python_version: 'msys2'
env:
# Enable tracemalloc to debug gc errors with popen objects (especially on Windows)
PYTHONTRACEMALLOC: "1"

name: ${{ matrix.os }} - Python ${{ matrix.python_version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ filterwarnings = [
log_level = "debug"
log_cli_level = "info"
# disable unraisable until investigated
addopts = ["-ra", "--strict-config", "--strict-markers", "-p", "no:unraisableexception"]
addopts = ["-ra", "--strict-config", "--strict-markers"]
markers = [
"issue(id): reference to github issue",
"skip_commit: allows to skip committing in the helpers",
Expand Down
10 changes: 9 additions & 1 deletion src/setuptools_scm/_file_finders/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,16 @@ def _git_ls_files_and_dirs(toplevel: str) -> tuple[set[str], set[str]]:
# ensure we avoid resource warnings by cleaning up the process
proc.stdout.close()
proc.terminate()
# Wait for process to actually terminate and be reaped
try:
proc.wait(timeout=5) # Add timeout to avoid hanging
except subprocess.TimeoutExpired:
log.warning("git archive process did not terminate gracefully, killing")
proc.kill()
proc.wait()
except Exception:
if proc.wait() != 0:
# proc.wait() already called in finally block, check if it failed
if proc.returncode != 0:
log.error("listing git files failed - pretending there aren't any")
return set(), set()

Expand Down
Loading