A pseudo-submodule tool for vendoring Git repositories in Beman projects
Project description
beman-submodule
A pseudo-submodule tool for vendoring Git repositories in Beman projects.
What is beman-submodule?
beman-submodule provides some of the features of git submodule, adding child git
repositories to a parent git repository, but unlike with git submodule, the entire child
repo is directly checked in, so only maintainers, not users, need to run this script. The
command line interface mimics git submodule's.
Installation
pip install beman-submodule
Or with uv:
uv tool install beman-submodule
Usage
Adding a beman submodule
beman-submodule add https://github.com/bemanproject/infra.git
This will clone the repository and create a .beman_submodule file tracking the remote and commit.
You can also specify a custom path:
beman-submodule add https://github.com/bemanproject/infra.git infra/
Updating beman submodules
Update all beman submodules to match their .beman_submodule configuration:
beman-submodule update
Update all beman submodules to the latest from upstream:
beman-submodule update --remote
Update only a specific submodule:
beman-submodule update --remote infra/
Checking status
Show the status of all beman submodules:
beman-submodule status
A + prefix indicates the submodule contents differ from the configured commit.
How does it work?
Along with the files from the child repository, it creates a dotfile called
.beman_submodule, which looks like this:
[beman_submodule]
remote=https://github.com/bemanproject/infra.git
commit_hash=9b88395a86c4290794e503e94d8213b6c442ae77
Updating to a specific commit or changing the remote URL
Edit the corresponding lines in the .beman_submodule file and run
beman-submodule update to update the state of the beman submodule to the new
settings.
Allow untracked files
If you need to add local files alongside the vendored content, use:
beman-submodule add --allow-untracked-files https://github.com/example/repo.git path/
This adds allow_untracked_files=True to the .beman_submodule config, preserving local
files during updates.
CI Integration
Add this job to your CI workflow to ensure beman submodules are in a valid state:
beman-submodule-test:
runs-on: ubuntu-latest
name: "Check beman submodules for consistency"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install beman-submodule
run: pip install beman-submodule
- name: beman submodule consistency check
run: |
(set -o pipefail; beman-submodule status | grep -qvF '+')
This will fail if the contents of any beman submodule don't match what's specified in the
.beman_submodule file.
Development
This project uses uv for development:
# Install dependencies
uv sync --group dev
# Run tests
uv run pytest
# Run linter
uv run ruff check .
# Format code
uv run ruff format .
License
Apache-2.0 WITH LLVM-exception
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 beman_submodule-0.1.0.tar.gz.
File metadata
- Download URL: beman_submodule-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d26eb6646a50d53a5f6334e7afca6d44362252efbeaf81acfc335912f1340410
|
|
| MD5 |
9b659f5893040f655c80752c0ec2a369
|
|
| BLAKE2b-256 |
5376f2c3f0c22c1ab4a304a781a10cfe92960a9850a439e4b7f460c99cad18f7
|
Provenance
The following attestation bundles were made for beman_submodule-0.1.0.tar.gz:
Publisher:
publish.yml on bemanproject/beman-submodule
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beman_submodule-0.1.0.tar.gz -
Subject digest:
d26eb6646a50d53a5f6334e7afca6d44362252efbeaf81acfc335912f1340410 - Sigstore transparency entry: 927082088
- Sigstore integration time:
-
Permalink:
bemanproject/beman-submodule@630465836fb5d99ab59cc0d8152b0fb5de819861 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bemanproject
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@630465836fb5d99ab59cc0d8152b0fb5de819861 -
Trigger Event:
release
-
Statement type:
File details
Details for the file beman_submodule-0.1.0-py3-none-any.whl.
File metadata
- Download URL: beman_submodule-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef1e354291c89c2ae59b5b12ad1f5f76c66520a21b280192207f57c19359c4d8
|
|
| MD5 |
58bdbad85d46d2eb048689bcfe3f1a8a
|
|
| BLAKE2b-256 |
6723212d261d7c1ae723a76f6c66616b0419c1ac92a987973a60cd1347c52785
|
Provenance
The following attestation bundles were made for beman_submodule-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on bemanproject/beman-submodule
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beman_submodule-0.1.0-py3-none-any.whl -
Subject digest:
ef1e354291c89c2ae59b5b12ad1f5f76c66520a21b280192207f57c19359c4d8 - Sigstore transparency entry: 927082099
- Sigstore integration time:
-
Permalink:
bemanproject/beman-submodule@630465836fb5d99ab59cc0d8152b0fb5de819861 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/bemanproject
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@630465836fb5d99ab59cc0d8152b0fb5de819861 -
Trigger Event:
release
-
Statement type: