Skip to content

Commit 90528b1

Browse files
Cleanup Typing (#186)
- Implement #177 - Rename `Base*` classes to `Basic*` - Remove `*Entry` classes - Replace instances of `*Entry` with `Basic*` - Rename `CountEntry` to `GenericCount` - Rename `CreatorEntry` to `GenericCreator` - Rename `IssueEntry` to `GenericIssue` - Rename `Image` to `Images` - Change url fields from `str` to `pydantic.HttpUrl` - Make use dependency-groups so that dev, test and docs are no longer included output dependencies - Migrate tox to pyproject
1 parent e6abfab commit 90528b1

Some content is hidden

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

54 files changed

+907
-1273
lines changed

.editorconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ max_line_length = 100
1212
[*.bat]
1313
indent_style = tab
1414

15-
[*.cs]
16-
indent_size = 4
17-
indent_style = tab
18-
insert_final_newline = false
19-
20-
[*.java]
21-
indent_size = 4
22-
indent_style = tab
23-
insert_final_newline = false
24-
2515
[*.json]
2616
insert_final_newline = false
2717

.github/workflows/testing.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Setup Python
3939
run: uv python install ${{ matrix.python-version }}
4040
- name: Install project
41-
run: uv sync --dev
41+
run: uv sync --group tests
4242
- name: Run tests
4343
env:
4444
COMICVINE__API_KEY: IGNORED

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,4 @@ cython_debug/
144144

145145
# Custom
146146
.ruff_cache/
147+
uv.lock

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.5.0
3+
rev: v0.8.4
44
hooks:
55
- id: ruff-format
66
- id: ruff
77
- repo: https://github.com/executablebooks/mdformat
8-
rev: 0.7.17
8+
rev: 0.7.21
99
hooks:
1010
- id: mdformat
1111
additional_dependencies:
@@ -15,7 +15,7 @@ repos:
1515
- --number
1616
- --wrap=keep
1717
- repo: https://github.com/pre-commit/pre-commit-hooks
18-
rev: v4.6.0
18+
rev: v5.0.0
1919
hooks:
2020
- id: check-ast
2121
- id: check-builtin-literals
@@ -42,7 +42,7 @@ repos:
4242
args:
4343
- --markdown-linebreak-ext=md
4444
- repo: https://github.com/pappasam/toml-sort
45-
rev: v0.23.1
45+
rev: v0.24.2
4646
hooks:
4747
- id: toml-sort
4848
args:

.readthedocs.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.12"
11+
python: "3.13"
12+
jobs:
13+
post_create_environment:
14+
- pip install uv
15+
post_install:
16+
- UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group docs --inexact
1217

1318
mkdocs:
1419
configuration: mkdocs.yaml
15-
16-
# Optionally declare the Python requirements required to build your docs
17-
python:
18-
install:
19-
- method: pip
20-
path: .
21-
extra_requirements:
22-
- docs

docs/img/favicon.ico

-766 Bytes
Binary file not shown.

docs/simyan/exceptions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Exceptions
22

33
::: simyan.exceptions.AuthenticationError
4-
::: simyan.exceptions.CacheError
54
::: simyan.exceptions.ServiceError

docs/simyan/schemas/character.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Character
22

3-
::: simyan.schemas.character.BaseCharacter
3+
::: simyan.schemas.character.BasicCharacter
44
::: simyan.schemas.character.Character
5-
::: simyan.schemas.character.CharacterEntry

docs/simyan/schemas/concept.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Concept
22

3-
::: simyan.schemas.concept.BaseConcept
3+
::: simyan.schemas.concept.BasicConcept
44
::: simyan.schemas.concept.Concept
5-
::: simyan.schemas.concept.ConceptEntry

docs/simyan/schemas/creator.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Creator
22

3-
::: simyan.schemas.creator.BaseCreator
3+
::: simyan.schemas.creator.BasicCreator
44
::: simyan.schemas.creator.Creator
5-
::: simyan.schemas.creator.CreatorEntry
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Generic Entries
22

33
::: simyan.schemas.generic_entries.AssociatedImage
4-
::: simyan.schemas.generic_entries.CountEntry
5-
::: simyan.schemas.generic_entries.CreatorEntry
4+
::: simyan.schemas.generic_entries.GenericCount
5+
::: simyan.schemas.generic_entries.GenericCreator
66
::: simyan.schemas.generic_entries.GenericEntry
7-
::: simyan.schemas.generic_entries.Image
8-
::: simyan.schemas.generic_entries.IssueEntry
7+
::: simyan.schemas.generic_entries.GenericIssue
8+
::: simyan.schemas.generic_entries.Images

docs/simyan/schemas/issue.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Issue
22

3-
::: simyan.schemas.issue.BaseIssue
3+
::: simyan.schemas.issue.BasicIssue
44
::: simyan.schemas.issue.Issue
5-
::: simyan.schemas.issue.IssueEntry

docs/simyan/schemas/item.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Item
22

3-
::: simyan.schemas.item.BaseItem
3+
::: simyan.schemas.item.BasicItem
44
::: simyan.schemas.item.Item
5-
::: simyan.schemas.item.ItemEntry

docs/simyan/schemas/location.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Location
22

3-
::: simyan.schemas.location.BaseLocation
3+
::: simyan.schemas.location.BasicLocation
44
::: simyan.schemas.location.Location
5-
::: simyan.schemas.location.LocationEntry

docs/simyan/schemas/origin.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Origin
22

3-
::: simyan.schemas.origin.BaseOrigin
3+
::: simyan.schemas.origin.BasicOrigin
44
::: simyan.schemas.origin.Origin
5-
::: simyan.schemas.origin.OriginEntry

docs/simyan/schemas/power.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Power
22

3-
::: simyan.schemas.power.BasePower
3+
::: simyan.schemas.power.BasicPower
44
::: simyan.schemas.power.Power
5-
::: simyan.schemas.power.PowerEntry

docs/simyan/schemas/publisher.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Publisher
22

3-
::: simyan.schemas.publisher.BasePublisher
3+
::: simyan.schemas.publisher.BasicPublisher
44
::: simyan.schemas.publisher.Publisher
5-
::: simyan.schemas.publisher.PublisherEntry

docs/simyan/schemas/story_arc.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Story Arc
22

3-
::: simyan.schemas.story_arc.BaseStoryArc
3+
::: simyan.schemas.story_arc.BasicStoryArc
44
::: simyan.schemas.story_arc.StoryArc
5-
::: simyan.schemas.story_arc.StoryArcEntry

docs/simyan/schemas/team.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Team
22

3-
::: simyan.schemas.team.BaseTeam
3+
::: simyan.schemas.team.BasicTeam
44
::: simyan.schemas.team.Team
5-
::: simyan.schemas.team.TeamEntry

docs/simyan/schemas/volume.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Volume
22

3-
::: simyan.schemas.volume.BaseVolume
3+
::: simyan.schemas.volume.BasicVolume
44
::: simyan.schemas.volume.Volume
5-
::: simyan.schemas.volume.VolumeEntry

mkdocs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ repo_name: Metron-Project/Simyan
1010

1111
theme:
1212
name: material
13-
favicon: img/favicon.ico
1413
features:
1514
- content.code.copy
1615
- navigation.expand

pyproject.toml

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
build-backend = "hatchling.build"
33
requires = ["hatchling"]
44

5+
[dependency-groups]
6+
dev = [
7+
"pre-commit >= 4.0.1"
8+
]
9+
docs = [
10+
"mkdocs >= 1.6.1",
11+
"mkdocs-include-markdown-plugin >= 7.1.2",
12+
"mkdocs-material >= 9.5.48",
13+
"mkdocstrings[python] >= 0.27.0"
14+
]
15+
tests = [
16+
"pytest >= 8.3.4",
17+
"pytest-cov >= 6.0.0",
18+
"tox >= 4.23.2",
19+
"tox-uv >= 1.16.1"
20+
]
21+
522
[project]
623
authors = [
724
{email = "[email protected]", name = "BuriedInCode"}
@@ -25,30 +42,22 @@ classifiers = [
2542
"Typing :: Typed"
2643
]
2744
dependencies = [
28-
"eval-type-backport >= 0.2.0; python_version < \"3.10\"",
29-
"pydantic >= 2.9.2",
45+
"eval-type-backport >= 0.2.0; python_version < '3.10'",
46+
"pydantic >= 2.10.4",
3047
"ratelimit >= 2.2.1",
3148
"requests >= 2.32.3"
3249
]
3350
description = "A Python wrapper for the Comicvine API."
3451
dynamic = ["version"]
3552
keywords = ["comic", "comics", "metadata"]
36-
license = "GPL-3.0-or-later"
53+
license = {text = "GPL-3.0-or-later"}
3754
maintainers = [
3855
{email = "[email protected]", name = "BuriedInCode"}
3956
]
4057
name = "Simyan"
4158
readme = "README.md"
4259
requires-python = ">= 3.9"
4360

44-
[project.optional-dependencies]
45-
docs = [
46-
"mkdocs >= 1.6.1",
47-
"mkdocs-include-markdown-plugin >= 6.2.2",
48-
"mkdocs-material >= 9.5.39",
49-
"mkdocstrings[python] >= 0.26.1"
50-
]
51-
5261
[project.urls]
5362
Documentation = "https://simyan.readthedocs.io/en/latest/"
5463
Homepage = "https://pypi.org/project/Simyan"
@@ -61,6 +70,9 @@ show_missing = true
6170
[tool.coverage.run]
6271
source = ["simyan"]
6372

73+
[tool.hatch.build.targets.sdist]
74+
exclude = [".github/"]
75+
6476
[tool.hatch.version]
6577
path = "simyan/__init__.py"
6678

@@ -83,10 +95,13 @@ skip-magic-trailing-comma = true
8395
ignore = [
8496
"COM812",
8597
"D107",
86-
"EXE",
98+
"DTZ001",
99+
"EM101",
100+
"EM102",
87101
"FBT",
88102
"PLR2004",
89-
"TCH"
103+
"TCH",
104+
"TRY003"
90105
]
91106
select = ["ALL"]
92107

@@ -108,19 +123,24 @@ split-on-trailing-comma = false
108123
classmethod-decorators = ["classmethod", "pydantic.field_validator"]
109124

110125
[tool.ruff.lint.per-file-ignores]
111-
"tests/*" = ["S101"]
126+
"tests/*" = ["PLR2004", "S101"]
112127

113128
[tool.ruff.lint.pydocstyle]
114129
convention = "google"
115130

116131
[tool.ruff.lint.pyupgrade]
117132
keep-runtime-typing = true
118133

119-
[tool.uv]
120-
dev-dependencies = [
121-
"pre-commit >= 3.8.0",
122-
"pytest >= 8.3.3",
123-
"pytest-cov >= 5.0.0",
124-
"tox >= 4.21.1",
125-
"tox-uv >= 1.13.0"
126-
]
134+
[tool.tomlsort]
135+
all = true
136+
overrides."tool.tox.env_list".inline_arrays = false
137+
overrides."tool.tox.testenv.commands".inline_arrays = false
138+
139+
[tool.tox]
140+
env_list = ["3.9", "3.10", "3.11", "3.12", "3.13"]
141+
min_version = "4.22"
142+
143+
[tool.tox.env_run_base]
144+
commands = [["pytest"]]
145+
dependency_groups = ["tests"]
146+
passenv = ["COMICVINE__API_KEY"]

simyan/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99

1010
def get_cache_root() -> Path:
11-
"""Create and return the path to the cache for simyan, supports XDG_CACHE_HOME env.
11+
"""Create and return the path to the cache for Simyan, supports XDG_CACHE_HOME env.
1212
1313
Returns:
14-
The path to the simyan cache folder.
14+
The path to the Simyan cache folder.
1515
"""
1616
cache_home = os.getenv("XDG_CACHE_HOME", default=str(Path.home() / ".cache"))
1717
folder = Path(cache_home).resolve() / "simyan"

0 commit comments

Comments
 (0)