Skip to content

lint, package and release#15

Closed
RCFans wants to merge 9 commits into
mainfrom
dev
Closed

lint, package and release#15
RCFans wants to merge 9 commits into
mainfrom
dev

Conversation

@RCFans

@RCFans RCFans commented Apr 6, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 6, 2026 11:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR focuses on making the project ready for packaging and release (PyPI + GitHub Actions), while also applying lint-driven refactors and test updates across the codebase.

Changes:

  • Adds GitHub Actions workflows for linting, packaging, and PyPI publishing.
  • Updates packaging metadata (rename distribution to omenai) and refreshes README/quick-start installation guidance.
  • Applies lint/style cleanups across Python modules and tests, and adds JSON-schema fixtures used by validators/tests.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/test_situation_url_ingest.py Updates monkeypatch signature to match new markdown save function parameters.
tests/unit/test_situation_markdown.py Silences unused-parameter lint warnings in fake invoke helper.
tests/unit/test_ingest_validator.py Switches schema loader call to contract_loader.load.
tests/unit/test_causal_trace.py Simplifies empty-list assertion style.
tests/unit/test_case_package_validator.py Points required artifacts at fixture contract schemas for validation.
tests/unit/test_actor_schema_errors.py Simplifies empty-list assertion style.
tests/test_smoke.py Updates expected package __version__ string (currently inconsistent).
tests/integration/test_strategic_actor_ui.py Adds pylint suppression for protected-access usage in integration test.
tests/fixtures/contracts/precision-evaluation.schema.json Adds contract schema fixture.
tests/fixtures/contracts/cross-case-output.schema.json Adds contract schema fixture.
tests/fixtures/contracts/case-package.schema.json Adds contract schema fixture.
tests/contract/test_actor_validator.py Simplifies empty-list assertion style.
tests/contract/test_actor_ontology_output.py Simplifies empty-list assertion style.
tests/contract/_schema_utils.py Minor lint cleanup (unused variable).
src/omen/ui/view_model.py Small parsing/condition refactors (rsplit + chained comparison).
src/omen/ui/causal_trace.py Uses rsplit for safer step parsing.
src/omen/ui/case_catalog.py Marks unused parameters as intentionally unused.
src/omen/simulation/step.py Refactors pair iteration for readability.
src/omen/scenario/validator.py Removes redundant try/except and unused import.
src/omen/scenario/ontology_validator.py Removes unused variable.
src/omen/scenario/contract_loader.py Replaces spec4 loader with load() pointing at test fixtures (packaging risk).
src/omen/scenario/case_replay_loader.py Import order + removes unused variable.
src/omen/ingest/synthesizer/cache.py Removes unused typing import.
src/omen/ingest/synthesizer/builders/actor.py Simplifies alias remapping logic.
README.zh.md Updates positioning and installation instructions; adds CI badges.
README.md Updates positioning and installation instructions; adds CI badges.
pyproject.toml Renames distribution to omenai, updates metadata, adds dev tooling deps and project URLs.
docs/quick-start.md Updates install commands and clarifies dev dependency installation.
docs/quick-start-llm.md Updates install commands.
app/case_analysis.py Renames variable for lint/style compliance at module scope.
.pylintrc Adds repository pylint configuration.
.github/workflows/release.yml Adds PyPI publish workflow (duplicates another added workflow).
.github/workflows/python-package.yml Adds CI workflow for ruff + unit tests + build.
.github/workflows/pylint.yml Adds pylint workflow.
.github/workflows/publish-pypi.yml Adds PyPI publish workflow (duplicates release.yml).
Comments suppressed due to low confidence (1)

src/omen/scenario/contract_loader.py:23

  • omen.scenario.contract_loader.load() now builds schema_path under tests/fixtures/contracts, but the docstring says it loads from the repo spec path with a fallback. Also, tests/fixtures typically won’t be included in an installed wheel, so this loader will break outside the repo checkout. Consider loading from a packaged schema directory (e.g., within src/omen/...) via package resources, or keep the schemas under specs/ and ensure they’re included in the distribution.
def load(schema_filename: str) -> dict:
    """Load a schema from the repo spec path, with a test-fixture fallback."""

    root = Path(__file__).resolve().parents[3]
    schema_path = (
        root
        / "tests"
            / "fixtures"
            / "contracts"
        / schema_filename
    )
    if not schema_path.exists():
        raise FileNotFoundError(f"Spec 4 contract schema not found: {schema_path}")
    with schema_path.open("r", encoding="utf-8") as f:
        return json.load(f)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_smoke.py

def test_package_version_is_defined() -> None:
assert __version__ == "0.1.0"
assert __version__ == "0.2.1"

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

__version__ in src/omen/__init__.py (and pyproject.toml) is currently 0.1.0, so asserting "0.2.1" here will fail. Update the expected value to match the package versioning source (or derive the version from package metadata consistently).

Suggested change
assert __version__ == "0.2.1"
assert __version__ == "0.1.0"

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +5
release:
types: [published]

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

This repository now contains two workflows (release.yml and publish-pypi.yml) with the same name and the same on: release: types: [published] trigger, both publishing to PyPI. On a release publish event they will both run and the second publish attempt will fail (and can make releases flaky). Keep only one publishing workflow or change triggers so only a single job publishes.

Suggested change
release:
types: [published]

Copilot uses AI. Check for mistakes.
@RCFans RCFans closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants