Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
- name: Install dependencies
run: poetry install --no-interaction
- name: Run ruff format check
run: poetry run ruff format --check .
- name: Run ruff lint
run: poetry run ruff check .

type-check:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction
- name: Run mypy
run: poetry run mypy src/

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-interaction
- name: Run tests
run: poetry run pytest

48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
venv/
env/
ENV/
.venv/

# Poetry
# poetry.lock - committed to ensure reproducible builds

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/

# OS
.DS_Store
Thumbs.db

629 changes: 629 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "onex-change-control"
version = "0.1.0"
description = "ONEX Change Control - Canonical governance + schema distribution + enforcement tooling to prevent cross-repo drift"
authors = ["OmniNode Team <team@omninode.ai>"]
license = "MIT"
readme = "README.md"
packages = [{include = "onex_change_control", from = "src"}]

[tool.poetry.dependencies]
python = "^3.12"
pydantic = "^2.11.7"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update pydantic to ^2.12.x for access to latest stable releases.

The latest stable Pydantic 2.x version is 2.12.5. The current constraint ^2.11.7 limits the project to patch updates within 2.11.x only and does not allow installation of the newer 2.12.x release series. Consider updating to ^2.12.5 or ^2.12.0 to access recent bug fixes and features.

🤖 Prompt for AI Agents
In pyproject.toml at line 16, the Pydantic version constraint is pinned to
^2.11.7 which prevents installing the newer 2.12.x releases; update the
constraint to ^2.12.5 (or ^2.12.0) to allow the latest stable 2.12 series, then
regenerate your lock/metadata (e.g., poetry lock / pip-compile) and run the test
suite and any type/compatibility checks to confirm no breaking changes affect
the codebase.


[tool.poetry.group.dev.dependencies]
pytest = "^8.4.0"
pytest-cov = "^6.0.0"
mypy = "^1.13.0"
ruff = "^0.14.7"
types-pyyaml = "^6.0.12.20250822"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for yaml imports and verify dependencies
echo "=== Checking for yaml/pyyaml imports in source code ==="
rg -i "import yaml|from yaml" 2>/dev/null || echo "No yaml imports found"

echo -e "\n=== Examining pyproject.toml for dependencies ==="
cat pyproject.toml 2>/dev/null | head -50

Repository: OmniNode-ai/onex_change_control

Length of output: 1652


🏁 Script executed:

find . -name "pyproject.toml" -type f | head -1 | xargs cat

Repository: OmniNode-ai/onex_change_control

Length of output: 1962


🏁 Script executed:

rg -l "import yaml|from yaml" . 2>/dev/null || echo "No yaml imports found in codebase"

Repository: OmniNode-ai/onex_change_control

Length of output: 108


🏁 Script executed:

cat pyproject.toml | grep -A 20 "dependencies\|tool.poetry.dependencies" || echo "Could not find dependencies section"

Repository: OmniNode-ai/onex_change_control

Length of output: 528


Remove unnecessary types-pyyaml dependency.

The types-pyyaml package is a type stub for PyYAML used by type checkers, and should only be installed when the corresponding runtime library is needed. Since the codebase does not import or use yaml/pyyaml anywhere, this dev dependency is unnecessary and should be removed.

🤖 Prompt for AI Agents
In pyproject.toml around line 23, the dev dependency entry "types-pyyaml =
\"^6.0.12.20250822\"" is unnecessary; remove this line from the dev-dependencies
section and then regenerate the lockfile (e.g., run your package manager's
lock/update command such as poetry lock or pip-compile) to ensure the dependency
is dropped from the lock file and CI.


[tool.ruff]
target-version = "py312"
line-length = 88
exclude = [
"**/__pycache__/**",
"**/site-packages/**",
]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.ruff.lint]
select = ["E", "F", "W", "C90", "I", "N", "UP", "YTT", "S", "BLE", "FBT", "B", "A", "COM", "C4", "DTZ", "T10", "EM", "EXE", "ISC", "ICN", "G", "INP", "PIE", "T20", "PT", "Q", "RSE", "RET", "SLF", "SIM", "TID", "TCH", "ARG", "PTH", "ERA", "PD", "PGH", "PL", "TRY", "NPY", "RUF"]
ignore = [
"S101", # Allow assert statements in tests
"COM812", # Trailing comma rule conflicts with formatter
]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--strict-markers",
"--strict-config",
"-ra",
"--tb=short",
]

[tool.mypy]
plugins = ["pydantic.mypy"]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
mypy_path = "src"
namespace_packages = true
explicit_package_bases = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = false
warn_required_dynamic_aliases = true
warn_untyped_fields = true

9 changes: 9 additions & 0 deletions src/onex_change_control/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""ONEX Change Control - Canonical governance + schema distribution.

This package provides:
- Versioned Pydantic schema models for drift-control artifacts
- Deterministic JSON Schema exports for CI consumption
- Local, no-network validation tooling
"""

__version__ = "0.1.0"
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for onex_change_control package."""
8 changes: 8 additions & 0 deletions tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Test that the package imports cleanly."""

import onex_change_control


def test_package_imports() -> None:
"""Test that the package can be imported."""
assert onex_change_control.__version__ == "0.1.0"