Skip to main content

Shared CI / build tooling for the Juniper ML platform (dependency-documentation generator with YAML-safe conda export)

Project description

juniper-ci-tools

Shared CI / build tooling for the Juniper ML platform.

This package is the single source of truth for the dependency-documentation generator that historically lived as scripts/generate_dep_docs.sh (or util/generate_dep_docs.sh) in every Juniper repo. Three variants of that script drifted on origin/main; the 2026-05-20 bug fix in juniper-cascor#276 (switching the conda-dependency extraction from sed to awk to avoid emitting an invalid trailing prefix: / variables: key) shipped in 1 of 8 repos. This package distributes that fix as pip install-able tooling so it cannot drift again.

This work mirrors the juniper-doc-tools PyPI migration plan that addressed the analogous 2026-05-18 doc-link validator incident.

Installation

pip install juniper-ci-tools

This installs the juniper-generate-dep-docs console script. The package requires Python 3.11 or newer and depends on PyYAML.

Usage

Run from the root of any Juniper repo that has a pyproject.toml:

juniper-generate-dep-docs

Equivalent module form:

python -m juniper_ci_tools

This will:

  1. Create conf/ if needed.
  2. Back up any existing conf/requirements_ci.txt with a timestamp infix.
  3. Render notes/PIP_DEPENDENCY_FILE_HEADER.md (substituting placeholders like <X.Y.Z ...>, <YYYY-MM-dd ...>, <Python Version>, <Pip Version>) and append pip list --format=freeze output.
  4. If conda is on PATH: back up any existing conf/conda_environment_ci.yaml, render notes/CONDA_DEPENDENCY_FILE_HEADER.md, append the dependency block extracted from conda env export --no-builds (using the awk-equivalent logic that produces valid YAML), and validate the result with yaml.safe_load.

If conda is not available the conda step is skipped with a warning (matches the legacy bash script). If the generated YAML fails to parse, the command exits non-zero.

CLI options

Flag Default Purpose
--repo-root cwd Repo root containing pyproject.toml
--conf-dir conf Output directory
--notes-dir notes Directory containing header templates
--pip-header PIP_DEPENDENCY_FILE_HEADER.md Pip header template filename
--conda-header CONDA_DEPENDENCY_FILE_HEADER.md Conda header template filename
--pip-filename requirements_ci.txt Pip output filename
--conda-filename conda_environment_ci.yaml Conda output filename
--no-conda off Skip conda generation even if conda is installed
--no-yaml-validation off Skip yaml.safe_load on generated conda file

Library API

from juniper_ci_tools import generate_dep_docs

result = generate_dep_docs(repo_root="/path/to/repo")
print(result.pip_file, result.conda_file, result.yaml_validated)

See the package's juniper_ci_tools/generate_dep_docs.py docstring for the full surface.

Development

cd juniper-ci-tools
pip install -e ".[test]"
pytest

License

MIT. Copyright (c) 2024-2026 Paul Calnon.

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

juniper_ci_tools-0.1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

juniper_ci_tools-0.1.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file juniper_ci_tools-0.1.0.tar.gz.

File metadata

  • Download URL: juniper_ci_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for juniper_ci_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9cded963176a921c6b3e28e27128128bb26a8c3c593b783c435a2f89151fe7a0
MD5 5f3bda80175434ec526d428e4d0c2eee
BLAKE2b-256 2f4ea77552a95480802fe96d7d054fbddb246739d3b88a2b5277525834b6433f

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_ci_tools-0.1.0.tar.gz:

Publisher: publish-ci-tools.yml on pcalnon/juniper-ml

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

File details

Details for the file juniper_ci_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for juniper_ci_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7e95f76748527a189c7bfd1fc92aca8bcf0c177eb163aa8d2c293dca1bd2c82
MD5 fbc4eb2500b21f1c6a674e84fbfa15f0
BLAKE2b-256 2fa972724df5d1d3fb8ab5a069aed2ea002cd3534a4c4a25b02f7b976ee3e51d

See more details on using hashes here.

Provenance

The following attestation bundles were made for juniper_ci_tools-0.1.0-py3-none-any.whl:

Publisher: publish-ci-tools.yml on pcalnon/juniper-ml

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