Apply changes across multiple repos at once.
Project description
modify-repos
Clone, modify, and create pull requests across multiple repositories at once.
[!WARNING] This is under development, and how it's used may change at any time.
Documentation: https://modify-repos.readthedocs.io/
Example Use
Use uv to create a script that depends on this library.
$ uv init --script mod.py
$ uv add --script mod.py modify-repos
Subclass modify_repos.GitHubScript to define the repositories to change and
what changes to make. This uses the gh GitHub CLI, which must already be
installed and logged in.
from modify_repos import GitHubScript, GitHubRepo
class MyScript(GitHubScript):
# title used in commit and PR
title = "..."
# description used in commit and PR
body = "..."
# branch to merge into, defaults to main
target = "main"
# branch to create and PR
branch = "my-changes"
# one or more users/orgs to clone repos from
orgs = ["username"]
def select_for_clone(self, repo: GitHubRepo) -> bool:
# filter to only clone some of the available repos
return repo.name in {"a", "b", "d"}
def modify(self, repo: GitHubRepo) -> None:
# make any changes, such as add/remove files, here
...
if __name__ == "__main__":
MyScript().run()
Call uv run mod.py, and it will clone and modify all the selected repos. PRs
will not be created unless you use MyScript(submit=True) instead, so you can
develop and preview your changes first.
Develop
This project uses uv to manage the development environment and tox to define different tests and management scripts.
# set up env
$ uv sync
$ uv run pre-commit install --install-hooks
# run tests and checks
$ uv run tox p
# develop docs with auto build and serve
$ uv run tox r -e docs-auto
# update dependencies
$ uv run tox r -m update
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modify_repos-0.1.1.tar.gz.
File metadata
- Download URL: modify_repos-0.1.1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c877f2860bbc98d5d41395e307e36f6049c1eb2b1bbaf2c936e8a313b50b478
|
|
| MD5 |
f4cc2869b44efe976dd4876d779122eb
|
|
| BLAKE2b-256 |
0ef63612a16b592ccd9858bcf939deb54f15c881ea7917e2fb13a562b004454a
|
Provenance
The following attestation bundles were made for modify_repos-0.1.1.tar.gz:
Publisher:
publish.yaml on davidism/modify-repos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modify_repos-0.1.1.tar.gz -
Subject digest:
9c877f2860bbc98d5d41395e307e36f6049c1eb2b1bbaf2c936e8a313b50b478 - Sigstore transparency entry: 162370482
- Sigstore integration time:
-
Permalink:
davidism/modify-repos@d80175d9a22d8fc50fa01d3216a851ecaa890c57 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/davidism
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@d80175d9a22d8fc50fa01d3216a851ecaa890c57 -
Trigger Event:
push
-
Statement type:
File details
Details for the file modify_repos-0.1.1-py3-none-any.whl.
File metadata
- Download URL: modify_repos-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d1e20572434ae7e1b9f36be3b1a64dd374d55eae61b9dbb7b8e75735ff1756c
|
|
| MD5 |
f20eb324ba71cc1597ef70a032a1f905
|
|
| BLAKE2b-256 |
f8304254c4e597e30d2c09b064def7b833de6c654b298aed20776a87852b33bd
|
Provenance
The following attestation bundles were made for modify_repos-0.1.1-py3-none-any.whl:
Publisher:
publish.yaml on davidism/modify-repos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modify_repos-0.1.1-py3-none-any.whl -
Subject digest:
8d1e20572434ae7e1b9f36be3b1a64dd374d55eae61b9dbb7b8e75735ff1756c - Sigstore transparency entry: 162370484
- Sigstore integration time:
-
Permalink:
davidism/modify-repos@d80175d9a22d8fc50fa01d3216a851ecaa890c57 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/davidism
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@d80175d9a22d8fc50fa01d3216a851ecaa890c57 -
Trigger Event:
push
-
Statement type: