Skip to content

Commit cb2d9e2

Browse files
authored
Implement Plugins SDK for Python (#1)
* Add project config files/GHAs/etc. * Add project code * Add tests * Add examples * Update to support building
1 parent 92d1034 commit cb2d9e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4613
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Bug Report
2+
description: Report a bug or an unexpected behavior
3+
labels: ["bug", "needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to file a bug report!
9+
Please read the [Contributing Guidelines](CONTRIBUTING.md) before submitting.
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: Description
14+
description: A clear and concise description of what the bug is.
15+
placeholder: Describe the bug here.
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: reproduction-steps
20+
attributes:
21+
label: Steps to Reproduce
22+
description: |
23+
Provide clear steps to reproduce the behavior.
24+
Please include code snippets, configurations, or detailed commands if relevant.
25+
placeholder: |
26+
1. Go to '...'
27+
2. Run cmd '....'
28+
3. View file '....'
29+
4. See error
30+
validations:
31+
required: true
32+
- type: textarea
33+
id: expected-behavior
34+
attributes:
35+
label: Expected Behavior
36+
description: A clear and concise description of what you expected to happen.
37+
placeholder: What did you expect to happen?
38+
validations:
39+
required: true
40+
- type: textarea
41+
id: actual-behavior
42+
attributes:
43+
label: Actual Behavior
44+
description: A clear and concise description of what actually happened.
45+
placeholder: What actually happened?
46+
validations:
47+
required: true
48+
- type: textarea
49+
id: environment
50+
attributes:
51+
label: Environment
52+
description: Provide details about your environment.
53+
value: |
54+
- **OS:** [e.g. macOS, Windows, Linux] (and version)
55+
- **mcpd Version:** [e.g. v0.0.2] (mcpd --version)
56+
- **mcpd Python plugin SDK Version:** [e.g. 0.0.1]
57+
- **Other relevant libraries/versions:**
58+
render: markdown
59+
validations:
60+
required: false
61+
- type: textarea
62+
id: logs
63+
attributes:
64+
label: Relevant Log Output
65+
description: |
66+
If applicable, paste any relevant log and terminal output, error messages, or screenshots.
67+
Please wrap code blocks in triple backticks (```).
68+
render: shell
69+
validations:
70+
required: false
71+
- type: checkboxes
72+
id: self-checklist
73+
attributes:
74+
label: Self-Checklist
75+
options:
76+
- label: I have read the [Contributing Guidelines](CONTRIBUTING.md).
77+
required: true
78+
- label: I have searched the existing issues and found no duplicate.
79+
required: true
80+
- label: I have provided a clear and concise description of the bug.
81+
required: true
82+
- label: I have provided clear steps to reproduce the bug.
83+
required: true
84+
- label: I have provided details about my environment.
85+
required: true

.github/ISSUE_TEMPLATE/config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Report a security vulnerability
4+
url: https://github.com/mozilla-ai/mcpd-plugins-sdk-python/security/policy
5+
about: Please report security vulnerabilities responsibly.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Feature Request
2+
description: Suggest an idea or enhancement for the project.
3+
labels: ["enhancement", "needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for suggesting an idea!
9+
Please read the [Contributing Guidelines](CONTRIBUTING.md) before submitting.
10+
- type: textarea
11+
id: problem-description
12+
attributes:
13+
label: Is your feature request related to a problem? Please describe.
14+
description: A clear and concise description of the problem you're trying to solve. e.g. "I'm always frustrated when [...]"
15+
placeholder: Describe the problem.
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: solution-description
20+
attributes:
21+
label: Describe the solution you'd like
22+
description: A clear and concise description of what you want to happen.
23+
placeholder: Describe the solution.
24+
validations:
25+
required: true
26+
- type: textarea
27+
id: alternatives
28+
attributes:
29+
label: Describe alternatives you've considered
30+
description: A clear and concise description of any alternative solutions or features you've considered.
31+
placeholder: Describe alternatives.
32+
validations:
33+
required: false
34+
- type: textarea
35+
id: additional-context
36+
attributes:
37+
label: Additional Context
38+
description: Add any other context or screenshots about the feature request here.
39+
placeholder: Any additional information.
40+
validations:
41+
required: false
42+
- type: checkboxes
43+
id: self-checklist
44+
attributes:
45+
label: Self-Checklist
46+
options:
47+
- label: I have read the [Contributing Guidelines](CONTRIBUTING.md).
48+
required: true
49+
- label: I have searched the existing issues and found no duplicate.
50+
required: true
51+
- label: I have provided a clear and concise description of the problem.
52+
required: true
53+
- label: I have provided a clear and concise description of the proposed solution.
54+
required: true

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
run-linter:
11+
timeout-minutes: 30
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out the repository
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
18+
- name: Install the latest version of uv and set the python version to 3.11
19+
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
20+
with:
21+
python-version: 3.11
22+
activate-environment: true
23+
24+
- name: Install dependencies
25+
run: uv sync --group lint
26+
27+
- name: Run pre-commit hooks
28+
run: uv run pre-commit run --all-files

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
environment: pypi
11+
permissions:
12+
contents: read
13+
id-token: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out the repository
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
23+
with:
24+
python-version: '3.11'
25+
26+
- name: Upgrade pip
27+
run: |
28+
pip install --upgrade pip
29+
pip --version
30+
31+
- name: Install
32+
run: python -m pip install build setuptools
33+
34+
- name: Build package
35+
run: python -m build
36+
37+
- name: Upload package
38+
if: github.event_name == 'release'
39+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'src/**'
8+
- 'tests/**'
9+
pull_request:
10+
paths:
11+
- 'src/**'
12+
- 'tests/**'
13+
workflow_dispatch:
14+
15+
jobs:
16+
test:
17+
timeout-minutes: 30
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ ubuntu-latest, macos-latest ]
23+
python-version: [ '3.11', '3.12', '3.13' ]
24+
25+
runs-on: ${{ matrix.os }}
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
31+
- name: Setup UV
32+
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
activate-environment: true
36+
37+
- run: uv sync --group tests
38+
39+
- run: pytest -v tests/unit

.gitignore

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
MANIFEST
23+
24+
# Virtual environments
25+
venv/
26+
ENV/
27+
env/
28+
.venv/
29+
30+
# IDE
31+
.vscode/
32+
.idea/
33+
*.swp
34+
*.swo
35+
*~
36+
37+
# Testing
38+
.pytest_cache/
39+
.coverage
40+
htmlcov/
41+
.tox/
42+
43+
# Type checking
44+
.mypy_cache/
45+
.dmypy.json
46+
dmypy.json
47+
48+
# Ruff
49+
.ruff_cache/
50+
51+
# Proto source files (downloaded during build, not committed)
52+
tmp/
53+
54+
# Version file (generated by setuptools_scm)
55+
src/mcpd_plugins/_version.py
56+
57+
# OS
58+
.DS_Store
59+
Thumbs.db
60+
61+
# Claude Code (never commit this)
62+
.claude/CLAUDE.local.md

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: https://github.com/Yelp/detect-secrets
3+
rev: v1.5.0
4+
hooks:
5+
- id: detect-secrets
6+
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v5.0.0
9+
hooks:
10+
- id: check-merge-conflict
11+
- id: trailing-whitespace
12+
- id: end-of-file-fixer
13+
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.12.4
16+
hooks:
17+
- id: ruff
18+
args: [--fix]
19+
- id: ruff-format
20+
21+
- repo: https://github.com/astral-sh/uv-pre-commit
22+
rev: 0.8.0
23+
hooks:
24+
- id: uv-lock

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

0 commit comments

Comments
 (0)