Skip to content

Commit d00cd01

Browse files
committed
Add devil-api
0 parents  commit d00cd01

Some content is hidden

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

45 files changed

+5336
-0
lines changed

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
outputs:
14+
upload_url: ${{ steps.create_release.outputs.upload_url }}
15+
tag_name: ${{ steps.get_version.outputs.tag_name }}
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Get version from tag
22+
id: get_version
23+
run: echo "tag_name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
24+
25+
- name: Generate changelog
26+
id: changelog
27+
run: |
28+
# Generate changelog from commits since last tag
29+
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
30+
if [ -n "$LAST_TAG" ]; then
31+
CHANGELOG=$(git log --pretty=format:"- %s (%h)" $LAST_TAG..HEAD)
32+
else
33+
CHANGELOG=$(git log --pretty=format:"- %s (%h)")
34+
fi
35+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
36+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
37+
echo "EOF" >> $GITHUB_OUTPUT
38+
39+
- name: Create Release
40+
id: create_release
41+
uses: softprops/action-gh-release@v2
42+
with:
43+
tag_name: ${{ steps.get_version.outputs.tag_name }}
44+
name: Release ${{ steps.get_version.outputs.tag_name }}
45+
body: |
46+
## Changes in ${{ steps.get_version.outputs.tag_name }}
47+
48+
${{ steps.changelog.outputs.changelog }}
49+
prerelease: ${{ contains(steps.get_version.outputs.tag_name, '-') }}

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test & Lint
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.11", "3.12", "3.13"]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Install the latest version of uv and set the python version
19+
uses: astral-sh/setup-uv@v6
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies
24+
run: uv sync --all-groups
25+
26+
- name: Run ruff linter
27+
run: uv run ruff check .
28+
29+
- name: Run ruff formatter
30+
run: uv run ruff format --check .
31+
32+
- name: Run pytest
33+
run: uv run pytest tests/ -v --cov=app/

.gitignore

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# PyCharm
156+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+
# be added to the global gitignore or merged into this project gitignore. For a JetBrains IDE
158+
# it is recommended to use a global gitignore:
159+
# https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# JetBrains IDEs
161+
.idea/
162+
163+
# VS Code
164+
.vscode/
165+
!.vscode/tasks.json
166+
!.vscode/launch.json
167+
!.vscode/extensions.json
168+
!.vscode/settings.json
169+
170+
# Project specific
171+
# Environment files
172+
.env.local
173+
.env.production
174+
.env.development
175+
176+
# Logs
177+
*.log
178+
logs/
179+
180+
# Temporary files
181+
*.tmp
182+
*.temp
183+
temp/
184+
tmp/
185+
186+
# Backup files
187+
*.backup
188+
*.bak
189+
backups/
190+
191+
# SSL Certificates (if stored locally)
192+
*.pem
193+
*.key
194+
*.crt
195+
*.cert
196+
certificates/
197+
198+
# Test outputs
199+
test_results/
200+
test_output/
201+
202+
# Documentation builds
203+
docs/_build/
204+
docs/build/
205+
206+
# MacOS
207+
.DS_Store
208+
.AppleDouble
209+
.LSOverride
210+
211+
# Windows
212+
Thumbs.db
213+
ehthumbs.db
214+
Desktop.ini
215+
216+
# Linux
217+
*~
218+
219+
# UV specific
220+
.uv/
221+
222+
# Runtime files
223+
*.pid
224+
*.sock
225+
226+
# Database files (if any)
227+
*.db
228+
*.sqlite
229+
*.sqlite3
230+
231+
# Cache directories
232+
.cache/
233+
cache/
234+
235+
# ruff cache
236+
.ruff_cache/

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.12.9
4+
hooks:
5+
- id: ruff-check
6+
args: [ --fix ]
7+
- id: ruff-format
8+
9+
- repo: local
10+
hooks:
11+
- id: pytest
12+
name: pytest
13+
entry: uv run pytest
14+
language: system
15+
types: [python]
16+
pass_filenames: false
17+
always_run: true

0 commit comments

Comments
 (0)