dirtygit 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(uv sync)",
5
+ "Bash(uv run python -c \"import dirtygit; print\\(dirtygit.check\\(\\)\\)\")"
6
+ ]
7
+ }
8
+ }
@@ -0,0 +1,4 @@
1
+ __pycache__/
2
+ *.egg-info/
3
+ dist/
4
+ .venv/
dirtygit-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mitchell DeHaven
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: dirtygit
3
+ Version: 0.1.0
4
+ Summary: A simple Python library for detecting unclean git states.
5
+ Author: Mitchell DeHaven
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Keywords: experiments,git,reproducibility
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+
14
+ # dirtygit
15
+
16
+ Assert your git repo is clean and get the current commit hash. Useful for ensuring experiment reproducibility.
17
+
18
+ ## Install
19
+
20
+ ```
21
+ pip install dirtygit
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ import dirtygit
28
+
29
+ commit = dirtygit.check() # returns commit hash if clean, asserts if dirty
30
+ ```
@@ -0,0 +1,17 @@
1
+ # dirtygit
2
+
3
+ Assert your git repo is clean and get the current commit hash. Useful for ensuring experiment reproducibility.
4
+
5
+ ## Install
6
+
7
+ ```
8
+ pip install dirtygit
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```python
14
+ import dirtygit
15
+
16
+ commit = dirtygit.check() # returns commit hash if clean, asserts if dirty
17
+ ```
@@ -0,0 +1,17 @@
1
+ [project]
2
+ name = "dirtygit"
3
+ version = "0.1.0"
4
+ description = "A simple Python library for detecting unclean git states."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ requires-python = ">=3.9"
8
+ authors = [{ name = "Mitchell DeHaven" }]
9
+ keywords = ["git", "reproducibility", "experiments"]
10
+ classifiers = [
11
+ "License :: OSI Approved :: MIT License",
12
+ "Programming Language :: Python :: 3",
13
+ ]
14
+
15
+ [build-system]
16
+ requires = ["hatchling"]
17
+ build-backend = "hatchling.build"
@@ -0,0 +1,3 @@
1
+ from dirtygit._core import check
2
+
3
+ __all__ = ["check"]
@@ -0,0 +1,19 @@
1
+ import subprocess
2
+
3
+
4
+ def check() -> str:
5
+ status = subprocess.run(
6
+ ["git", "status", "--porcelain"],
7
+ capture_output=True,
8
+ text=True,
9
+ check=True,
10
+ )
11
+ assert status.stdout == "", f"Git repo is dirty:\n{status.stdout}"
12
+
13
+ result = subprocess.run(
14
+ ["git", "rev-parse", "HEAD"],
15
+ capture_output=True,
16
+ text=True,
17
+ check=True,
18
+ )
19
+ return result.stdout.strip()
dirtygit-0.1.0/uv.lock ADDED
@@ -0,0 +1,8 @@
1
+ version = 1
2
+ revision = 3
3
+ requires-python = ">=3.9"
4
+
5
+ [[package]]
6
+ name = "dirtygit"
7
+ version = "0.1.0"
8
+ source = { editable = "." }