mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
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:
parent
78c361154f
commit
c2d1bc3aaf
4 changed files with 19 additions and 7 deletions
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
|
|
@ -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
0
beets/py.typed
Normal 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:
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue