Skip to content

Update Python versions in workflows and fix related issues#16

Merged
RCFans merged 10 commits into
mainfrom
dev
Apr 6, 2026
Merged

Update Python versions in workflows and fix related issues#16
RCFans merged 10 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 12:17

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 updates the project’s Python packaging/CI setup (targeting Python 3.12) and adjusts tests, docs, and a few implementation details to satisfy updated tooling/linting and schema/contract validation needs.

Changes:

  • Adds/updates GitHub Actions workflows for packaging, linting (pylint), and PyPI publishing.
  • Updates packaging metadata (rename distribution to omenai, add URLs/dev deps) and refreshes README/quick-start install instructions.
  • Cleans up various code paths and tests (signature alignment, lint-driven refactors, adds JSON schema fixtures).

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/omen/scenario/contract_loader.py Replaces spec-specific loader with a generic load() that currently points at test fixtures.
pyproject.toml Renames distribution to omenai, adjusts metadata, adds dev deps and project URLs.
.github/workflows/python-package.yml Adds CI workflow for ruff, unit tests, and building artifacts on Python 3.12.
.github/workflows/pylint.yml Adds pylint workflow on push.
.github/workflows/release.yml Adds PyPI publish workflow on releases.
.pylintrc Introduces repo-level pylint configuration.
README.md, README.zh.md Updates project tagline/badges and installation instructions.
docs/quick-start.md, docs/quick-start-llm.md Updates pip install commands and dev dependency guidance.
tests/** Updates assertions/style, aligns monkeypatch signatures, adds contract fixture usage.
tests/fixtures/contracts/*.schema.json Adds JSON schema fixtures used by tests/validators.
src/omen/** (various) Minor refactors (string splitting, loops, unused vars/imports) and lint suppressions.
app/case_analysis.py Renames a module-level variable used in the Streamlit UI flow.
Comments suppressed due to low confidence (1)

src/omen/scenario/contract_loader.py:22

  • load() currently resolves schemas under tests/fixtures/contracts, and raises if the file is missing. Since tests/ typically isn’t included in sdist/wheels, this makes the loader unusable for library consumers and also contradicts the docstring (“repo spec path, with a test-fixture fallback”). Consider loading from the real specs/.../contracts location first, and only falling back to tests/fixtures/contracts when running in a dev/test context; also update the FileNotFoundError message (it still says “Spec 4”).
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:

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

Comment on lines +16 to +17
/ "fixtures"
/ "contracts"

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.

The schema_path path construction has inconsistent indentation around the / "fixtures" and / "contracts" segments, which is likely to trip style checks (ruff/pycodestyle) and makes the expression harder to read. Reformat the Path join to a consistently-indented style (or a single line) so it passes linting reliably.

Suggested change
/ "fixtures"
/ "contracts"
/ "fixtures"
/ "contracts"

Copilot uses AI. Check for mistakes.
Comment on lines 74 to 76
def test_load_spec4_contract_schema() -> None:
schema = load_spec4_contract_schema("precision-evaluation.schema.json")
schema = load("precision-evaluation.schema.json")
assert schema["title"] == "PrecisionEvaluationProfile"

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.

The test name test_load_spec4_contract_schema no longer matches what’s being exercised (it now calls contract_loader.load). Renaming the test to reflect the new API will keep intent clear and avoid confusion when grepping failures.

Copilot uses AI. Check for mistakes.
Comment thread README.md
@@ -109,11 +113,17 @@ More scenarios are under development (contributions welcome):

Environment requirements: Python 3.12+ with `pip` package manager.

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.

README says “Python 3.12+”, but pyproject.toml pins requires-python = ">=3.12,<3.13", which excludes 3.13+. Please align the wording (e.g., “Python 3.12.x”) so users don’t try unsupported versions.

Suggested change
Environment requirements: Python 3.12+ with `pip` package manager.
Environment requirements: Python 3.12.x with `pip` package manager.

Copilot uses AI. Check for mistakes.
Comment thread README.zh.md
@@ -109,11 +113,17 @@ graph TD

运行环境要求:Python 3.12+ `pip` 包管理器。

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.

文档写的是 “Python 3.12+”,但 pyproject.tomlrequires-python = ">=3.12,<3.13" 实际不支持 3.13+。建议把这里的表述改成 “Python 3.12.x” 或与实际支持范围一致,避免用户装错版本。

Suggested change
运行环境要求:Python 3.12+ `pip` 包管理器。
运行环境要求:Python 3.12.x 和 `pip` 包管理器。

Copilot uses AI. Check for mistakes.
Comment thread pyproject.toml
requires-python = ">=3.12,<3.13"
authors = [{ name = "StrategyLogic" }]
license = { text = "AGPL-3.0-or-later" }
license = "AGPL-3.0-or-later"

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.

[project].license was changed from the PEP 621 table form ({ text = ... }) to a plain string. Many Python packaging tools expect license to be a table in pyproject.toml; using a string here can break python -m build / metadata generation depending on tool versions. To stay standards-compliant and avoid release workflow failures, use the table form (or license = { file = "LICENSE" }) instead of a bare string.

Suggested change
license = "AGPL-3.0-or-later"
license = { text = "AGPL-3.0-or-later" }

Copilot uses AI. Check for mistakes.
@RCFans RCFans merged commit dff447a into main Apr 6, 2026
6 checks passed
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