Skip to main content

Git operations and utilities (clone, branch, commit, retry, remote helpers) — standalone module from the SciTeX ecosystem

Project description

scitex-git

PyPI Python Tests Install Test Coverage Docs License: AGPL v3

SciTeX

Git operations and utilities — clone, init, branch, remote, retry decorator.

Full Documentation · pip install scitex-git


Installation

pip install scitex-git

Quick Start

import scitex_git as sxg

sxg.clone_repo("https://github.com/foo/bar", "./bar")
sxg.git_add_all("./bar")
sxg.git_commit("./bar", message="initial")

1 Interfaces

Python API
import scitex_git as sxg

# Clone / init
sxg.clone_repo(url, dest_dir)
sxg.git_init(repo_path)

# Add / commit
sxg.git_add_all(repo_path)
sxg.git_commit(repo_path, message="…")

# Branch
sxg.git_checkout_new_branch(repo_path, branch_name)
sxg.git_branch_rename(repo_path, old, new)
sxg.setup_branches(repo_path, template_name)

# Repo init / discovery
sxg.init_git_repo(project_dir, git_strategy="parent")
sxg.find_parent_git(project_dir)
sxg.create_child_git(project_dir)
sxg.remove_child_git(project_dir)

# Remote
sxg.get_remote_url(repo_path)
sxg.is_cloned_from(repo_path, url)
sxg.ls_remote(url)
sxg.get_head_hash(repo_path)

# Retry decorator
@sxg.git_retry(max_attempts=3)
def maybe_flaky_operation(): ...

Status

Standalone fork of scitex.git. scitex.logging.getLogger is replaced by stdlib logging.getLogger; the scitex.sh.sh shell wrapper is replaced by a tiny ~70-LOC _vendor_sh.py that supports just the call-shape used here. The optional scitex.writer.verify_tree_structure validation step in create_child_git is gated behind a try/except so it only runs when scitex-writer is installed.

The umbrella package's scitex.git import path is preserved via a sys.modules-alias bridge so existing code continues to work.

Part of SciTeX

scitex-git is part of SciTeX.

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.

License

AGPL-3.0-only (see LICENSE).


SciTeX

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scitex_git-0.1.3.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_git-0.1.3-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file scitex_git-0.1.3.tar.gz.

File metadata

  • Download URL: scitex_git-0.1.3.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_git-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ae6fa5e3f66da86c0a7dd7510a2e93e6514f5fe41838be0fac1a6e3635e9a1a7
MD5 fe6d287060ba2fff7952f61824560bce
BLAKE2b-256 da8844ddd8e8f40d74c1f33ca27bede31d53587eec74ab49ec4bd2d0d16c7234

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_git-0.1.3.tar.gz:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-git

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scitex_git-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: scitex_git-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_git-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 50ed401c2f06409f1ba57de567186be256a5e5a59a2588f1879a74d34290e537
MD5 b381d93169d927db69cd98ddc4a5d126
BLAKE2b-256 9619f6da73fe90fafc8bff4ce7a82a508e6c2d38087f845608c8e6195b69b950

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_git-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on ywatanabe1989/scitex-git

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page