Skip to content
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

SQLite DB with SQLAlchemy II #332

Merged
merged 17 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .github/workflows/apprun.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install mypy==1.10.0
pip install mypy==1.11.2
mkdir tagstudio/.mypy_cache

- uses: tsuyoshicho/action-mypy@v4
Expand Down
64 changes: 58 additions & 6 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pytest

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
pytest:
Expand All @@ -11,12 +11,64 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install system dependencies
run: |
# dont run update, it is slow
# sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libxkbcommon-x11-0 \
x11-utils \
libyaml-dev \
libegl1-mesa \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libopengl0 \
libxcb-cursor0 \
libpulse0
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
python -m pip install --upgrade uv
uv pip install --system -r requirements.txt
uv pip install --system -r requirements-dev.txt
- name: Run tests
- name: Run pytest
run: |
pytest tagstudio/tests/
xvfb-run pytest --cov-report xml --cov=tagstudio
- name: Store coverage
uses: actions/upload-artifact@v4
with:
name: 'coverage'
path: 'coverage.xml'

coverage:
name: Check Code Coverage
runs-on: ubuntu-latest
needs: pytest

steps:
- name: Load coverage
uses: actions/download-artifact@v4
with:
name: 'coverage'

- name: Check Code Coverage
uses: yedpodtrzitko/coverage@main
with:
thresholdAll: 0.5
thresholdNew: 0.5
thresholdModified: 0.5
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
sourceDir: tagstudio/src
13 changes: 11 additions & 2 deletions .github/workflows/ruff.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
name: Ruff
on: [ push, pull_request ]
jobs:
ruff:
ruff-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
version: 0.4.2
version: 0.6.4
args: 'format --check'

ruff-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
version: 0.6.4
args: 'check'
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.2
rev: v0.6.4
hooks:
- id: ruff-format
- id: ruff
28 changes: 26 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
[tool.ruff]
exclude = ["main_window.py", "home_ui.py", "resources.py", "resources_rc.py"]

[tool.ruff.lint]
select = ["E", "F", "UP", "B", 'SIM']
ignore = ["E402", "E501", "F541"]

[tool.mypy]
strict_optional = false
disable_error_code = ["union-attr", "annotation-unchecked", "import-untyped"]
disable_error_code = ["func-returns-value", "import-untyped"]
explicit_package_bases = true
warn_unused_ignores = true
exclude = ['tests']
check_untyped_defs = true

[[tool.mypy.overrides]]
module = "tests.*"
ignore_errors = true

[[tool.mypy.overrides]]
module = "src.qt.main_window"
ignore_errors = true

[[tool.mypy.overrides]]
module = "src.qt.ui.home_ui"
ignore_errors = true

[[tool.mypy.overrides]]
module = "src.core.ts_core"
ignore_errors = true

[tool.pytest.ini_options]
#addopts = "-m 'not qt'"
qt_api = "pyside6"
8 changes: 5 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ruff==0.4.2
ruff==0.6.4
pre-commit==3.7.0
pytest==8.2.0
Pyinstaller==6.6.0
mypy==1.10.0
syrupy==4.6.1
mypy==1.11.2
syrupy==4.7.1
pytest-qt==4.4.0
pytest-cov==5.0.0
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ numpy==1.26.4
rawpy==0.21.0
pillow-heif==0.16.0
chardet==5.2.0
structlog==24.4.0
SQLAlchemy==2.0.34
Loading