feat: Initial Python project setup with monorepo structure#4
feat: Initial Python project setup with monorepo structure#4DamianReeves merged 6 commits intomainfrom
Conversation
Set up the morphir-python project as a production-ready Python port of Morphir with a monorepo structure supporting separate library and tools packages. Project infrastructure: - mise for tool management (Python 3.14, uv) - uv workspace with two packages: morphir (core library) and morphir-tools (CLI) - Strict type checking with mypy and pyright - Linting and formatting with ruff (Google-style docstrings) - Testing with pytest (unit) and behave (BDD) - GitHub Actions CI/CD workflows - Pre-commit hooks configuration Documentation: - Updated README.md with installation and development instructions - Created AGENTS.md with guidelines for code agents - Created .agents/skills/README.md for agentic skills (Agent Skills spec) This establishes the foundation for implementing the Morphir IR models and tooling in Python, following functional programming principles.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6afe20d788
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @given("the Python environment is set up") | ||
| def step_python_environment_setup(context: Context) -> None: |
There was a problem hiding this comment.
Prevent NameError from TYPE_CHECKING-only Context
These step functions annotate context with Context, but Context is only imported under if TYPE_CHECKING earlier in the file and there is no from __future__ import annotations. On Python’s default runtime annotation evaluation, that means importing this module will raise NameError: name 'Context' is not defined, so Behave will fail before any steps run. This is environment-dependent on annotation evaluation (default in 3.11/3.12); without deferring annotations or quoting the type, the BDD tests will crash at import time.
Useful? React with 👍 / 👎.
.github/workflows/ci.yml
Outdated
| - name: Install dependencies | ||
| run: uv sync --group dev |
There was a problem hiding this comment.
Install Python 3.14 before uv sync
The workflow runs uv sync on ubuntu-latest without installing a Python interpreter, but the workspace and both packages require >=3.14. If the runner’s default Python is below 3.14 (the usual case on ubuntu-latest), uv sync will fail because no compatible interpreter is available, so lint/typecheck/test jobs won’t start. This will be avoided only if the runner image already ships Python 3.14 or you explicitly install it (e.g., actions/setup-python or uv python install) before the sync.
Useful? React with 👍 / 👎.
- Add 'install' task to handle dependency sync and workspace package installation - Update CI workflow to use mise-action and mise tasks - Add XML coverage output to coverage task for CI reporting
…mports Add 'from __future__ import annotations' to defer annotation evaluation, preventing NameError when Context type is only imported under TYPE_CHECKING.
Summary
morphir(core library) andmorphir-tools(CLI/extensions)Changes
Project Structure
Development Tooling
Available Commands
Test plan
mise installsuccessfully installs Python 3.14 and uvuv sync --all-groupsinstalls all dependenciesmise run lintpasses (All checks passed)mise run format-checkpasses (12 files properly formatted)mise run typecheckpasses (mypy and pyright both clean)mise run testpasses (10 unit tests)mise run test-bddpasses (3 scenarios, 11 steps)mise run checkpasses (all checks combined)🤖 Generated with Claude Code