Skip to content

Commit 3e32d5a

Browse files
committed
use sqlite + sqlalchemy as a database backend
1 parent 8469131 commit 3e32d5a

File tree

84 files changed

+4429
-6758
lines changed

Some content is hidden

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

84 files changed

+4429
-6758
lines changed

.github/workflows/apprun.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/mypy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
pip install -r requirements.txt
27-
pip install mypy==1.10.0
27+
pip install mypy==1.11.2
2828
mkdir tagstudio/.mypy_cache
2929
3030
- uses: tsuyoshicho/action-mypy@v4

.github/workflows/pytest.yaml

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pytest
22

3-
on: [push, pull_request]
3+
on: [ push, pull_request ]
44

55
jobs:
66
pytest:
@@ -11,12 +11,64 @@ jobs:
1111
- name: Checkout repo
1212
uses: actions/checkout@v4
1313

14+
- name: Setup Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.12'
18+
cache: 'pip'
19+
20+
- name: Install system dependencies
21+
run: |
22+
# dont run update, it is slow
23+
# sudo apt-get update
24+
sudo apt-get install -y --no-install-recommends \
25+
libxkbcommon-x11-0 \
26+
x11-utils \
27+
libyaml-dev \
28+
libegl1-mesa \
29+
libxcb-icccm4 \
30+
libxcb-image0 \
31+
libxcb-keysyms1 \
32+
libxcb-randr0 \
33+
libxcb-render-util0 \
34+
libxcb-xinerama0 \
35+
libopengl0 \
36+
libxcb-cursor0 \
37+
libpulse0
38+
1439
- name: Install dependencies
1540
run: |
16-
python -m pip install --upgrade pip
17-
pip install -r requirements.txt
18-
pip install -r requirements-dev.txt
41+
python -m pip install --upgrade uv
42+
uv pip install --system -r requirements.txt
43+
uv pip install --system -r requirements-dev.txt
1944
20-
- name: Run tests
45+
- name: Run pytest
2146
run: |
22-
pytest tagstudio/tests/
47+
xvfb-run pytest --cov-report xml --cov=tagstudio
48+
49+
- name: Store coverage
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: 'coverage'
53+
path: 'coverage.xml'
54+
55+
coverage:
56+
name: Check Code Coverage
57+
runs-on: ubuntu-latest
58+
needs: pytest
59+
60+
steps:
61+
- name: Load coverage
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: 'coverage'
65+
66+
- name: Check Code Coverage
67+
uses: yedpodtrzitko/coverage@main
68+
with:
69+
thresholdAll: 0.5
70+
thresholdNew: 0.5
71+
thresholdModified: 0.5
72+
coverageFile: coverage.xml
73+
token: ${{ secrets.GITHUB_TOKEN }}
74+
sourceDir: tagstudio/src

.github/workflows/ruff.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
name: Ruff
22
on: [ push, pull_request ]
33
jobs:
4-
ruff:
4+
ruff-format:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v4
88
- uses: chartboost/ruff-action@v1
99
with:
10-
version: 0.4.2
10+
version: 0.6.3
1111
args: 'format --check'
12+
13+
ruff-check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: chartboost/ruff-action@v1
18+
with:
19+
version: 0.6.3
20+
args: 'check'

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: v0.4.2
4+
rev: v0.6.3
55
hooks:
66
- id: ruff-format
7+
- id: ruff

pyproject.toml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
11
[tool.ruff]
22
exclude = ["main_window.py", "home_ui.py", "resources.py", "resources_rc.py"]
33

4+
[tool.ruff.lint]
5+
select = ["E", "F", "UP", "B", 'SIM']
6+
ignore = ["E402", "E501", "F541"]
7+
48
[tool.mypy]
59
strict_optional = false
6-
disable_error_code = ["union-attr", "annotation-unchecked", "import-untyped"]
10+
disable_error_code = ["func-returns-value", "import-untyped"]
711
explicit_package_bases = true
812
warn_unused_ignores = true
9-
exclude = ['tests']
13+
check_untyped_defs = true
14+
15+
[[tool.mypy.overrides]]
16+
module = "tests.*"
17+
ignore_errors = true
18+
19+
[[tool.mypy.overrides]]
20+
module = "src.qt.main_window"
21+
ignore_errors = true
22+
23+
[[tool.mypy.overrides]]
24+
module = "src.qt.ui.home_ui"
25+
ignore_errors = true
26+
27+
[[tool.mypy.overrides]]
28+
module = "src.core.ts_core"
29+
ignore_errors = true
30+
31+
[tool.pytest.ini_options]
32+
#addopts = "-m 'not qt'"
33+
qt_api = "pyside6"

requirements-dev.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
ruff==0.4.2
1+
ruff==0.6.3
22
pre-commit==3.7.0
33
pytest==8.2.0
44
Pyinstaller==6.6.0
5-
mypy==1.10.0
6-
syrupy==4.6.1
5+
mypy==1.11.2
6+
syrupy==4.7.1
7+
pytest-qt==4.4.0
8+
pytest-cov==5.0.0

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ numpy==1.26.4
1010
rawpy==0.21.0
1111
pillow-heif==0.16.0
1212
chardet==5.2.0
13+
structlog==24.4.0
14+
SQLAlchemy==2.0.34

0 commit comments

Comments
 (0)