-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Initial Python project setup with monorepo structure #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6afe20d
feat: Initial Python project setup with monorepo structure
DamianReeves 44a92b5
fix(ci): Add uv.lock for reproducible CI builds
DamianReeves 006ff32
fix(ci): Use --all-groups to install workspace packages
DamianReeves 7e19b94
fix(ci): Install workspace packages in editable mode for tests
DamianReeves ff05ea9
refactor(ci): Use mise tasks for consistent CI/local development
DamianReeves 69568f8
fix: Add future annotations to prevent NameError with TYPE_CHECKING i…
DamianReeves File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # Agent Skills | ||
|
|
||
| This directory contains agentic skills for the Morphir Python project, following the [Agent Skills Specification](https://agentskills.io/). | ||
|
|
||
| ## What are Agent Skills? | ||
|
|
||
| Agent Skills are folders of instructions, scripts, and resources that AI agents can discover and use to perform tasks more accurately and efficiently. They provide a simple, open format for extending agent capabilities with: | ||
|
|
||
| - **Procedural knowledge** - Step-by-step instructions for complex tasks | ||
| - **Contextual information** - Project-specific knowledge | ||
| - **Scripts** - Executable code for common operations | ||
| - **References** - Additional documentation | ||
|
|
||
| ## Directory Structure | ||
|
|
||
| Each skill should be in its own subdirectory with a `SKILL.md` file: | ||
|
|
||
| ``` | ||
| .agents/skills/ | ||
| ├── README.md # This file | ||
| ├── skill-name/ | ||
| │ ├── SKILL.md # Required - skill definition | ||
| │ ├── scripts/ # Optional - executable scripts | ||
| │ ├── references/ # Optional - additional docs | ||
| │ └── assets/ # Optional - templates, data files | ||
| └── another-skill/ | ||
| └── SKILL.md | ||
| ``` | ||
|
|
||
| ## SKILL.md Format | ||
|
|
||
| Each skill must have a `SKILL.md` file with YAML frontmatter: | ||
|
|
||
| ```yaml | ||
| --- | ||
| name: skill-name | ||
| description: A description of what this skill does and when to use it. | ||
| license: Apache-2.0 | ||
| compatibility: Requirements (e.g., "Requires Python 3.14+") | ||
| metadata: | ||
| author: finos | ||
| version: "1.0" | ||
| --- | ||
|
|
||
| # Skill Instructions | ||
|
|
||
| Step-by-step instructions for the skill... | ||
| ``` | ||
|
|
||
| ### Required Fields | ||
|
|
||
| | Field | Description | | ||
| |-------|-------------| | ||
| | `name` | Lowercase, hyphenated name (must match directory name) | | ||
| | `description` | What the skill does and when to use it (max 1024 chars) | | ||
|
|
||
| ### Optional Fields | ||
|
|
||
| | Field | Description | | ||
| |-------|-------------| | ||
| | `license` | License for the skill | | ||
| | `compatibility` | Environment requirements | | ||
| | `metadata` | Additional key-value metadata | | ||
| | `allowed-tools` | Pre-approved tools for the skill | | ||
|
|
||
| ## Creating a New Skill | ||
|
|
||
| 1. Create a directory with your skill name (lowercase, hyphenated) | ||
| 2. Add a `SKILL.md` file with the required frontmatter | ||
| 3. Add any supporting scripts, references, or assets | ||
| 4. Test the skill with an agent to verify it works correctly | ||
|
|
||
| ## Validation | ||
|
|
||
| Use the reference library to validate skills: | ||
|
|
||
| ```bash | ||
| npx skills-ref validate ./skill-name | ||
| ``` | ||
|
|
||
| ## Resources | ||
|
|
||
| - [Agent Skills Specification](https://agentskills.io/specification) | ||
| - [Example Skills](https://github.com/anthropics/skills) | ||
| - [Reference Library](https://github.com/agentskills/agentskills/tree/main/skills-ref) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [tools] | ||
| python = "3.14" | ||
| uv = "latest" | ||
|
|
||
| [env] | ||
| VIRTUAL_ENV = "{{config_root}}/.venv" | ||
|
|
||
| [settings] | ||
| experimental = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Build all packages" | ||
| set -euo pipefail | ||
|
|
||
| echo "Building morphir package..." | ||
| uv build packages/morphir | ||
|
|
||
| echo "Building morphir-tools package..." | ||
| uv build packages/morphir-tools | ||
|
|
||
| echo "Build complete!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Run all checks (lint, format, typecheck, tests)" | ||
| #MISE depends=["lint", "format-check", "typecheck", "test-all"] | ||
| set -euo pipefail | ||
|
|
||
| echo "All checks passed!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Clean build artifacts and caches" | ||
| set -euo pipefail | ||
|
|
||
| echo "Cleaning build artifacts..." | ||
| rm -rf build/ dist/ .eggs/ | ||
| find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true | ||
| find . -type f -name "*.py[cod]" -delete 2>/dev/null || true | ||
|
|
||
| echo "Cleaning test artifacts..." | ||
| rm -rf .pytest_cache/ .coverage htmlcov/ coverage.xml .hypothesis/ | ||
|
|
||
| echo "Cleaning type checker caches..." | ||
| rm -rf .mypy_cache/ .ruff_cache/ .pyright/ | ||
|
|
||
| echo "Clean complete!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Run tests with coverage report" | ||
| set -euo pipefail | ||
|
|
||
| uv run pytest tests/ --cov=packages/morphir/src --cov=packages/morphir-tools/src --cov-report=term-missing --cov-report=html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Run ruff formatter on the codebase" | ||
| set -euo pipefail | ||
|
|
||
| uv run ruff format . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Check code formatting without making changes" | ||
| set -euo pipefail | ||
|
|
||
| uv run ruff format --check . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Run ruff linter on the codebase" | ||
| set -euo pipefail | ||
|
|
||
| uv run ruff check . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Run pytest unit tests" | ||
| set -euo pipefail | ||
|
|
||
| uv run pytest tests/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Run all tests (unit and BDD)" | ||
| #MISE depends=["test", "test-bdd"] | ||
| set -euo pipefail | ||
|
|
||
| echo "All tests completed successfully!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Run behave BDD tests" | ||
| set -euo pipefail | ||
|
|
||
| uv run behave features/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/env bash | ||
| #MISE description="Run mypy and pyright type checkers" | ||
| set -euo pipefail | ||
|
|
||
| echo "Running mypy..." | ||
| uv run mypy packages/morphir/src packages/morphir-tools/src | ||
|
|
||
| echo "Running pyright..." | ||
| uv run pyright packages/morphir/src packages/morphir-tools/src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --group dev | ||
|
|
||
| - name: Run ruff linter | ||
| run: uv run ruff check . | ||
|
|
||
| - name: Check formatting | ||
| run: uv run ruff format --check . | ||
|
|
||
| typecheck: | ||
| name: Type Check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --group dev | ||
|
|
||
| - name: Run mypy | ||
| run: uv run mypy packages/morphir/src packages/morphir-tools/src | ||
|
|
||
| - name: Run pyright | ||
| run: uv run pyright packages/morphir/src packages/morphir-tools/src | ||
|
|
||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --group test | ||
|
|
||
| - name: Run pytest | ||
| run: uv run pytest tests/ --cov=packages/morphir/src --cov=packages/morphir-tools/src --cov-report=xml | ||
|
|
||
| - name: Run behave | ||
| run: uv run behave features/ | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| files: ./coverage.xml | ||
| fail_ci_if_error: false | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| needs: [lint, typecheck, test] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Build morphir package | ||
| run: uv build packages/morphir | ||
|
|
||
| - name: Build morphir-tools package | ||
| run: uv build packages/morphir-tools | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dist | ||
| path: | | ||
| packages/morphir/dist/ | ||
| packages/morphir-tools/dist/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build packages | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Build morphir package | ||
| run: uv build packages/morphir | ||
|
|
||
| - name: Build morphir-tools package | ||
| run: uv build packages/morphir-tools | ||
|
|
||
| - name: Upload morphir dist | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: morphir-dist | ||
| path: packages/morphir/dist/ | ||
|
|
||
| - name: Upload morphir-tools dist | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: morphir-tools-dist | ||
| path: packages/morphir-tools/dist/ | ||
|
|
||
| publish-morphir: | ||
| name: Publish morphir to PyPI | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/project/morphir/ | ||
| steps: | ||
| - name: Download morphir dist | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: morphir-dist | ||
| path: dist/ | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
|
||
| publish-morphir-tools: | ||
| name: Publish morphir-tools to PyPI | ||
| needs: [build, publish-morphir] | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/project/morphir-tools/ | ||
| steps: | ||
| - name: Download morphir-tools dist | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: morphir-tools-dist | ||
| path: dist/ | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
|
||
| github-release: | ||
| name: Create GitHub Release | ||
| needs: [publish-morphir, publish-morphir-tools] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist/ | ||
| merge-multiple: true | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: dist/* | ||
| generate_release_notes: true | ||
| draft: false | ||
| prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow runs
uv synconubuntu-latestwithout 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 syncwill 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-pythonoruv python install) before the sync.Useful? React with 👍 / 👎.