Add python_git: a leak-safe GitPython alternative
Every git invocation runs through a single blocking subprocess.run call in python_git/runner.py that always waits for the process to exit and closes its pipes before returning, so there is no long-lived Popen handle for a caller to forget to close (the root cause of GitPython's known fd/process leaks). Repo exposes status/log/diff/add/commit/push/pull/fetch, branch and remote management, and clone, backed by dataclasses in models.py. Covered by tests/test_repo.py, including an fd-count regression test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
commit
ebe7ec6f4b
15 files changed
+527
No files matched your search
@@ -0,0 +1,15 @@
|
||||
[project]
|
||||
name = "python-git"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = []
|
||||
|
||||
[dependency-groups]
|
||||
dev = ["pytest>=8.0"]
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["python_git"]
|
||||
Reference in new issue
Block a user