litestar-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- litestar_mcp-0.1.0/.github/CODEOWNERS +7 -0
- litestar_mcp-0.1.0/.github/dependabot.yaml +6 -0
- litestar_mcp-0.1.0/.github/labeler.yml +109 -0
- litestar_mcp-0.1.0/.github/workflows/cd.yml +27 -0
- litestar_mcp-0.1.0/.github/workflows/ci.yml +202 -0
- litestar_mcp-0.1.0/.github/workflows/codeql.yml +92 -0
- litestar_mcp-0.1.0/.github/workflows/docs-preview.yml +72 -0
- litestar_mcp-0.1.0/.github/workflows/docs.yml +49 -0
- litestar_mcp-0.1.0/.github/workflows/pr-labeler.yml +48 -0
- litestar_mcp-0.1.0/.github/workflows/pr-title.yml +20 -0
- litestar_mcp-0.1.0/.github/workflows/publish.yml +31 -0
- litestar_mcp-0.1.0/.github/workflows/test.yml +74 -0
- litestar_mcp-0.1.0/.gitignore +180 -0
- litestar_mcp-0.1.0/.pre-commit-config.yaml +37 -0
- litestar_mcp-0.1.0/CHANGELOG.md +27 -0
- litestar_mcp-0.1.0/Makefile +267 -0
- litestar_mcp-0.1.0/PKG-INFO +302 -0
- litestar_mcp-0.1.0/README.md +263 -0
- litestar_mcp-0.1.0/docs/Makefile +18 -0
- litestar_mcp-0.1.0/docs/_static/custom.css +169 -0
- litestar_mcp-0.1.0/docs/_static/favicon.png +0 -0
- litestar_mcp-0.1.0/docs/_static/logo-default.png +0 -0
- litestar_mcp-0.1.0/docs/_static/versioning.js +119 -0
- litestar_mcp-0.1.0/docs/_static/versions.json +4 -0
- litestar_mcp-0.1.0/docs/changelog.rst +25 -0
- litestar_mcp-0.1.0/docs/conf.py +214 -0
- litestar_mcp-0.1.0/docs/contribution-guide.rst +104 -0
- litestar_mcp-0.1.0/docs/examples/README.md +199 -0
- litestar_mcp-0.1.0/docs/examples/advanced/main.py +182 -0
- litestar_mcp-0.1.0/docs/examples/basic/README.md +113 -0
- litestar_mcp-0.1.0/docs/examples/basic/main.py +44 -0
- litestar_mcp-0.1.0/docs/examples.rst +141 -0
- litestar_mcp-0.1.0/docs/getting-started.rst +149 -0
- litestar_mcp-0.1.0/docs/index.rst +160 -0
- litestar_mcp-0.1.0/docs/reference/config.rst +14 -0
- litestar_mcp-0.1.0/docs/reference/handlers.rst +14 -0
- litestar_mcp-0.1.0/docs/reference/index.rst +13 -0
- litestar_mcp-0.1.0/docs/reference/plugin.rst +18 -0
- litestar_mcp-0.1.0/docs/reference/types.rst +28 -0
- litestar_mcp-0.1.0/docs/usage/configuration.rst +82 -0
- litestar_mcp-0.1.0/docs/usage/examples.rst +115 -0
- litestar_mcp-0.1.0/docs/usage/index.rst +12 -0
- litestar_mcp-0.1.0/docs/usage/marking-routes.rst +169 -0
- litestar_mcp-0.1.0/litestar_mcp/__init__.py +14 -0
- litestar_mcp-0.1.0/litestar_mcp/__metadata__.py +6 -0
- litestar_mcp-0.1.0/litestar_mcp/config.py +22 -0
- litestar_mcp-0.1.0/litestar_mcp/plugin.py +133 -0
- litestar_mcp-0.1.0/litestar_mcp/py.typed +0 -0
- litestar_mcp-0.1.0/litestar_mcp/routes.py +192 -0
- litestar_mcp-0.1.0/litestar_mcp/schema.py +49 -0
- litestar_mcp-0.1.0/pyproject.toml +257 -0
- litestar_mcp-0.1.0/tests/__init__.py +1 -0
- litestar_mcp-0.1.0/tests/conftest.py +47 -0
- litestar_mcp-0.1.0/tests/test_config.py +17 -0
- litestar_mcp-0.1.0/tests/test_plugin.py +187 -0
- litestar_mcp-0.1.0/tools/__init__.py +0 -0
- litestar_mcp-0.1.0/tools/build_docs.py +95 -0
- litestar_mcp-0.1.0/tools/convert_docs.sh +7 -0
- litestar_mcp-0.1.0/tools/prepare_release.py +446 -0
- litestar_mcp-0.1.0/tools/pypi_readme.py +20 -0
- litestar_mcp-0.1.0/tools/sphinx_ext/__init__.py +16 -0
- litestar_mcp-0.1.0/tools/sphinx_ext/changelog.py +178 -0
- litestar_mcp-0.1.0/tools/sphinx_ext/missing_references.py +290 -0
- litestar_mcp-0.1.0/uv.lock +2915 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Code owner settings for `litestar-org`
|
|
2
|
+
# @maintainers should be assigned to all reviews.
|
|
3
|
+
# Most specific assignment takes precedence though, so if you add a more specific thing than the `*` glob, you must also add @maintainers
|
|
4
|
+
# For more info about code owners see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-example
|
|
5
|
+
|
|
6
|
+
# Global Assignment
|
|
7
|
+
* @litestar-org/maintainers @litestar-org/members
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
version: v1
|
|
2
|
+
|
|
3
|
+
labels:
|
|
4
|
+
# -- types -------------------------------------------------------------------
|
|
5
|
+
- label: 'type/feat'
|
|
6
|
+
sync: true
|
|
7
|
+
matcher:
|
|
8
|
+
title: '^feat(\([^)]+\))?!?:'
|
|
9
|
+
|
|
10
|
+
- label: 'type/bug'
|
|
11
|
+
sync: true
|
|
12
|
+
matcher:
|
|
13
|
+
title: '^fix(\([^)]+\))?!?:'
|
|
14
|
+
|
|
15
|
+
- label: 'type/docs'
|
|
16
|
+
sync: true
|
|
17
|
+
matcher:
|
|
18
|
+
title: '^docs(\([^)]+\))?:'
|
|
19
|
+
|
|
20
|
+
- label: 'Breaking 🔨'
|
|
21
|
+
sync: true
|
|
22
|
+
matcher:
|
|
23
|
+
title: '^(feat|fix)(\([^)]+\))?!:'
|
|
24
|
+
|
|
25
|
+
# -- distinct areas ----------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
- label: 'area/docs'
|
|
28
|
+
sync: true
|
|
29
|
+
matcher:
|
|
30
|
+
files:
|
|
31
|
+
any: ['docs/*', 'docs/**/*', '**/*.rst', '**/*.md']
|
|
32
|
+
|
|
33
|
+
- label: 'area/unit-tests'
|
|
34
|
+
sync: true
|
|
35
|
+
matcher:
|
|
36
|
+
files:
|
|
37
|
+
any: ['test/unit/*', 'test/unit/**/*', 'tests/*.py', 'tests/fixtures/**/*']
|
|
38
|
+
|
|
39
|
+
- label: 'area/integration-tests'
|
|
40
|
+
sync: true
|
|
41
|
+
matcher:
|
|
42
|
+
files:
|
|
43
|
+
any: ['test/integration/*', 'test/integration/**/*']
|
|
44
|
+
|
|
45
|
+
- label: 'area/example-apps'
|
|
46
|
+
sync: true
|
|
47
|
+
matcher:
|
|
48
|
+
files:
|
|
49
|
+
any: ['docs/examples/**/*', 'examples/**/*']
|
|
50
|
+
|
|
51
|
+
- label: 'area/docs'
|
|
52
|
+
sync: true
|
|
53
|
+
matcher:
|
|
54
|
+
files:
|
|
55
|
+
any: ['docs/*', 'docs/**/*', '**/*.rst', '**/*.md']
|
|
56
|
+
|
|
57
|
+
- label: 'area/ci'
|
|
58
|
+
sync: true
|
|
59
|
+
matcher:
|
|
60
|
+
files:
|
|
61
|
+
any: ['.github/**/*', 'codecov.yml', 'pre-commit-config.yaml', 'sonar-project.properties', '*.yaml', '*.yml']
|
|
62
|
+
|
|
63
|
+
- label: 'area/dependencies'
|
|
64
|
+
sync: true
|
|
65
|
+
matcher:
|
|
66
|
+
files:
|
|
67
|
+
any: ['pyproject.toml', '*.lock']
|
|
68
|
+
|
|
69
|
+
- label: 'area/private-api'
|
|
70
|
+
sync: true
|
|
71
|
+
matcher:
|
|
72
|
+
files:
|
|
73
|
+
any: ['litestar_mcp/_*.py', 'litestar_mcp/*/_*.py', 'litestar_mcp/_*/**/*.py']
|
|
74
|
+
|
|
75
|
+
- label: 'area/tools'
|
|
76
|
+
sync: true
|
|
77
|
+
matcher:
|
|
78
|
+
files: ['tools/**/*']
|
|
79
|
+
|
|
80
|
+
# -- Size Based Labels -------------------------------------------------------
|
|
81
|
+
- label: 'size: small'
|
|
82
|
+
sync: true
|
|
83
|
+
matcher:
|
|
84
|
+
files:
|
|
85
|
+
count:
|
|
86
|
+
gte: 1
|
|
87
|
+
lte: 10
|
|
88
|
+
|
|
89
|
+
- label: 'size: medium'
|
|
90
|
+
sync: true
|
|
91
|
+
matcher:
|
|
92
|
+
files:
|
|
93
|
+
count:
|
|
94
|
+
gte: 10
|
|
95
|
+
lte: 25
|
|
96
|
+
|
|
97
|
+
- label: 'size: large'
|
|
98
|
+
sync: true
|
|
99
|
+
matcher:
|
|
100
|
+
files:
|
|
101
|
+
count:
|
|
102
|
+
gte: 26
|
|
103
|
+
|
|
104
|
+
# -- Merge Checks --------------------------------------------------------------
|
|
105
|
+
checks:
|
|
106
|
+
- context: 'No Merge check'
|
|
107
|
+
description: "Disable merging when 'do not merge' label is set"
|
|
108
|
+
labels:
|
|
109
|
+
none: ['do not merge']
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Continuous Deployment
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
generate-changelog:
|
|
10
|
+
name: Generate changelog
|
|
11
|
+
runs-on: ubuntu-22.04
|
|
12
|
+
outputs:
|
|
13
|
+
release_body: ${{ steps.git-cliff.outputs.content }}
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v5
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
|
|
20
|
+
- name: Generate a changelog
|
|
21
|
+
uses: orhun/git-cliff-action@main
|
|
22
|
+
id: git-cliff
|
|
23
|
+
with:
|
|
24
|
+
config: pyproject.toml
|
|
25
|
+
args: -vv --latest --strip header
|
|
26
|
+
env:
|
|
27
|
+
OUTPUT: docs/CHANGELOG.rst
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
name: Tests And Linting
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: test-${{ github.head_ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
validate:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v6
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
run: uv python install 3.12
|
|
25
|
+
|
|
26
|
+
- name: Create virtual environment
|
|
27
|
+
run: uv sync --all-extras --dev
|
|
28
|
+
|
|
29
|
+
- name: Install Pre-Commit hooks
|
|
30
|
+
run: uv run pre-commit install
|
|
31
|
+
|
|
32
|
+
- name: Load cached Pre-Commit Dependencies
|
|
33
|
+
id: cached-pre-commit-dependencies
|
|
34
|
+
uses: actions/cache@v4
|
|
35
|
+
with:
|
|
36
|
+
path: ~/.cache/pre-commit/
|
|
37
|
+
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
|
38
|
+
|
|
39
|
+
- name: Execute Pre-Commit
|
|
40
|
+
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files
|
|
41
|
+
mypy:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v5
|
|
45
|
+
|
|
46
|
+
- name: Install uv
|
|
47
|
+
uses: astral-sh/setup-uv@v6
|
|
48
|
+
|
|
49
|
+
- name: Set up Python
|
|
50
|
+
run: uv python install 3.13
|
|
51
|
+
|
|
52
|
+
- name: Install dependencies
|
|
53
|
+
run: uv sync --all-extras --dev
|
|
54
|
+
|
|
55
|
+
- name: Run mypy
|
|
56
|
+
run: uv run mypy
|
|
57
|
+
|
|
58
|
+
pyright:
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v5
|
|
62
|
+
|
|
63
|
+
- name: Install uv
|
|
64
|
+
uses: astral-sh/setup-uv@v6
|
|
65
|
+
|
|
66
|
+
- name: Set up Python
|
|
67
|
+
run: uv python install 3.13
|
|
68
|
+
|
|
69
|
+
- name: Install dependencies
|
|
70
|
+
run: uv sync --all-extras --dev
|
|
71
|
+
|
|
72
|
+
- name: Run pyright
|
|
73
|
+
run: uv run pyright
|
|
74
|
+
|
|
75
|
+
# # TODO(cofin)
|
|
76
|
+
# # AttributeError: 'SuiteRequirements' object has no attribute 'computed_reflects_normally'
|
|
77
|
+
slotscheck:
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
steps:
|
|
80
|
+
- uses: actions/checkout@v5
|
|
81
|
+
|
|
82
|
+
- name: Install uv
|
|
83
|
+
uses: astral-sh/setup-uv@v6
|
|
84
|
+
|
|
85
|
+
- name: Set up Python
|
|
86
|
+
run: uv python install 3.13
|
|
87
|
+
|
|
88
|
+
- name: Install dependencies
|
|
89
|
+
run: uv sync --all-extras --dev
|
|
90
|
+
|
|
91
|
+
- name: Run slotscheck
|
|
92
|
+
run: uv run slotscheck -m litestar_mcp
|
|
93
|
+
|
|
94
|
+
test:
|
|
95
|
+
name: "test (${{ matrix.python-version }}"
|
|
96
|
+
strategy:
|
|
97
|
+
fail-fast: true
|
|
98
|
+
matrix:
|
|
99
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
100
|
+
uses: ./.github/workflows/test.yml
|
|
101
|
+
with:
|
|
102
|
+
coverage: ${{ matrix.python-version == '3.13' }}
|
|
103
|
+
python-version: ${{ matrix.python-version }}
|
|
104
|
+
sonar:
|
|
105
|
+
needs:
|
|
106
|
+
- test
|
|
107
|
+
- validate
|
|
108
|
+
if: github.event.pull_request.head.repo.fork == false && github.repository_owner == 'litestar-org'
|
|
109
|
+
runs-on: ubuntu-latest
|
|
110
|
+
steps:
|
|
111
|
+
- name: Check out repository
|
|
112
|
+
uses: actions/checkout@v5
|
|
113
|
+
with:
|
|
114
|
+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
|
115
|
+
- name: Download Artifacts
|
|
116
|
+
uses: actions/download-artifact@v5
|
|
117
|
+
with:
|
|
118
|
+
name: coverage-xml
|
|
119
|
+
|
|
120
|
+
- name: SonarCloud Scan
|
|
121
|
+
uses: SonarSource/sonarqube-scan-action@v5
|
|
122
|
+
env:
|
|
123
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
124
|
+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
125
|
+
|
|
126
|
+
codecov:
|
|
127
|
+
needs:
|
|
128
|
+
- test
|
|
129
|
+
- validate
|
|
130
|
+
runs-on: ubuntu-latest
|
|
131
|
+
permissions:
|
|
132
|
+
security-events: write
|
|
133
|
+
steps:
|
|
134
|
+
- uses: actions/checkout@v5
|
|
135
|
+
- uses: actions/setup-python@v5
|
|
136
|
+
with:
|
|
137
|
+
python-version: "3.13"
|
|
138
|
+
|
|
139
|
+
- name: Download Artifacts
|
|
140
|
+
uses: actions/download-artifact@v5
|
|
141
|
+
with:
|
|
142
|
+
name: coverage-xml
|
|
143
|
+
path: coverage.xml
|
|
144
|
+
merge-multiple: true
|
|
145
|
+
|
|
146
|
+
# - name: Combine coverage files
|
|
147
|
+
# run: |
|
|
148
|
+
# python -Im pip install coverage covdefaults
|
|
149
|
+
# python -Im coverage combine
|
|
150
|
+
# python -Im coverage xml -i
|
|
151
|
+
|
|
152
|
+
# - name: Fix coverage file name
|
|
153
|
+
# run: sed -i "s/home\/runner\/work\/litestar-mcp\/litestar-mcp/github\/workspace/g" coverage.xml
|
|
154
|
+
|
|
155
|
+
- name: Upload coverage reports to Codecov
|
|
156
|
+
uses: codecov/codecov-action@v5
|
|
157
|
+
with:
|
|
158
|
+
files: coverage.xml
|
|
159
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
160
|
+
slug: litestar-org/litestar-mcp
|
|
161
|
+
|
|
162
|
+
build-docs:
|
|
163
|
+
needs:
|
|
164
|
+
- validate
|
|
165
|
+
if: github.event_name == 'pull_request'
|
|
166
|
+
runs-on: ubuntu-latest
|
|
167
|
+
steps:
|
|
168
|
+
- name: Check out repository
|
|
169
|
+
uses: actions/checkout@v5
|
|
170
|
+
|
|
171
|
+
- name: Install Microsoft ODBC
|
|
172
|
+
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y
|
|
173
|
+
|
|
174
|
+
- name: Install uv
|
|
175
|
+
uses: astral-sh/setup-uv@v6
|
|
176
|
+
|
|
177
|
+
- name: Set up Python
|
|
178
|
+
run: uv python install 3.13
|
|
179
|
+
|
|
180
|
+
- name: Install dependencies
|
|
181
|
+
run: uv sync --all-extras --dev
|
|
182
|
+
|
|
183
|
+
- name: Build docs
|
|
184
|
+
run: uv run make docs
|
|
185
|
+
|
|
186
|
+
- name: Check docs links
|
|
187
|
+
env:
|
|
188
|
+
LITESTAR_DOCS_IGNORE_MISSING_EXAMPLE_OUTPUT: 1
|
|
189
|
+
run: uv run make docs-linkcheck
|
|
190
|
+
|
|
191
|
+
- name: Save PR number
|
|
192
|
+
run: |
|
|
193
|
+
echo "${{ github.event.number }}" > .pr_number
|
|
194
|
+
|
|
195
|
+
- name: Upload artifact
|
|
196
|
+
uses: actions/upload-artifact@v4
|
|
197
|
+
with:
|
|
198
|
+
name: docs-preview
|
|
199
|
+
path: |
|
|
200
|
+
docs/_build/html
|
|
201
|
+
.pr_number
|
|
202
|
+
include-hidden-files: true
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
+
# to commit it to your repository.
|
|
3
|
+
#
|
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
+
# or to provide custom queries or build logic.
|
|
6
|
+
#
|
|
7
|
+
# ******** NOTE ********
|
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
+
# supported CodeQL languages.
|
|
11
|
+
#
|
|
12
|
+
name: "CodeQL"
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
push:
|
|
16
|
+
branches: [ "main" ]
|
|
17
|
+
pull_request:
|
|
18
|
+
branches: [ "main" ]
|
|
19
|
+
schedule:
|
|
20
|
+
- cron: '43 0 * * 0'
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
analyze:
|
|
24
|
+
name: Analyze (${{ matrix.language }})
|
|
25
|
+
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
|
26
|
+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
|
27
|
+
# - https://gh.io/supported-runners-and-hardware-resources
|
|
28
|
+
# - https://gh.io/using-larger-runners (GitHub.com only)
|
|
29
|
+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
|
30
|
+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
|
31
|
+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
|
32
|
+
permissions:
|
|
33
|
+
# required for all workflows
|
|
34
|
+
security-events: write
|
|
35
|
+
|
|
36
|
+
# required to fetch internal or private CodeQL packs
|
|
37
|
+
packages: read
|
|
38
|
+
|
|
39
|
+
# only required for workflows in private repositories
|
|
40
|
+
actions: read
|
|
41
|
+
contents: read
|
|
42
|
+
|
|
43
|
+
strategy:
|
|
44
|
+
fail-fast: false
|
|
45
|
+
matrix:
|
|
46
|
+
include:
|
|
47
|
+
- language: python
|
|
48
|
+
build-mode: none
|
|
49
|
+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
|
50
|
+
# Use `c-cpp` to analyze code written in C, C++ or both
|
|
51
|
+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
|
52
|
+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
|
53
|
+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
|
54
|
+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
|
55
|
+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
|
56
|
+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
|
57
|
+
steps:
|
|
58
|
+
- name: Checkout repository
|
|
59
|
+
uses: actions/checkout@v5
|
|
60
|
+
|
|
61
|
+
# Initializes the CodeQL tools for scanning.
|
|
62
|
+
- name: Initialize CodeQL
|
|
63
|
+
uses: github/codeql-action/init@v3
|
|
64
|
+
with:
|
|
65
|
+
languages: ${{ matrix.language }}
|
|
66
|
+
build-mode: ${{ matrix.build-mode }}
|
|
67
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
68
|
+
# By default, queries listed here will override any specified in a config file.
|
|
69
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
70
|
+
|
|
71
|
+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
72
|
+
# queries: security-extended,security-and-quality
|
|
73
|
+
|
|
74
|
+
# If the analyze step fails for one of the languages you are analyzing with
|
|
75
|
+
# "We were unable to automatically build your code", modify the matrix above
|
|
76
|
+
# to set the build mode to "manual" for that language. Then modify this step
|
|
77
|
+
# to build your code.
|
|
78
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
79
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
80
|
+
- if: matrix.build-mode == 'manual'
|
|
81
|
+
run: |
|
|
82
|
+
echo 'If you are using a "manual" build mode for one or more of the' \
|
|
83
|
+
'languages you are analyzing, replace this with the commands to build' \
|
|
84
|
+
'your code, for example:'
|
|
85
|
+
echo ' make bootstrap'
|
|
86
|
+
echo ' make release'
|
|
87
|
+
exit 1
|
|
88
|
+
|
|
89
|
+
- name: Perform CodeQL Analysis
|
|
90
|
+
uses: github/codeql-action/analyze@v3
|
|
91
|
+
with:
|
|
92
|
+
category: "/language:${{matrix.language}}"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
name: Deploy Documentation Preview
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: [Tests And Linting]
|
|
6
|
+
types: [completed]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
issues: write
|
|
14
|
+
pull-requests: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Check out repository
|
|
18
|
+
uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Download artifact
|
|
21
|
+
uses: dawidd6/action-download-artifact@v11
|
|
22
|
+
with:
|
|
23
|
+
workflow_conclusion: success
|
|
24
|
+
run_id: ${{ github.event.workflow_run.id }}
|
|
25
|
+
path: docs-preview
|
|
26
|
+
name: docs-preview
|
|
27
|
+
|
|
28
|
+
- name: Set PR number
|
|
29
|
+
run: echo "PR_NUMBER=$(cat docs-preview/.pr_number)" >> $GITHUB_ENV
|
|
30
|
+
|
|
31
|
+
- name: Deploy docs preview
|
|
32
|
+
uses: JamesIves/github-pages-deploy-action@v4
|
|
33
|
+
with:
|
|
34
|
+
folder: docs-preview/docs/_build/html
|
|
35
|
+
token: ${{ secrets.DOCS_PREVIEW_DEPLOY_TOKEN }}
|
|
36
|
+
repository-name: litestar-org/litestar-mcp-docs-preview
|
|
37
|
+
clean: false
|
|
38
|
+
target-folder: ${{ env.PR_NUMBER }}
|
|
39
|
+
branch: gh-pages
|
|
40
|
+
|
|
41
|
+
- uses: actions/github-script@v7
|
|
42
|
+
env:
|
|
43
|
+
PR_NUMBER: ${{ env.PR_NUMBER }}
|
|
44
|
+
with:
|
|
45
|
+
script: |
|
|
46
|
+
const issue_number = process.env.PR_NUMBER
|
|
47
|
+
const body = "Documentation preview will be available shortly at https://litestar-org.github.io/litestar-mcp-docs-preview/" + issue_number
|
|
48
|
+
|
|
49
|
+
const opts = github.rest.issues.listComments.endpoint.merge({
|
|
50
|
+
owner: context.repo.owner,
|
|
51
|
+
repo: context.repo.repo,
|
|
52
|
+
issue_number: issue_number,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const comments = await github.paginate(opts)
|
|
56
|
+
|
|
57
|
+
for (const comment of comments) {
|
|
58
|
+
if (comment.user.id === 41898282 && comment.body === body) {
|
|
59
|
+
await github.rest.issues.deleteComment({
|
|
60
|
+
owner: context.repo.owner,
|
|
61
|
+
repo: context.repo.repo,
|
|
62
|
+
comment_id: comment.id
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
await github.rest.issues.createComment({
|
|
68
|
+
owner: context.repo.owner,
|
|
69
|
+
repo: context.repo.repo,
|
|
70
|
+
issue_number: issue_number,
|
|
71
|
+
body: body,
|
|
72
|
+
})
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Documentation Building
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- main
|
|
9
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build_and_deploy:
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
pages: write
|
|
17
|
+
id-token: write
|
|
18
|
+
environment:
|
|
19
|
+
name: github-pages
|
|
20
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v5
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v6
|
|
27
|
+
|
|
28
|
+
- name: Set up Python
|
|
29
|
+
run: uv python install 3.13
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: uv sync --all-extras --dev
|
|
33
|
+
|
|
34
|
+
- name: Build Release Documentation
|
|
35
|
+
run: uv run python tools/build_docs.py docs-build --version latest
|
|
36
|
+
if: github.event_name == 'release'
|
|
37
|
+
|
|
38
|
+
- name: Build Documentation
|
|
39
|
+
run: uv run python tools/build_docs.py docs-build --version latest
|
|
40
|
+
if: github.event_name != 'release'
|
|
41
|
+
|
|
42
|
+
- name: Upload artifact
|
|
43
|
+
uses: actions/upload-pages-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
path: docs-build/
|
|
46
|
+
|
|
47
|
+
- name: Deploy to GitHub Pages
|
|
48
|
+
id: deployment
|
|
49
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: "Pull Request Labeler"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
apply-labels:
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pull-requests: write
|
|
11
|
+
checks: write
|
|
12
|
+
statuses: write
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: fuxingloh/multi-labeler@v4
|
|
16
|
+
with:
|
|
17
|
+
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
18
|
+
|
|
19
|
+
distinguish-pr-origin:
|
|
20
|
+
needs: apply-labels
|
|
21
|
+
if: ${{ always() }}
|
|
22
|
+
permissions:
|
|
23
|
+
pull-requests: write
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/github-script@v7
|
|
27
|
+
with:
|
|
28
|
+
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
29
|
+
script: |
|
|
30
|
+
const maintainers = [
|
|
31
|
+
'JacobCoffee', 'provinzkraut', 'cofin','Alc-Alc',
|
|
32
|
+
'dependabot[bot]', 'all-contributors[bot]'
|
|
33
|
+
]
|
|
34
|
+
if (maintainers.includes(context.payload.sender.login)) {
|
|
35
|
+
github.rest.issues.addLabels({
|
|
36
|
+
issue_number: context.issue.number,
|
|
37
|
+
owner: context.repo.owner,
|
|
38
|
+
repo: context.repo.repo,
|
|
39
|
+
labels: ['pr/internal']
|
|
40
|
+
})
|
|
41
|
+
} else {
|
|
42
|
+
github.rest.issues.addLabels({
|
|
43
|
+
issue_number: context.issue.number,
|
|
44
|
+
owner: context.repo.owner,
|
|
45
|
+
repo: context.repo.repo,
|
|
46
|
+
labels: ['pr/external', 'Triage Required :hospital:']
|
|
47
|
+
})
|
|
48
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: "Lint PR Title"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- edited
|
|
8
|
+
- synchronize
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
pull-requests: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
main:
|
|
15
|
+
name: Validate PR title
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: amannn/action-semantic-pull-request@v6
|
|
19
|
+
env:
|
|
20
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Latest Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish-release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write
|
|
13
|
+
environment: release
|
|
14
|
+
steps:
|
|
15
|
+
- name: Check out repository
|
|
16
|
+
uses: actions/checkout@v5
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v6
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
run: uv python install 3.13
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: uv sync --all-extras
|
|
26
|
+
|
|
27
|
+
- name: Build package
|
|
28
|
+
run: uv build
|
|
29
|
+
|
|
30
|
+
- name: Publish package distributions to PyPI
|
|
31
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|