Skip to content

Commit

Permalink
Add tying test and additional annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed Jul 1, 2023
1 parent 243ce2c commit e19472d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/tests.yml
Expand Up @@ -15,3 +15,15 @@ jobs:
cache-dependency-path: 'requirements-ruff.txt'
- run: make ruffinstall
- run: make rufftest

typingtest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- run: make devinstall
- run: make typingtest
6 changes: 3 additions & 3 deletions demo/sigal.conf.py
Expand Up @@ -23,11 +23,11 @@
thumb_fit = False
albums_sort_attr = 'name'
medias_sort_attr = 'date'
ignore_directories = []
ignore_files = []
ignore_directories: list[str] = []
ignore_files: list[str] = []

# --------
# Plugins
# --------

plugins = ['theme_153957.full_menu', 'theme_153957.theme']
plugins: list[str] = ['theme_153957.full_menu', 'theme_153957.theme']
11 changes: 11 additions & 0 deletions pyproject.toml
Expand Up @@ -34,6 +34,9 @@ dependencies = [
]

[project.optional-dependencies]
dev = [
'mypy==1.4.1',
]
publish = [
'flit==3.9.0',
]
Expand All @@ -44,6 +47,14 @@ Repository = 'https://github.com/153957/153957-theme/'
[tool.flit.module]
name = 'theme_153957'

[tool.mypy]
ignore_missing_imports = true
show_column_numbers = true
show_error_codes = true
strict = true
warn_return_any = true
warn_unused_configs = true

[tool.black]
target-version = ['py311']
line-length = 120
Expand Down
4 changes: 3 additions & 1 deletion theme_153957/full_menu.py
Expand Up @@ -8,6 +8,8 @@
import operator
import os

from typing import Any

from sigal import signals
from sigal.gallery import Album, Gallery

Expand Down Expand Up @@ -50,7 +52,7 @@ def path_from_root(album: Album) -> None:
album.path_from_root = album.path


def register(settings: dict) -> None:
def register(settings: dict[str, Any]) -> None:
signals.gallery_initialized.connect(full_tree)
signals.album_initialized.connect(path_to_root)
signals.album_initialized.connect(path_from_root)
3 changes: 2 additions & 1 deletion theme_153957/theme.py
Expand Up @@ -2,6 +2,7 @@

from pathlib import Path
from shutil import rmtree
from typing import Any

from sigal import signals
from sigal.gallery import Gallery
Expand All @@ -24,6 +25,6 @@ def remove_leaflet(gallery: Gallery) -> None:
rmtree(leafet_path)


def register(settings: dict) -> None:
def register(settings: dict[str, Any]) -> None:
signals.gallery_initialized.connect(theme)
signals.gallery_build.connect(remove_leaflet)

0 comments on commit e19472d

Please sign in to comment.