Add py.typed marker file to support PEP 561 typing (#5906)

Add `py.typed` marker file to support PEP 561 typing

This PR adds a `py.typed` marker file to the package directory to
indicate that the package includes inline type hints and is PEP 561
compliant.
This commit is contained in:
Sebastian Mohr 2025-08-09 13:31:55 +02:00 committed by GitHub
parent 78c361154f
commit c2d1bc3aaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 7 deletions

View file

@ -107,7 +107,7 @@ jobs:
uses: liskin/gh-problem-matcher-wrap@v3
with:
linters: mypy
run: poe check-types --show-column-numbers --no-error-summary ${{ needs.changed-files.outputs.changed_python_files }}
run: poe check-types --show-column-numbers --no-error-summary .
docs:
if: needs.changed-files.outputs.any_docs_changed == 'true'

0
beets/py.typed Normal file
View file

View file

@ -92,6 +92,10 @@ For plugin developers:
Old imports are now deprecated and will be removed in version ``3.0.0``.
* ``beets.ui.decargs`` is deprecated and will be removed in version ``3.0.0``.
* Beets is now pep 561 compliant, which means that it provides type hints
for all public APIs. This allows IDEs to provide better autocompletion and
type checking for downstream users of the beets API.
Other changes:

View file

@ -25,6 +25,7 @@ import pytest
from beets import dbcore
from beets.library import LibModel
from beets.test import _common
from beets.util import cached_classproperty
# Fixture: concrete database and model classes. For migration tests, we
# have multiple models with different numbers of fields.
@ -53,15 +54,22 @@ class ModelFixture1(LibModel):
"field_one": dbcore.types.INTEGER,
"field_two": dbcore.types.STRING,
}
_types = {
"some_float_field": dbcore.types.FLOAT,
}
_sorts = {
"some_sort": SortFixture,
}
_queries = {
"some_query": QueryFixture,
}
@cached_classproperty
def _types(cls):
return {
"some_float_field": dbcore.types.FLOAT,
}
@cached_classproperty
def _queries(cls):
return {
"some_query": QueryFixture,
}
@classmethod
def _getters(cls):