Skip to content

Commit 42577b7

Browse files
authored
Merge pull request #844 from TagStudioDev/layout-refactor-1
refactor!: restructure project to use proper src-layout
2 parents 981cc60 + 55bc7aa commit 42577b7

File tree

292 files changed

+1942
-1859
lines changed

Some content is hidden

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

292 files changed

+1942
-1859
lines changed

.envrc.recommended

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
# vi: ft=bash
2-
#
31
# If you wish to use this file, copy or symlink it to `.envrc` for direnv to read it.
42
# This will use the flake development shell.
53

6-
if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then
7-
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w="
4+
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
5+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
86
fi
97

10-
devenv_root_file="$(mktemp -t devenv-root-XXXXXXXX)"
11-
printf %s "${PWD}" >"${devenv_root_file}"
12-
if ! use flake . --override-input devenv-root "file+file://${devenv_root_file}"; then
13-
printf '%s\n' "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
8+
if [ -f .venv/bin/activate ]; then
9+
# If the file is watched when it does not exist,
10+
# direnv will execute again when it gets created.
11+
watch_file .venv/bin/activate
1412
fi
15-
rm "${devenv_root_file}"
16-
unset devenv_root_file
13+
watch_file nix/shell.nix
14+
watch_file pyproject.toml
15+
16+
use flake
17+
18+
# vi: ft=bash

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
---
12
patreon: cyanvoxel

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Bug Report
23
description: File a bug or issue report.
34
title: '[Bug]: '
@@ -51,7 +52,7 @@ body:
5152
- type: textarea
5253
attributes:
5354
label: Steps to Reproduce
54-
description: Minimal steps neded for the problem to occur.
55+
description: Minimal steps needed for the problem to occur.
5556
placeholder: |
5657
1.
5758
2.

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Feature Request
23
description: Suggest a new feature.
34
title: '[Feature Request]: '

.github/workflows/mypy.yaml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
1+
---
12
name: MyPy
23

3-
on: [ push, pull_request ]
4-
4+
on: [push, pull_request]
55

66
jobs:
77
mypy:
88
name: Run MyPy
99
runs-on: ubuntu-latest
10-
1110
steps:
12-
- name: Checkout code
11+
- name: Checkout repo
1312
uses: actions/checkout@v4
1413

15-
- uses: reviewdog/action-setup@v1
14+
- name: Setup reviewdog
15+
uses: reviewdog/action-setup@v1
1616
with:
1717
reviewdog_version: latest
1818

19-
- uses: actions/setup-python@v5
19+
- name: Setup Python
20+
uses: actions/setup-python@v5
2021
with:
2122
python-version: '3.12'
22-
cache: 'pip'
23+
cache: pip
2324

24-
- name: Install dependencies
25+
- name: Install Python dependencies
2526
run: |
2627
python -m pip install --upgrade uv
27-
uv pip install --system -r requirements.txt
28-
uv pip install --system mypy==1.11.2
29-
mkdir tagstudio/.mypy_cache
28+
uv pip install --system .[mypy]
3029
31-
- uses: tsuyoshicho/action-mypy@v4
30+
- name: Execute MyPy
31+
uses: tsuyoshicho/action-mypy@v4
3232
with:
3333
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
reporter: github-check
3534
fail_on_error: true
36-
workdir: tagstudio
37-
level: error
38-
mypy_flags: --config-file ../pyproject.toml
Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
1-
name: Publish Docs
1+
---
2+
name: Publish Docs
23

34
on:
45
push:
56
branches:
67
- main
78
paths:
8-
- 'docs/**'
9-
- 'mkdocs.yml'
10-
- 'CHANGELOG.md'
11-
- '.github/workflows/publish_docs.yaml'
9+
- .github/workflows/publish_docs.yaml
10+
- docs/**
11+
- mkdocs.yml
12+
- CHANGELOG.md
1213

1314
permissions:
1415
contents: write
1516

16-
concurrency:
17+
concurrency:
1718
group: publish-docs
1819
cancel-in-progress: true
1920

2021
jobs:
2122
deploy:
2223
runs-on: ubuntu-latest
2324
steps:
24-
- uses: actions/checkout@v4
25-
- uses: actions/setup-python@v5
25+
- name: Checkout repo
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Python
29+
uses: actions/setup-python@v5
2630
with:
27-
python-version: 3.x
28-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
31+
python-version: '3.12'
32+
cache: pip
33+
34+
- name: Install Python dependencies
35+
run: |
36+
python -m pip install --upgrade uv
37+
uv pip install --system .[mkdocs]
38+
39+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
40+
2941
- uses: actions/cache@v4
3042
with:
3143
key: mkdocs-material-${{ env.cache_id }}
3244
path: .cache
3345
restore-keys: |
3446
mkdocs-material-
35-
- run: pip install mkdocs-material mkdocs-material[imaging]
36-
- run: mkdocs gh-deploy --force
37-
3847
48+
- name: Execute mkdocs
49+
run: mkdocs gh-deploy --force

.github/workflows/pytest.yaml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
---
12
name: pytest
23

3-
on: [ push, pull_request ]
4+
on: [push, pull_request]
45

56
jobs:
67
pytest:
7-
name: Run tests
8+
name: Run pytest
89
runs-on: ubuntu-24.04
910

1011
steps:
@@ -15,56 +16,54 @@ jobs:
1516
uses: actions/setup-python@v5
1617
with:
1718
python-version: '3.12'
18-
cache: 'pip'
19+
cache: pip
20+
21+
- name: Install Python dependencies
22+
run: |
23+
python -m pip install --upgrade uv
24+
uv pip install --system .[pytest]
1925
2026
- name: Install system dependencies
2127
run: |
22-
# dont run update, it is slow
2328
sudo apt-get update
2429
sudo apt-get install -y --no-install-recommends \
25-
libxkbcommon-x11-0 \
26-
x11-utils \
27-
libyaml-dev \
28-
libgl1 \
2930
libegl1 \
31+
libgl1 \
32+
libopengl0 \
33+
libpulse0 \
34+
libxcb-cursor0 \
3035
libxcb-icccm4 \
3136
libxcb-image0 \
3237
libxcb-keysyms1 \
3338
libxcb-randr0 \
3439
libxcb-render-util0 \
3540
libxcb-xinerama0 \
36-
libopengl0 \
37-
libxcb-cursor0 \
38-
libpulse0
39-
40-
- name: Install dependencies
41-
run: |
42-
python -m pip install --upgrade uv
43-
uv pip install --system -r requirements.txt
44-
uv pip install --system -r requirements-dev.txt
41+
libxkbcommon-x11-0 \
42+
libyaml-dev \
43+
x11-utils
4544
46-
- name: Run pytest
45+
- name: Execute pytest
4746
run: |
4847
xvfb-run pytest --cov-report xml --cov=tagstudio
4948
50-
- name: Store coverage
49+
- name: Upload coverage
5150
uses: actions/upload-artifact@v4
5251
with:
53-
name: 'coverage'
54-
path: 'coverage.xml'
52+
name: coverage
53+
path: coverage.xml
5554

5655
coverage:
57-
name: Check Code Coverage
56+
name: Check coverage
5857
runs-on: ubuntu-latest
5958
needs: pytest
6059

6160
steps:
62-
- name: Load coverage
61+
- name: Fetch coverage
6362
uses: actions/download-artifact@v4
6463
with:
65-
name: 'coverage'
64+
name: coverage
6665

67-
- name: Check Code Coverage
66+
- name: Check coverage
6867
uses: yedpodtrzitko/coverage@main
6968
with:
7069
thresholdAll: 0.4

0 commit comments

Comments
 (0)