gitpure 0.1.0__tar.gz → 0.1.2__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.
- {gitpure-0.1.0 → gitpure-0.1.2}/.github/workflows/CI.yml +51 -23
- {gitpure-0.1.0 → gitpure-0.1.2}/Cargo.lock +11 -12
- gitpure-0.1.2/Cargo.toml +29 -0
- gitpure-0.1.2/LICENSE +21 -0
- gitpure-0.1.2/PKG-INFO +145 -0
- gitpure-0.1.2/README.md +105 -0
- gitpure-0.1.2/gitpure.pyi +108 -0
- gitpure-0.1.2/pyproject.toml +55 -0
- gitpure-0.1.2/renovate.json +8 -0
- gitpure-0.1.2/src/lib.rs +329 -0
- gitpure-0.1.2/tests/test_repo.py +178 -0
- gitpure-0.1.0/Cargo.toml +0 -22
- gitpure-0.1.0/PKG-INFO +0 -9
- gitpure-0.1.0/gitpure.pyi +0 -37
- gitpure-0.1.0/pyproject.toml +0 -20
- gitpure-0.1.0/src/lib.rs +0 -73
- gitpure-0.1.0/tests/test_repo.py +0 -76
- {gitpure-0.1.0 → gitpure-0.1.2}/.gitignore +0 -0
|
@@ -19,6 +19,25 @@ permissions:
|
|
|
19
19
|
contents: read
|
|
20
20
|
|
|
21
21
|
jobs:
|
|
22
|
+
tests:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
26
|
+
- name: Set up Python
|
|
27
|
+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
|
|
28
|
+
with:
|
|
29
|
+
python-version: '3.13'
|
|
30
|
+
- name: Set up Rust toolchain
|
|
31
|
+
uses: dtolnay/rust-toolchain@stable
|
|
32
|
+
- name: Install build tooling
|
|
33
|
+
run: |
|
|
34
|
+
python -m pip install --upgrade pip
|
|
35
|
+
pip install maturin
|
|
36
|
+
- name: Install project with test extras
|
|
37
|
+
run: pip install .[test]
|
|
38
|
+
- name: Run pytest
|
|
39
|
+
run: pytest -s
|
|
40
|
+
|
|
22
41
|
linux:
|
|
23
42
|
runs-on: ${{ matrix.platform.runner }}
|
|
24
43
|
strategy:
|
|
@@ -37,12 +56,12 @@ jobs:
|
|
|
37
56
|
- runner: ubuntu-22.04
|
|
38
57
|
target: ppc64le
|
|
39
58
|
steps:
|
|
40
|
-
- uses: actions/checkout@
|
|
41
|
-
- uses: actions/setup-python@
|
|
59
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
60
|
+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
|
|
42
61
|
with:
|
|
43
62
|
python-version: 3.x
|
|
44
63
|
- name: Build wheels
|
|
45
|
-
uses: PyO3/maturin-action@v1
|
|
64
|
+
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1
|
|
46
65
|
with:
|
|
47
66
|
target: ${{ matrix.platform.target }}
|
|
48
67
|
args: --release --out dist --find-interpreter
|
|
@@ -50,7 +69,7 @@ jobs:
|
|
|
50
69
|
# ring requires a newer version of manylinux on aarch64
|
|
51
70
|
manylinux: ${{ matrix.platform.target == 'aarch64' && '2_28' || 'auto' }}
|
|
52
71
|
- name: Upload wheels
|
|
53
|
-
uses: actions/upload-artifact@v4
|
|
72
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
54
73
|
with:
|
|
55
74
|
name: wheels-linux-${{ matrix.platform.target }}
|
|
56
75
|
path: dist
|
|
@@ -69,19 +88,19 @@ jobs:
|
|
|
69
88
|
- runner: ubuntu-22.04
|
|
70
89
|
target: armv7
|
|
71
90
|
steps:
|
|
72
|
-
- uses: actions/checkout@
|
|
73
|
-
- uses: actions/setup-python@
|
|
91
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
92
|
+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
|
|
74
93
|
with:
|
|
75
94
|
python-version: 3.x
|
|
76
95
|
- name: Build wheels
|
|
77
|
-
uses: PyO3/maturin-action@v1
|
|
96
|
+
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1
|
|
78
97
|
with:
|
|
79
98
|
target: ${{ matrix.platform.target }}
|
|
80
99
|
args: --release --out dist --find-interpreter
|
|
81
100
|
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
82
101
|
manylinux: musllinux_1_2
|
|
83
102
|
- name: Upload wheels
|
|
84
|
-
uses: actions/upload-artifact@v4
|
|
103
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
85
104
|
with:
|
|
86
105
|
name: wheels-musllinux-${{ matrix.platform.target }}
|
|
87
106
|
path: dist
|
|
@@ -96,19 +115,19 @@ jobs:
|
|
|
96
115
|
- runner: windows-latest
|
|
97
116
|
target: x86
|
|
98
117
|
steps:
|
|
99
|
-
- uses: actions/checkout@
|
|
100
|
-
- uses: actions/setup-python@
|
|
118
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
119
|
+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
|
|
101
120
|
with:
|
|
102
121
|
python-version: 3.x
|
|
103
122
|
architecture: ${{ matrix.platform.target }}
|
|
104
123
|
- name: Build wheels
|
|
105
|
-
uses: PyO3/maturin-action@v1
|
|
124
|
+
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1
|
|
106
125
|
with:
|
|
107
126
|
target: ${{ matrix.platform.target }}
|
|
108
127
|
args: --release --out dist --find-interpreter
|
|
109
128
|
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
110
129
|
- name: Upload wheels
|
|
111
|
-
uses: actions/upload-artifact@v4
|
|
130
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
112
131
|
with:
|
|
113
132
|
name: wheels-windows-${{ matrix.platform.target }}
|
|
114
133
|
path: dist
|
|
@@ -123,33 +142,42 @@ jobs:
|
|
|
123
142
|
- runner: macos-14
|
|
124
143
|
target: aarch64
|
|
125
144
|
steps:
|
|
126
|
-
- uses: actions/checkout@
|
|
127
|
-
- uses: actions/setup-python@
|
|
145
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
146
|
+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
|
|
128
147
|
with:
|
|
129
148
|
python-version: 3.x
|
|
130
149
|
- name: Build wheels
|
|
131
|
-
uses: PyO3/maturin-action@v1
|
|
150
|
+
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1
|
|
132
151
|
with:
|
|
133
152
|
target: ${{ matrix.platform.target }}
|
|
134
153
|
args: --release --out dist --find-interpreter
|
|
135
154
|
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
136
155
|
- name: Upload wheels
|
|
137
|
-
uses: actions/upload-artifact@v4
|
|
156
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
138
157
|
with:
|
|
139
158
|
name: wheels-macos-${{ matrix.platform.target }}
|
|
140
159
|
path: dist
|
|
141
160
|
|
|
161
|
+
success:
|
|
162
|
+
name: Success
|
|
163
|
+
runs-on: ubuntu-latest
|
|
164
|
+
needs: [tests, linux, musllinux, windows, macos, sdist]
|
|
165
|
+
if: ${{ !cancelled() && !failure() }}
|
|
166
|
+
steps:
|
|
167
|
+
- name: Mark success
|
|
168
|
+
run: echo "All required jobs completed successfully."
|
|
169
|
+
|
|
142
170
|
sdist:
|
|
143
171
|
runs-on: ubuntu-latest
|
|
144
172
|
steps:
|
|
145
|
-
- uses: actions/checkout@
|
|
173
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
146
174
|
- name: Build sdist
|
|
147
|
-
uses: PyO3/maturin-action@v1
|
|
175
|
+
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1
|
|
148
176
|
with:
|
|
149
177
|
command: sdist
|
|
150
178
|
args: --out dist
|
|
151
179
|
- name: Upload sdist
|
|
152
|
-
uses: actions/upload-artifact@v4
|
|
180
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
153
181
|
with:
|
|
154
182
|
name: wheels-sdist
|
|
155
183
|
path: dist
|
|
@@ -158,7 +186,7 @@ jobs:
|
|
|
158
186
|
name: Release
|
|
159
187
|
runs-on: ubuntu-latest
|
|
160
188
|
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
161
|
-
needs: [linux, musllinux, windows, macos, sdist]
|
|
189
|
+
needs: [tests, linux, musllinux, windows, macos, sdist]
|
|
162
190
|
permissions:
|
|
163
191
|
# Use to sign the release artifacts
|
|
164
192
|
id-token: write
|
|
@@ -170,14 +198,14 @@ jobs:
|
|
|
170
198
|
name: pypi
|
|
171
199
|
url: https://pypi.org/p/gitpure
|
|
172
200
|
steps:
|
|
173
|
-
- uses: actions/download-artifact@
|
|
201
|
+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
|
|
174
202
|
- name: Generate artifact attestation
|
|
175
|
-
uses: actions/attest-build-provenance@
|
|
203
|
+
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
|
|
176
204
|
with:
|
|
177
205
|
subject-path: 'wheels-*/*'
|
|
178
206
|
- name: Publish to PyPI
|
|
179
207
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
180
|
-
uses: PyO3/maturin-action@v1
|
|
208
|
+
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1
|
|
181
209
|
with:
|
|
182
210
|
command: upload
|
|
183
211
|
args: --non-interactive --skip-existing wheels-*/*
|
|
@@ -406,7 +406,7 @@ checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
|
|
|
406
406
|
|
|
407
407
|
[[package]]
|
|
408
408
|
name = "gitpure"
|
|
409
|
-
version = "0.1.
|
|
409
|
+
version = "0.1.2"
|
|
410
410
|
dependencies = [
|
|
411
411
|
"gix",
|
|
412
412
|
"pyo3",
|
|
@@ -1814,9 +1814,9 @@ dependencies = [
|
|
|
1814
1814
|
|
|
1815
1815
|
[[package]]
|
|
1816
1816
|
name = "pyo3"
|
|
1817
|
-
version = "0.
|
|
1817
|
+
version = "0.26.0"
|
|
1818
1818
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1819
|
-
checksum = "
|
|
1819
|
+
checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
|
|
1820
1820
|
dependencies = [
|
|
1821
1821
|
"indoc",
|
|
1822
1822
|
"libc",
|
|
@@ -1831,19 +1831,18 @@ dependencies = [
|
|
|
1831
1831
|
|
|
1832
1832
|
[[package]]
|
|
1833
1833
|
name = "pyo3-build-config"
|
|
1834
|
-
version = "0.
|
|
1834
|
+
version = "0.26.0"
|
|
1835
1835
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1836
|
-
checksum = "
|
|
1836
|
+
checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
|
|
1837
1837
|
dependencies = [
|
|
1838
|
-
"once_cell",
|
|
1839
1838
|
"target-lexicon",
|
|
1840
1839
|
]
|
|
1841
1840
|
|
|
1842
1841
|
[[package]]
|
|
1843
1842
|
name = "pyo3-ffi"
|
|
1844
|
-
version = "0.
|
|
1843
|
+
version = "0.26.0"
|
|
1845
1844
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1846
|
-
checksum = "
|
|
1845
|
+
checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
|
|
1847
1846
|
dependencies = [
|
|
1848
1847
|
"libc",
|
|
1849
1848
|
"pyo3-build-config",
|
|
@@ -1851,9 +1850,9 @@ dependencies = [
|
|
|
1851
1850
|
|
|
1852
1851
|
[[package]]
|
|
1853
1852
|
name = "pyo3-macros"
|
|
1854
|
-
version = "0.
|
|
1853
|
+
version = "0.26.0"
|
|
1855
1854
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1856
|
-
checksum = "
|
|
1855
|
+
checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
|
|
1857
1856
|
dependencies = [
|
|
1858
1857
|
"proc-macro2",
|
|
1859
1858
|
"pyo3-macros-backend",
|
|
@@ -1863,9 +1862,9 @@ dependencies = [
|
|
|
1863
1862
|
|
|
1864
1863
|
[[package]]
|
|
1865
1864
|
name = "pyo3-macros-backend"
|
|
1866
|
-
version = "0.
|
|
1865
|
+
version = "0.26.0"
|
|
1867
1866
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1868
|
-
checksum = "
|
|
1867
|
+
checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
|
|
1869
1868
|
dependencies = [
|
|
1870
1869
|
"heck",
|
|
1871
1870
|
"proc-macro2",
|
gitpure-0.1.2/Cargo.toml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "gitpure"
|
|
3
|
+
version = "0.1.2"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
authors = ["Max Dymond <cmeister2@gmail.com>"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
description = "A Python git library implemented in Rust using gitoxide"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
homepage = "https://github.com/cmeister2/gitpure"
|
|
10
|
+
repository = "https://github.com/cmeister2/gitpure"
|
|
11
|
+
documentation = "https://github.com/cmeister2/gitpure"
|
|
12
|
+
keywords = ["git", "python", "rust", "gitoxide", "version-control"]
|
|
13
|
+
categories = ["development-tools", "api-bindings"]
|
|
14
|
+
|
|
15
|
+
[lib]
|
|
16
|
+
name = "gitpure"
|
|
17
|
+
crate-type = ["cdylib"]
|
|
18
|
+
|
|
19
|
+
[dependencies]
|
|
20
|
+
pyo3 = "0.26.0"
|
|
21
|
+
|
|
22
|
+
[dependencies.gix]
|
|
23
|
+
version = "0.73.0"
|
|
24
|
+
default-features = false
|
|
25
|
+
features = [
|
|
26
|
+
"blocking-http-transport-reqwest-rust-tls",
|
|
27
|
+
"parallel",
|
|
28
|
+
"worktree-mutation"
|
|
29
|
+
]
|
gitpure-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Max Dymond
|
|
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.
|
gitpure-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitpure
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
16
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
17
|
+
Classifier: Programming Language :: Rust
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: Software Development :: Version Control
|
|
20
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
21
|
+
Classifier: Typing :: Typed
|
|
22
|
+
Requires-Dist: pytest ; extra == 'test'
|
|
23
|
+
Requires-Dist: gitpython>=3.1 ; extra == 'test'
|
|
24
|
+
Provides-Extra: test
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Summary: A Python git library implemented in Rust using gitoxide
|
|
27
|
+
Keywords: git,python,rust,gitoxide,version-control
|
|
28
|
+
Home-Page: https://github.com/cmeister2/gitpure
|
|
29
|
+
Author-email: Max Dymond <cmeister2@gmail.com>
|
|
30
|
+
Maintainer-email: Max Dymond <cmeister2@gmail.com>
|
|
31
|
+
License: MIT
|
|
32
|
+
Requires-Python: >=3.8
|
|
33
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
34
|
+
Project-URL: Homepage, https://github.com/cmeister2/gitpure
|
|
35
|
+
Project-URL: Documentation, https://github.com/cmeister2/gitpure
|
|
36
|
+
Project-URL: Repository, https://github.com/cmeister2/gitpure
|
|
37
|
+
Project-URL: Bug Reports, https://github.com/cmeister2/gitpure/issues
|
|
38
|
+
Project-URL: Source Code, https://github.com/cmeister2/gitpure
|
|
39
|
+
|
|
40
|
+
# gitpure
|
|
41
|
+
|
|
42
|
+
[](https://github.com/cmeister2/gitpure/actions/workflows/CI.yml)
|
|
43
|
+
[](https://badge.fury.io/py/gitpure)
|
|
44
|
+
[](https://pypi.org/project/gitpure/)
|
|
45
|
+
|
|
46
|
+
A pure git Python library implemented in Rust using [gitoxide](https://github.com/Byron/gitoxide). This library provides fast and memory-efficient git operations through Python bindings.
|
|
47
|
+
|
|
48
|
+
## Features
|
|
49
|
+
|
|
50
|
+
- **Fast**: Built with Rust and gitoxide for optimal performance
|
|
51
|
+
- **Memory efficient**: Leverages Rust's memory management
|
|
52
|
+
- **Cross-platform**: Works on Linux, macOS, and Windows
|
|
53
|
+
- **Pure Python interface**: Easy to use Python API
|
|
54
|
+
- **Safe**: Thread-safe operations with Rust's ownership model
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
Install from PyPI:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install gitpure
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
import gitpure
|
|
68
|
+
|
|
69
|
+
# Clone a repository (with worktree)
|
|
70
|
+
repo = gitpure.Repo.clone_from("https://github.com/user/repo.git", "/path/to/local/repo")
|
|
71
|
+
|
|
72
|
+
# Clone a bare repository
|
|
73
|
+
bare_repo = gitpure.Repo.clone_from("https://github.com/user/repo.git", "/path/to/bare/repo", bare=True)
|
|
74
|
+
|
|
75
|
+
# Get the git directory path
|
|
76
|
+
git_dir = repo.git_dir
|
|
77
|
+
print(f"Git directory: {git_dir}")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Development
|
|
81
|
+
|
|
82
|
+
### Prerequisites
|
|
83
|
+
|
|
84
|
+
- Python 3.8+
|
|
85
|
+
- Rust 1.70+
|
|
86
|
+
- maturin
|
|
87
|
+
|
|
88
|
+
### Building from Source
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Clone the repository
|
|
92
|
+
git clone https://github.com/cmeister2/gitpure.git
|
|
93
|
+
cd gitpure
|
|
94
|
+
|
|
95
|
+
# Create a virtual environment
|
|
96
|
+
python -m venv venv
|
|
97
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
98
|
+
|
|
99
|
+
# Install maturin
|
|
100
|
+
pip install maturin
|
|
101
|
+
|
|
102
|
+
# Build and install in development mode
|
|
103
|
+
maturin develop
|
|
104
|
+
|
|
105
|
+
# Or build wheel
|
|
106
|
+
maturin build --release
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Running Tests
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Install test dependencies
|
|
113
|
+
pip install pytest
|
|
114
|
+
|
|
115
|
+
# Run tests
|
|
116
|
+
pytest tests/
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Architecture
|
|
120
|
+
|
|
121
|
+
gitpure is built on top of:
|
|
122
|
+
|
|
123
|
+
- **[gitoxide](https://github.com/Byron/gitoxide)**: A pure Rust implementation of git
|
|
124
|
+
- **[PyO3](https://github.com/PyO3/pyo3)**: Python bindings for Rust
|
|
125
|
+
- **[maturin](https://github.com/PyO3/maturin)**: Build tool for Python extensions written in Rust
|
|
126
|
+
|
|
127
|
+
## Contributing
|
|
128
|
+
|
|
129
|
+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|
|
130
|
+
|
|
131
|
+
### Development Setup
|
|
132
|
+
|
|
133
|
+
1. Fork the repository
|
|
134
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
135
|
+
3. Make your changes
|
|
136
|
+
4. Add tests for your changes
|
|
137
|
+
5. Ensure all tests pass (`pytest`)
|
|
138
|
+
6. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
139
|
+
7. Push to the branch (`git push origin feature/amazing-feature`)
|
|
140
|
+
8. Open a Pull Request
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
145
|
+
|
gitpure-0.1.2/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# gitpure
|
|
2
|
+
|
|
3
|
+
[](https://github.com/cmeister2/gitpure/actions/workflows/CI.yml)
|
|
4
|
+
[](https://badge.fury.io/py/gitpure)
|
|
5
|
+
[](https://pypi.org/project/gitpure/)
|
|
6
|
+
|
|
7
|
+
A pure git Python library implemented in Rust using [gitoxide](https://github.com/Byron/gitoxide). This library provides fast and memory-efficient git operations through Python bindings.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Fast**: Built with Rust and gitoxide for optimal performance
|
|
12
|
+
- **Memory efficient**: Leverages Rust's memory management
|
|
13
|
+
- **Cross-platform**: Works on Linux, macOS, and Windows
|
|
14
|
+
- **Pure Python interface**: Easy to use Python API
|
|
15
|
+
- **Safe**: Thread-safe operations with Rust's ownership model
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Install from PyPI:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install gitpure
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
import gitpure
|
|
29
|
+
|
|
30
|
+
# Clone a repository (with worktree)
|
|
31
|
+
repo = gitpure.Repo.clone_from("https://github.com/user/repo.git", "/path/to/local/repo")
|
|
32
|
+
|
|
33
|
+
# Clone a bare repository
|
|
34
|
+
bare_repo = gitpure.Repo.clone_from("https://github.com/user/repo.git", "/path/to/bare/repo", bare=True)
|
|
35
|
+
|
|
36
|
+
# Get the git directory path
|
|
37
|
+
git_dir = repo.git_dir
|
|
38
|
+
print(f"Git directory: {git_dir}")
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Development
|
|
42
|
+
|
|
43
|
+
### Prerequisites
|
|
44
|
+
|
|
45
|
+
- Python 3.8+
|
|
46
|
+
- Rust 1.70+
|
|
47
|
+
- maturin
|
|
48
|
+
|
|
49
|
+
### Building from Source
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Clone the repository
|
|
53
|
+
git clone https://github.com/cmeister2/gitpure.git
|
|
54
|
+
cd gitpure
|
|
55
|
+
|
|
56
|
+
# Create a virtual environment
|
|
57
|
+
python -m venv venv
|
|
58
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
59
|
+
|
|
60
|
+
# Install maturin
|
|
61
|
+
pip install maturin
|
|
62
|
+
|
|
63
|
+
# Build and install in development mode
|
|
64
|
+
maturin develop
|
|
65
|
+
|
|
66
|
+
# Or build wheel
|
|
67
|
+
maturin build --release
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Running Tests
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Install test dependencies
|
|
74
|
+
pip install pytest
|
|
75
|
+
|
|
76
|
+
# Run tests
|
|
77
|
+
pytest tests/
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Architecture
|
|
81
|
+
|
|
82
|
+
gitpure is built on top of:
|
|
83
|
+
|
|
84
|
+
- **[gitoxide](https://github.com/Byron/gitoxide)**: A pure Rust implementation of git
|
|
85
|
+
- **[PyO3](https://github.com/PyO3/pyo3)**: Python bindings for Rust
|
|
86
|
+
- **[maturin](https://github.com/PyO3/maturin)**: Build tool for Python extensions written in Rust
|
|
87
|
+
|
|
88
|
+
## Contributing
|
|
89
|
+
|
|
90
|
+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|
|
91
|
+
|
|
92
|
+
### Development Setup
|
|
93
|
+
|
|
94
|
+
1. Fork the repository
|
|
95
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
96
|
+
3. Make your changes
|
|
97
|
+
4. Add tests for your changes
|
|
98
|
+
5. Ensure all tests pass (`pytest`)
|
|
99
|
+
6. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
100
|
+
7. Push to the branch (`git push origin feature/amazing-feature`)
|
|
101
|
+
8. Open a Pull Request
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Type stubs for gitpure - A pure git Python module implemented in Rust.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Type
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Commit:
|
|
10
|
+
"""Lightweight representation of a git commit."""
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def hexsha(self) -> str:
|
|
14
|
+
"""Hexadecimal object id of the commit."""
|
|
15
|
+
...
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Head:
|
|
19
|
+
"""A named reference to a commit, mirroring GitPython's Head."""
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def name(self) -> str:
|
|
23
|
+
"""The short name of the head (branch)."""
|
|
24
|
+
...
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def commit(self) -> Commit | None:
|
|
28
|
+
"""The commit the head points to, if available."""
|
|
29
|
+
...
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class Tag:
|
|
33
|
+
"""A tag reference with optional peeled commit."""
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def name(self) -> str:
|
|
37
|
+
"""The short name of the tag."""
|
|
38
|
+
...
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def commit(self) -> Commit | None:
|
|
42
|
+
"""The commit the tag ultimately refers to, if available."""
|
|
43
|
+
...
|
|
44
|
+
|
|
45
|
+
class Repo:
|
|
46
|
+
"""A git repository wrapper using gix (gitoxide)."""
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def git_dir(self) -> Path:
|
|
50
|
+
"""
|
|
51
|
+
Path to the .git directory of the repository.
|
|
52
|
+
|
|
53
|
+
Returns:
|
|
54
|
+
The absolute path to the .git directory as a pathlib.Path object
|
|
55
|
+
"""
|
|
56
|
+
...
|
|
57
|
+
|
|
58
|
+
def branches(self) -> list[str]:
|
|
59
|
+
"""Return the names of all local branches in the repository."""
|
|
60
|
+
...
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def working_tree_dir(self) -> Path | None:
|
|
64
|
+
"""Return the working tree directory of the repository, if it exists."""
|
|
65
|
+
...
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def is_bare(self) -> bool:
|
|
69
|
+
"""Whether the repository is bare (has no working tree)."""
|
|
70
|
+
...
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def active_branch(self) -> Head | None:
|
|
74
|
+
"""Current active branch as a Head object, if available."""
|
|
75
|
+
...
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def head(self) -> Head | None:
|
|
79
|
+
"""HEAD reference as a Head object, if available."""
|
|
80
|
+
...
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def heads(self) -> list[Head]:
|
|
84
|
+
"""Return all local heads (branches) in the repository."""
|
|
85
|
+
...
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def tags(self) -> list[Tag]:
|
|
89
|
+
"""Return all tags in the repository."""
|
|
90
|
+
...
|
|
91
|
+
|
|
92
|
+
@classmethod
|
|
93
|
+
def clone_from(cls: Type["Repo"], url: str, to_path: str, bare: bool = False) -> "Repo":
|
|
94
|
+
"""
|
|
95
|
+
Clone a repository from a URL to a local path.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
url: The URL of the repository to clone
|
|
99
|
+
to_path: The local path where the repository should be cloned
|
|
100
|
+
bare: Whether to create a bare repository (default: False)
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
A new Repo instance representing the cloned repository
|
|
104
|
+
|
|
105
|
+
Raises:
|
|
106
|
+
RuntimeError: If the clone operation fails
|
|
107
|
+
"""
|
|
108
|
+
...
|