gitpure 1.0.0__tar.gz → 1.0.1__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-1.0.0 → gitpure-1.0.1}/.github/workflows/CI.yml +9 -15
- {gitpure-1.0.0 → gitpure-1.0.1}/.releaserc.json +1 -1
- {gitpure-1.0.0 → gitpure-1.0.1}/Cargo.lock +1 -1
- {gitpure-1.0.0 → gitpure-1.0.1}/Cargo.toml +1 -1
- {gitpure-1.0.0 → gitpure-1.0.1}/PKG-INFO +2 -2
- {gitpure-1.0.0 → gitpure-1.0.1}/README.md +1 -1
- {gitpure-1.0.0 → gitpure-1.0.1}/gitpure.pyi +3 -2
- {gitpure-1.0.0 → gitpure-1.0.1}/package-lock.json +9 -4
- gitpure-1.0.1/package.json +8 -0
- {gitpure-1.0.0 → gitpure-1.0.1}/src/lib.rs +7 -27
- {gitpure-1.0.0 → gitpure-1.0.1}/tests/test_repo.py +5 -5
- gitpure-1.0.0/package.json +0 -8
- {gitpure-1.0.0 → gitpure-1.0.1}/.gitignore +0 -0
- {gitpure-1.0.0 → gitpure-1.0.1}/LICENSE +0 -0
- {gitpure-1.0.0 → gitpure-1.0.1}/pyproject.toml +0 -0
- {gitpure-1.0.0 → gitpure-1.0.1}/renovate.json +0 -0
|
@@ -17,7 +17,7 @@ permissions:
|
|
|
17
17
|
jobs:
|
|
18
18
|
# Determine the next version of the codebase.
|
|
19
19
|
get-next-version:
|
|
20
|
-
uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@v4
|
|
20
|
+
uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@0cdefe1224944c23645e5131f7a5189672c0df92 # v4
|
|
21
21
|
permissions:
|
|
22
22
|
contents: write
|
|
23
23
|
|
|
@@ -46,7 +46,7 @@ jobs:
|
|
|
46
46
|
- name: Set up Rust toolchain
|
|
47
47
|
uses: dtolnay/rust-toolchain@stable
|
|
48
48
|
- name: Set Cargo.toml package version
|
|
49
|
-
uses: colt-1/toml-editor@1.1.1
|
|
49
|
+
uses: colt-1/toml-editor@da6b46ee7779ed730d2160393ed95fb20e82696d # 1.1.1
|
|
50
50
|
with:
|
|
51
51
|
file: Cargo.toml
|
|
52
52
|
key: package.version
|
|
@@ -84,7 +84,7 @@ jobs:
|
|
|
84
84
|
with:
|
|
85
85
|
python-version: 3.x
|
|
86
86
|
- name: Set Cargo.toml package version
|
|
87
|
-
uses: colt-1/toml-editor@1.1.1
|
|
87
|
+
uses: colt-1/toml-editor@da6b46ee7779ed730d2160393ed95fb20e82696d # 1.1.1
|
|
88
88
|
with:
|
|
89
89
|
file: Cargo.toml
|
|
90
90
|
key: package.version
|
|
@@ -123,7 +123,7 @@ jobs:
|
|
|
123
123
|
with:
|
|
124
124
|
python-version: 3.x
|
|
125
125
|
- name: Set Cargo.toml package version
|
|
126
|
-
uses: colt-1/toml-editor@1.1.1
|
|
126
|
+
uses: colt-1/toml-editor@da6b46ee7779ed730d2160393ed95fb20e82696d # 1.1.1
|
|
127
127
|
with:
|
|
128
128
|
file: Cargo.toml
|
|
129
129
|
key: package.version
|
|
@@ -158,7 +158,7 @@ jobs:
|
|
|
158
158
|
python-version: 3.x
|
|
159
159
|
architecture: ${{ matrix.platform.target }}
|
|
160
160
|
- name: Set Cargo.toml package version
|
|
161
|
-
uses: colt-1/toml-editor@1.1.1
|
|
161
|
+
uses: colt-1/toml-editor@da6b46ee7779ed730d2160393ed95fb20e82696d # 1.1.1
|
|
162
162
|
with:
|
|
163
163
|
file: Cargo.toml
|
|
164
164
|
key: package.version
|
|
@@ -191,7 +191,7 @@ jobs:
|
|
|
191
191
|
with:
|
|
192
192
|
python-version: 3.x
|
|
193
193
|
- name: Set Cargo.toml package version
|
|
194
|
-
uses: colt-1/toml-editor@1.1.1
|
|
194
|
+
uses: colt-1/toml-editor@da6b46ee7779ed730d2160393ed95fb20e82696d # 1.1.1
|
|
195
195
|
with:
|
|
196
196
|
file: Cargo.toml
|
|
197
197
|
key: package.version
|
|
@@ -214,7 +214,7 @@ jobs:
|
|
|
214
214
|
steps:
|
|
215
215
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
216
216
|
- name: Set Cargo.toml package version
|
|
217
|
-
uses: colt-1/toml-editor@1.1.1
|
|
217
|
+
uses: colt-1/toml-editor@da6b46ee7779ed730d2160393ed95fb20e82696d # 1.1.1
|
|
218
218
|
with:
|
|
219
219
|
file: Cargo.toml
|
|
220
220
|
key: package.version
|
|
@@ -249,7 +249,7 @@ jobs:
|
|
|
249
249
|
url: https://pypi.org/p/gitpure
|
|
250
250
|
steps:
|
|
251
251
|
- name: Checkout
|
|
252
|
-
uses: actions/checkout@v5
|
|
252
|
+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
253
253
|
with:
|
|
254
254
|
fetch-depth: 0
|
|
255
255
|
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
|
|
@@ -257,22 +257,16 @@ jobs:
|
|
|
257
257
|
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3
|
|
258
258
|
with:
|
|
259
259
|
subject-path: 'wheels-*/*'
|
|
260
|
-
- name: Install semantic-release-cargo
|
|
261
|
-
run: cargo install --locked semantic-release-cargo
|
|
262
|
-
|
|
263
260
|
- name: Set up Node.js
|
|
264
|
-
uses: actions/setup-node@
|
|
261
|
+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
|
|
265
262
|
with:
|
|
266
263
|
node-version: 'lts/*'
|
|
267
|
-
|
|
268
264
|
- name: Install npm dependencies
|
|
269
265
|
run: npm ci
|
|
270
|
-
|
|
271
266
|
- name: Run semantic-release
|
|
272
267
|
env:
|
|
273
268
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
274
269
|
run: npx semantic-release
|
|
275
|
-
|
|
276
270
|
- name: Publish to PyPI
|
|
277
271
|
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1
|
|
278
272
|
with:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitpure
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -121,7 +121,7 @@ pytest tests/
|
|
|
121
121
|
Releases are fully automated with [semantic-release](https://semantic-release.gitbook.io/). The pipeline will:
|
|
122
122
|
|
|
123
123
|
1. Inspect the commit history on `main` using Conventional Commits to determine the next semantic version.
|
|
124
|
-
2. Prepare the Rust crate
|
|
124
|
+
2. Prepare the Rust crate, using the next version (or a dev version if available).
|
|
125
125
|
3. Build wheels and source distributions with `maturin` and attach them to the GitHub release.
|
|
126
126
|
4. Publish the distribution artifacts to PyPI.
|
|
127
127
|
|
|
@@ -82,7 +82,7 @@ pytest tests/
|
|
|
82
82
|
Releases are fully automated with [semantic-release](https://semantic-release.gitbook.io/). The pipeline will:
|
|
83
83
|
|
|
84
84
|
1. Inspect the commit history on `main` using Conventional Commits to determine the next semantic version.
|
|
85
|
-
2. Prepare the Rust crate
|
|
85
|
+
2. Prepare the Rust crate, using the next version (or a dev version if available).
|
|
86
86
|
3. Build wheels and source distributions with `maturin` and attach them to the GitHub release.
|
|
87
87
|
4. Publish the distribution artifacts to PyPI.
|
|
88
88
|
|
|
@@ -55,8 +55,9 @@ class Repo:
|
|
|
55
55
|
"""
|
|
56
56
|
...
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
@property
|
|
59
|
+
def branches(self) -> list[Head]:
|
|
60
|
+
"""Return all local branches as Head objects."""
|
|
60
61
|
...
|
|
61
62
|
|
|
62
63
|
@property
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"packages": {
|
|
6
6
|
"": {
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@semantic-release/commit-analyzer": "
|
|
9
|
-
"@semantic-release/exec": "
|
|
10
|
-
"@semantic-release/release-notes-generator": "
|
|
11
|
-
"semantic-release": "
|
|
8
|
+
"@semantic-release/commit-analyzer": "13.0.1",
|
|
9
|
+
"@semantic-release/exec": "7.1.0",
|
|
10
|
+
"@semantic-release/release-notes-generator": "14.1.0",
|
|
11
|
+
"semantic-release": "24.2.9"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"node_modules/@babel/code-frame": {
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"integrity": "sha512-t54CUOsFMappY1Jbzb7fetWeO0n6K0k/4+/ZpkS+3Joz8I4VcvY9OiEBFRYISqaI2fq5sCiPtAjRDOzVYG8m+Q==",
|
|
64
64
|
"dev": true,
|
|
65
65
|
"license": "MIT",
|
|
66
|
+
"peer": true,
|
|
66
67
|
"dependencies": {
|
|
67
68
|
"@octokit/auth-token": "^6.0.0",
|
|
68
69
|
"@octokit/graphql": "^9.0.2",
|
|
@@ -1955,6 +1956,7 @@
|
|
|
1955
1956
|
"integrity": "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA==",
|
|
1956
1957
|
"dev": true,
|
|
1957
1958
|
"license": "MIT",
|
|
1959
|
+
"peer": true,
|
|
1958
1960
|
"bin": {
|
|
1959
1961
|
"marked": "bin/marked.js"
|
|
1960
1962
|
},
|
|
@@ -4596,6 +4598,7 @@
|
|
|
4596
4598
|
"dev": true,
|
|
4597
4599
|
"inBundle": true,
|
|
4598
4600
|
"license": "MIT",
|
|
4601
|
+
"peer": true,
|
|
4599
4602
|
"engines": {
|
|
4600
4603
|
"node": ">=12"
|
|
4601
4604
|
},
|
|
@@ -5275,6 +5278,7 @@
|
|
|
5275
5278
|
"integrity": "sha512-phCkJ6pjDi9ANdhuF5ElS10GGdAKY6R1Pvt9lT3SFhOwM4T7QZE7MLpBDbNruUx/Q3gFD92/UOFringGipRqZA==",
|
|
5276
5279
|
"dev": true,
|
|
5277
5280
|
"license": "MIT",
|
|
5281
|
+
"peer": true,
|
|
5278
5282
|
"dependencies": {
|
|
5279
5283
|
"@semantic-release/commit-analyzer": "^13.0.0-beta.1",
|
|
5280
5284
|
"@semantic-release/error": "^4.0.0",
|
|
@@ -5931,6 +5935,7 @@
|
|
|
5931
5935
|
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
|
5932
5936
|
"dev": true,
|
|
5933
5937
|
"license": "MIT",
|
|
5938
|
+
"peer": true,
|
|
5934
5939
|
"engines": {
|
|
5935
5940
|
"node": ">=12"
|
|
5936
5941
|
},
|
|
@@ -120,7 +120,7 @@ struct Repo {
|
|
|
120
120
|
inner: gix::Repository,
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
fn path_to_python(py: Python<'_>, path: &Path) -> PyResult<
|
|
123
|
+
fn path_to_python(py: Python<'_>, path: &Path) -> PyResult<Py<PyAny>> {
|
|
124
124
|
let pathlib = py.import("pathlib")?;
|
|
125
125
|
let path_class = pathlib.getattr("Path")?;
|
|
126
126
|
Ok(path_class.call1((path.as_os_str(),))?.into())
|
|
@@ -138,13 +138,13 @@ fn shorten_reference_name(reference: &gix::Reference) -> String {
|
|
|
138
138
|
impl Repo {
|
|
139
139
|
/// The path to the `.git` directory of the repository.
|
|
140
140
|
#[getter]
|
|
141
|
-
fn git_dir(&self, py: Python) -> PyResult<
|
|
141
|
+
fn git_dir(&self, py: Python) -> PyResult<Py<PyAny>> {
|
|
142
142
|
path_to_python(py, self.inner.git_dir())
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
/// The path to the working tree directory, if present.
|
|
146
146
|
#[getter]
|
|
147
|
-
fn working_tree_dir(&self, py: Python) -> PyResult<Option<
|
|
147
|
+
fn working_tree_dir(&self, py: Python) -> PyResult<Option<Py<PyAny>>> {
|
|
148
148
|
match self.inner.workdir() {
|
|
149
149
|
Some(path) => Ok(Some(path_to_python(py, path)?)),
|
|
150
150
|
None => Ok(None),
|
|
@@ -202,30 +202,10 @@ impl Repo {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
/// Return
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
})?;
|
|
210
|
-
|
|
211
|
-
let iter = platform.local_branches().map_err(|err| {
|
|
212
|
-
PyRuntimeError::new_err(format!("Failed to list local branches: {err}"))
|
|
213
|
-
})?;
|
|
214
|
-
|
|
215
|
-
let branches: BTreeSet<String> = iter
|
|
216
|
-
.map(|reference_result| {
|
|
217
|
-
reference_result.map_err(|err| {
|
|
218
|
-
PyRuntimeError::new_err(format!(
|
|
219
|
-
"Failed to load branch reference: {err}"
|
|
220
|
-
))
|
|
221
|
-
})
|
|
222
|
-
})
|
|
223
|
-
.collect::<Result<Vec<_>, _>>()?
|
|
224
|
-
.into_iter()
|
|
225
|
-
.map(|reference| shorten_reference_name(&reference))
|
|
226
|
-
.collect();
|
|
227
|
-
|
|
228
|
-
Ok(branches.into_iter().collect())
|
|
205
|
+
/// Return all local branches in the repository.
|
|
206
|
+
#[getter]
|
|
207
|
+
fn branches(&self) -> PyResult<Vec<Head>> {
|
|
208
|
+
self.heads()
|
|
229
209
|
}
|
|
230
210
|
|
|
231
211
|
/// Return the path to the current active branch, if any.
|
|
@@ -164,15 +164,15 @@ def test_branch_listing_matches_gitpython():
|
|
|
164
164
|
repo_path = Path(tmpdir) / "gitpure"
|
|
165
165
|
repo = Repo.clone_from(repo_url, str(repo_path))
|
|
166
166
|
|
|
167
|
-
gitpure_branches = repo.branches
|
|
167
|
+
gitpure_branches = repo.branches
|
|
168
168
|
assert isinstance(gitpure_branches, list)
|
|
169
|
-
assert all(
|
|
169
|
+
assert all(hasattr(branch, "name") and hasattr(branch, "commit") for branch in gitpure_branches)
|
|
170
170
|
|
|
171
171
|
gitpython_repo = GitPythonRepo(str(repo_path))
|
|
172
172
|
gitpython_branches = sorted(head.name for head in gitpython_repo.branches)
|
|
173
173
|
|
|
174
|
-
assert gitpure_branches == gitpython_branches
|
|
174
|
+
assert [branch.name for branch in gitpure_branches] == gitpython_branches
|
|
175
175
|
|
|
176
|
-
#
|
|
176
|
+
# branches property should mirror heads property
|
|
177
177
|
gitpure_heads = repo.heads
|
|
178
|
-
assert [head.name for head in gitpure_heads] == gitpure_branches
|
|
178
|
+
assert [head.name for head in gitpure_heads] == [branch.name for branch in gitpure_branches]
|
gitpure-1.0.0/package.json
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|