scitex-git 0.1.2__tar.gz → 0.1.3__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.
- {scitex_git-0.1.2/src/scitex_git.egg-info → scitex_git-0.1.3}/PKG-INFO +53 -6
- {scitex_git-0.1.2 → scitex_git-0.1.3}/README.md +52 -5
- {scitex_git-0.1.2 → scitex_git-0.1.3}/pyproject.toml +1 -1
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/__init__.py +3 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_init.py +16 -7
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_skills/scitex-git/SKILL.md +0 -2
- {scitex_git-0.1.2 → scitex_git-0.1.3/src/scitex_git.egg-info}/PKG-INFO +53 -6
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git.egg-info/SOURCES.txt +1 -2
- scitex_git-0.1.2/tests/test_examples.py +0 -20
- {scitex_git-0.1.2 → scitex_git-0.1.3}/LICENSE +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/setup.cfg +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_branch.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_clone.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_commit.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_constants.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_remote.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_result.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_retry.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_types.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_utils.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_validation.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_vendor_sh.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git/_workflow.py +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git.egg-info/dependency_links.txt +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git.egg-info/entry_points.txt +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git.egg-info/requires.txt +0 -0
- {scitex_git-0.1.2 → scitex_git-0.1.3}/src/scitex_git.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scitex-git
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Git operations and utilities (clone, branch, commit, retry, remote helpers) — standalone module from the SciTeX ecosystem
|
|
5
5
|
Author-email: Yusuke Watanabe <ywatanabe@scitex.ai>
|
|
6
6
|
License-Expression: AGPL-3.0-only
|
|
@@ -47,16 +47,42 @@ Dynamic: license-file
|
|
|
47
47
|
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
48
48
|
<!-- scitex-badges:end -->
|
|
49
49
|
|
|
50
|
+
<p align="center">
|
|
51
|
+
<a href="https://scitex.ai">
|
|
52
|
+
<img src="docs/scitex-logo-blue-cropped.png" alt="SciTeX" width="400">
|
|
53
|
+
</a>
|
|
54
|
+
</p>
|
|
50
55
|
|
|
51
|
-
Git operations and utilities
|
|
56
|
+
<p align="center"><b>Git operations and utilities — clone, init, branch, remote, retry decorator.</b></p>
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
<p align="center">
|
|
59
|
+
<a href="https://scitex-git.readthedocs.io/">Full Documentation</a> · <code>pip install scitex-git</code>
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
54
65
|
|
|
55
66
|
```bash
|
|
56
67
|
pip install scitex-git
|
|
57
68
|
```
|
|
58
69
|
|
|
59
|
-
##
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import scitex_git as sxg
|
|
74
|
+
|
|
75
|
+
sxg.clone_repo("https://github.com/foo/bar", "./bar")
|
|
76
|
+
sxg.git_add_all("./bar")
|
|
77
|
+
sxg.git_commit("./bar", message="initial")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 1 Interfaces
|
|
81
|
+
|
|
82
|
+
<details>
|
|
83
|
+
<summary><strong>Python API</strong></summary>
|
|
84
|
+
|
|
85
|
+
<br>
|
|
60
86
|
|
|
61
87
|
```python
|
|
62
88
|
import scitex_git as sxg
|
|
@@ -91,18 +117,39 @@ sxg.get_head_hash(repo_path)
|
|
|
91
117
|
def maybe_flaky_operation(): ...
|
|
92
118
|
```
|
|
93
119
|
|
|
120
|
+
</details>
|
|
121
|
+
|
|
94
122
|
## Status
|
|
95
123
|
|
|
96
124
|
Standalone fork of `scitex.git`. `scitex.logging.getLogger` is replaced by stdlib
|
|
97
125
|
`logging.getLogger`; the `scitex.sh.sh` shell wrapper is replaced by a tiny
|
|
98
126
|
~70-LOC `_vendor_sh.py` that supports just the call-shape used here. The
|
|
99
127
|
optional `scitex.writer.verify_tree_structure` validation step in
|
|
100
|
-
`create_child_git` is gated behind a `try/except
|
|
101
|
-
|
|
128
|
+
`create_child_git` is gated behind a `try/except` so it only runs when
|
|
129
|
+
`scitex-writer` is installed.
|
|
102
130
|
|
|
103
131
|
The umbrella package's `scitex.git` import path is preserved via a
|
|
104
132
|
`sys.modules`-alias bridge so existing code continues to work.
|
|
105
133
|
|
|
134
|
+
## Part of SciTeX
|
|
135
|
+
|
|
136
|
+
`scitex-git` is part of [**SciTeX**](https://scitex.ai).
|
|
137
|
+
|
|
138
|
+
>Four Freedoms for Research
|
|
139
|
+
>
|
|
140
|
+
>0. The freedom to **run** your research anywhere — your machine, your terms.
|
|
141
|
+
>1. The freedom to **study** how every step works — from raw data to final manuscript.
|
|
142
|
+
>2. The freedom to **redistribute** your workflows, not just your papers.
|
|
143
|
+
>3. The freedom to **modify** any module and share improvements with the community.
|
|
144
|
+
>
|
|
145
|
+
>AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
|
|
146
|
+
|
|
106
147
|
## License
|
|
107
148
|
|
|
108
149
|
AGPL-3.0-only (see [LICENSE](./LICENSE)).
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
<p align="center">
|
|
154
|
+
<a href="https://scitex.ai" target="_blank"><img src="docs/scitex-icon-navy-inverted.png" alt="SciTeX" width="40"/></a>
|
|
155
|
+
</p>
|
|
@@ -10,16 +10,42 @@
|
|
|
10
10
|
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
11
11
|
<!-- scitex-badges:end -->
|
|
12
12
|
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://scitex.ai">
|
|
15
|
+
<img src="docs/scitex-logo-blue-cropped.png" alt="SciTeX" width="400">
|
|
16
|
+
</a>
|
|
17
|
+
</p>
|
|
13
18
|
|
|
14
|
-
Git operations and utilities
|
|
19
|
+
<p align="center"><b>Git operations and utilities — clone, init, branch, remote, retry decorator.</b></p>
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
<p align="center">
|
|
22
|
+
<a href="https://scitex-git.readthedocs.io/">Full Documentation</a> · <code>pip install scitex-git</code>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
17
28
|
|
|
18
29
|
```bash
|
|
19
30
|
pip install scitex-git
|
|
20
31
|
```
|
|
21
32
|
|
|
22
|
-
##
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
import scitex_git as sxg
|
|
37
|
+
|
|
38
|
+
sxg.clone_repo("https://github.com/foo/bar", "./bar")
|
|
39
|
+
sxg.git_add_all("./bar")
|
|
40
|
+
sxg.git_commit("./bar", message="initial")
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 1 Interfaces
|
|
44
|
+
|
|
45
|
+
<details>
|
|
46
|
+
<summary><strong>Python API</strong></summary>
|
|
47
|
+
|
|
48
|
+
<br>
|
|
23
49
|
|
|
24
50
|
```python
|
|
25
51
|
import scitex_git as sxg
|
|
@@ -54,18 +80,39 @@ sxg.get_head_hash(repo_path)
|
|
|
54
80
|
def maybe_flaky_operation(): ...
|
|
55
81
|
```
|
|
56
82
|
|
|
83
|
+
</details>
|
|
84
|
+
|
|
57
85
|
## Status
|
|
58
86
|
|
|
59
87
|
Standalone fork of `scitex.git`. `scitex.logging.getLogger` is replaced by stdlib
|
|
60
88
|
`logging.getLogger`; the `scitex.sh.sh` shell wrapper is replaced by a tiny
|
|
61
89
|
~70-LOC `_vendor_sh.py` that supports just the call-shape used here. The
|
|
62
90
|
optional `scitex.writer.verify_tree_structure` validation step in
|
|
63
|
-
`create_child_git` is gated behind a `try/except
|
|
64
|
-
|
|
91
|
+
`create_child_git` is gated behind a `try/except` so it only runs when
|
|
92
|
+
`scitex-writer` is installed.
|
|
65
93
|
|
|
66
94
|
The umbrella package's `scitex.git` import path is preserved via a
|
|
67
95
|
`sys.modules`-alias bridge so existing code continues to work.
|
|
68
96
|
|
|
97
|
+
## Part of SciTeX
|
|
98
|
+
|
|
99
|
+
`scitex-git` is part of [**SciTeX**](https://scitex.ai).
|
|
100
|
+
|
|
101
|
+
>Four Freedoms for Research
|
|
102
|
+
>
|
|
103
|
+
>0. The freedom to **run** your research anywhere — your machine, your terms.
|
|
104
|
+
>1. The freedom to **study** how every step works — from raw data to final manuscript.
|
|
105
|
+
>2. The freedom to **redistribute** your workflows, not just your papers.
|
|
106
|
+
>3. The freedom to **modify** any module and share improvements with the community.
|
|
107
|
+
>
|
|
108
|
+
>AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
|
|
109
|
+
|
|
69
110
|
## License
|
|
70
111
|
|
|
71
112
|
AGPL-3.0-only (see [LICENSE](./LICENSE)).
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
<p align="center">
|
|
117
|
+
<a href="https://scitex.ai" target="_blank"><img src="docs/scitex-icon-navy-inverted.png" alt="SciTeX" width="40"/></a>
|
|
118
|
+
</p>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scitex-git"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "Git operations and utilities (clone, branch, commit, retry, remote helpers) — standalone module from the SciTeX ecosystem"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "AGPL-3.0-only"
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
"""scitex-git — git operations and utilities (extracted from SciTeX)."""
|
|
5
5
|
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
6
8
|
try:
|
|
7
9
|
from importlib.metadata import version as _v, PackageNotFoundError
|
|
8
10
|
try:
|
|
@@ -21,6 +23,7 @@ from ._retry import git_retry
|
|
|
21
23
|
from ._workflow import setup_branches
|
|
22
24
|
|
|
23
25
|
__all__ = [
|
|
26
|
+
"__version__",
|
|
24
27
|
"init_git_repo",
|
|
25
28
|
"find_parent_git",
|
|
26
29
|
"create_child_git",
|
|
@@ -9,13 +9,12 @@ Provides functions to initialize, find, and manage git repositories
|
|
|
9
9
|
with different strategies (child, parent, origin).
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
+
from logging import getLogger
|
|
12
13
|
from pathlib import Path
|
|
13
14
|
from typing import Optional
|
|
14
15
|
|
|
15
16
|
from git import InvalidGitRepositoryError, Repo
|
|
16
17
|
|
|
17
|
-
from logging import getLogger
|
|
18
|
-
|
|
19
18
|
logger = getLogger(__name__)
|
|
20
19
|
|
|
21
20
|
|
|
@@ -58,7 +57,7 @@ def remove_child_git(project_dir: Path) -> bool:
|
|
|
58
57
|
try:
|
|
59
58
|
import shutil
|
|
60
59
|
|
|
61
|
-
logger.info(
|
|
60
|
+
logger.info("Removing child .git to use parent repository...")
|
|
62
61
|
shutil.rmtree(child_git)
|
|
63
62
|
logger.info(f"Removed child .git from {project_dir}")
|
|
64
63
|
return True
|
|
@@ -86,13 +85,23 @@ def create_child_git(project_dir: Path) -> Optional[Path]:
|
|
|
86
85
|
try:
|
|
87
86
|
repo = Repo(project_dir)
|
|
88
87
|
logger.info(f"Project is already a git repository at {project_dir}")
|
|
89
|
-
# Optional structure validation: only runs if scitex-writer is
|
|
88
|
+
# Optional structure validation: only runs if scitex-writer is
|
|
89
|
+
# installed AND the project happens to follow the writer-tree
|
|
90
|
+
# convention. If either is false, fall through quietly — the
|
|
91
|
+
# repo itself is still valid.
|
|
90
92
|
try:
|
|
91
|
-
from scitex_writer._utils._verify_tree_structure import
|
|
93
|
+
from scitex_writer._utils._verify_tree_structure import (
|
|
94
|
+
verify_tree_structure,
|
|
95
|
+
)
|
|
92
96
|
|
|
93
97
|
verify_tree_structure(project_dir)
|
|
94
|
-
except
|
|
95
|
-
|
|
98
|
+
except Exception as _verify_err:
|
|
99
|
+
# ImportError: scitex-writer not installed.
|
|
100
|
+
# ProjectValidationError / ValueError / OSError: project
|
|
101
|
+
# doesn't follow the writer tree (config/, src/, ... etc).
|
|
102
|
+
# All are non-fatal here — the repo itself is still valid;
|
|
103
|
+
# tree validation is a writer-side concern.
|
|
104
|
+
logger.debug(f"Optional verify_tree_structure skipped: {_verify_err}")
|
|
96
105
|
return project_dir
|
|
97
106
|
except InvalidGitRepositoryError:
|
|
98
107
|
logger.info(f"Initializing new git repository at {project_dir}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scitex-git
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Git operations and utilities (clone, branch, commit, retry, remote helpers) — standalone module from the SciTeX ecosystem
|
|
5
5
|
Author-email: Yusuke Watanabe <ywatanabe@scitex.ai>
|
|
6
6
|
License-Expression: AGPL-3.0-only
|
|
@@ -47,16 +47,42 @@ Dynamic: license-file
|
|
|
47
47
|
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
48
48
|
<!-- scitex-badges:end -->
|
|
49
49
|
|
|
50
|
+
<p align="center">
|
|
51
|
+
<a href="https://scitex.ai">
|
|
52
|
+
<img src="docs/scitex-logo-blue-cropped.png" alt="SciTeX" width="400">
|
|
53
|
+
</a>
|
|
54
|
+
</p>
|
|
50
55
|
|
|
51
|
-
Git operations and utilities
|
|
56
|
+
<p align="center"><b>Git operations and utilities — clone, init, branch, remote, retry decorator.</b></p>
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
<p align="center">
|
|
59
|
+
<a href="https://scitex-git.readthedocs.io/">Full Documentation</a> · <code>pip install scitex-git</code>
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
54
65
|
|
|
55
66
|
```bash
|
|
56
67
|
pip install scitex-git
|
|
57
68
|
```
|
|
58
69
|
|
|
59
|
-
##
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import scitex_git as sxg
|
|
74
|
+
|
|
75
|
+
sxg.clone_repo("https://github.com/foo/bar", "./bar")
|
|
76
|
+
sxg.git_add_all("./bar")
|
|
77
|
+
sxg.git_commit("./bar", message="initial")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 1 Interfaces
|
|
81
|
+
|
|
82
|
+
<details>
|
|
83
|
+
<summary><strong>Python API</strong></summary>
|
|
84
|
+
|
|
85
|
+
<br>
|
|
60
86
|
|
|
61
87
|
```python
|
|
62
88
|
import scitex_git as sxg
|
|
@@ -91,18 +117,39 @@ sxg.get_head_hash(repo_path)
|
|
|
91
117
|
def maybe_flaky_operation(): ...
|
|
92
118
|
```
|
|
93
119
|
|
|
120
|
+
</details>
|
|
121
|
+
|
|
94
122
|
## Status
|
|
95
123
|
|
|
96
124
|
Standalone fork of `scitex.git`. `scitex.logging.getLogger` is replaced by stdlib
|
|
97
125
|
`logging.getLogger`; the `scitex.sh.sh` shell wrapper is replaced by a tiny
|
|
98
126
|
~70-LOC `_vendor_sh.py` that supports just the call-shape used here. The
|
|
99
127
|
optional `scitex.writer.verify_tree_structure` validation step in
|
|
100
|
-
`create_child_git` is gated behind a `try/except
|
|
101
|
-
|
|
128
|
+
`create_child_git` is gated behind a `try/except` so it only runs when
|
|
129
|
+
`scitex-writer` is installed.
|
|
102
130
|
|
|
103
131
|
The umbrella package's `scitex.git` import path is preserved via a
|
|
104
132
|
`sys.modules`-alias bridge so existing code continues to work.
|
|
105
133
|
|
|
134
|
+
## Part of SciTeX
|
|
135
|
+
|
|
136
|
+
`scitex-git` is part of [**SciTeX**](https://scitex.ai).
|
|
137
|
+
|
|
138
|
+
>Four Freedoms for Research
|
|
139
|
+
>
|
|
140
|
+
>0. The freedom to **run** your research anywhere — your machine, your terms.
|
|
141
|
+
>1. The freedom to **study** how every step works — from raw data to final manuscript.
|
|
142
|
+
>2. The freedom to **redistribute** your workflows, not just your papers.
|
|
143
|
+
>3. The freedom to **modify** any module and share improvements with the community.
|
|
144
|
+
>
|
|
145
|
+
>AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
|
|
146
|
+
|
|
106
147
|
## License
|
|
107
148
|
|
|
108
149
|
AGPL-3.0-only (see [LICENSE](./LICENSE)).
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
<p align="center">
|
|
154
|
+
<a href="https://scitex.ai" target="_blank"><img src="docs/scitex-icon-navy-inverted.png" alt="SciTeX" width="40"/></a>
|
|
155
|
+
</p>
|
|
@@ -21,5 +21,4 @@ src/scitex_git.egg-info/dependency_links.txt
|
|
|
21
21
|
src/scitex_git.egg-info/entry_points.txt
|
|
22
22
|
src/scitex_git.egg-info/requires.txt
|
|
23
23
|
src/scitex_git.egg-info/top_level.txt
|
|
24
|
-
src/scitex_git/_skills/scitex-git/SKILL.md
|
|
25
|
-
tests/test_examples.py
|
|
24
|
+
src/scitex_git/_skills/scitex-git/SKILL.md
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"""Smoke tests: every example script must run to completion."""
|
|
2
|
-
|
|
3
|
-
import subprocess
|
|
4
|
-
import sys
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
EXAMPLES = list(Path(__file__).parent.parent.joinpath("examples").glob("*.py"))
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def test_examples_smoke(tmp_path):
|
|
11
|
-
assert EXAMPLES, "no example scripts found"
|
|
12
|
-
for ex in EXAMPLES:
|
|
13
|
-
r = subprocess.run(
|
|
14
|
-
[sys.executable, str(ex)],
|
|
15
|
-
cwd=tmp_path,
|
|
16
|
-
capture_output=True,
|
|
17
|
-
text=True,
|
|
18
|
-
timeout=60,
|
|
19
|
-
)
|
|
20
|
-
assert r.returncode == 0, f"{ex.name} failed: {r.stderr}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|