Skip to main content

Centralized monorepo version-sync tool driven by versions.yaml.

Project description

scitrera-repo-tools

Centralized monorepo version-sync tool driven by versions.yaml.

Install

pip install scitrera-repo-tools
# or, from source:
pip install -e .

Usage

From any directory inside a monorepo containing a versions.yaml:

sync-versions            # apply updates (preserves local refs)
sync-versions --check    # dry-run, exit 1 on drift
sync-versions --verbose  # show every file inspected
sync-versions --config path/to/versions.yaml

Release mode

By default, sync-versions preserves local-reference dep specifiers (file:../foo, workspace:*, link:, git+..., PEP 508 pkg @ git+...) so local development keeps working. Before publishing to PyPI/npm, opt in to rewrite those into canonical version pins from versions.yaml:

sync-versions --release            # rewrite local refs to version pins
sync-versions --release --check    # preview the release-pass diff in CI

Typical pre-publish flow:

sync-versions --release
git diff                            # review the version-pin substitutions
# ... build + publish (npm publish / uv publish) ...
git checkout -- .                   # restore local refs for ongoing dev

versions.yaml schema

# Top-level project versions
my-python-pkg: 0.1.22
my-ts-pkg: 0.1.22

# External dep pins per language (optional)
preferred_versions:
  python:
    "pydantic": "2.13.4"             # bare -> `==2.13.4`; literal w/ operator preserved
  typescript:
    "@modelcontextprotocol/sdk": "^1.26.0"
  go:
    "google.golang.org/grpc": "v1.65.0"      # bare or `v`-prefixed both accepted
    "google.golang.org/protobuf": "1.34.1"

# Per-project file rules (replaces the hardcoded PROJECT_RULES dict)
project_rules:
  my-python-pkg:
    - { type: pyproject, path: my-python-pkg/pyproject.toml }
    - { type: init_py,   path: my-python-pkg/src/my_pkg/__init__.py }
  my-ts-pkg:
    - { type: package,   path: my-ts-pkg/package.json }

# Internal monorepo cross-reference sync (optional)
dependency_mappings:
  python:
    packages:
      "my-internal-dir": "my-published-name"
    dependencies:
      my-consumer:
        - "my-internal-dir"

# Lockfile fallback for nulls in preferred_versions (optional)
sources:
  python:
    - "uv.lock"

# Global Go toolchain directives (optional, no-inject)
# Walks every go.mod referenced in project_rules.gomod_require.
go_toolchain:
  go:        "1.25"      # rewrites the `go X.Y` directive
  toolchain: "1.25.10"   # rewrites `toolchain goX.Y.Z` (Go 1.21+ feature)

Releases

Releases are automated via GitHub Actions on tag push (v*.*.*):

  1. CI runs the test suite on Python 3.11/3.12/3.13.
  2. A guard step asserts the tag matches pyproject.toml's [project].version.
  3. python -m build produces an sdist + wheel.
  4. The artifacts are published to PyPI via trusted publishing (OIDC; no API token).
  5. A GitHub Release is created with the artifacts attached.

License

BSD 3-Clause.

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

scitrera_repo_tools-0.1.8.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

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

scitrera_repo_tools-0.1.8-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file scitrera_repo_tools-0.1.8.tar.gz.

File metadata

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

File hashes

Hashes for scitrera_repo_tools-0.1.8.tar.gz
Algorithm Hash digest
SHA256 c14c19f2cc843418dadefa75dcfb395fd87cfe5808399caa3136e3003510f96d
MD5 6c7894c249863eee6ec13ed14bd7c589
BLAKE2b-256 1859de980501d0a7b132e1e0b87922b02cf96822fc9dd56c1143637b480db820

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitrera_repo_tools-0.1.8.tar.gz:

Publisher: release.yml on scitrera/repo-tools

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

File details

Details for the file scitrera_repo_tools-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for scitrera_repo_tools-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ab7e2fab0fe85215b385d7625e5f1e12378fb168113798ba7e0d73c5314698c3
MD5 a6f9feb085b04bbc1215ac6ed9be9664
BLAKE2b-256 45ef72f46d7b3b918711761367049ec3a6f980c47f4894f30ad987581a91ced4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitrera_repo_tools-0.1.8-py3-none-any.whl:

Publisher: release.yml on scitrera/repo-tools

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