Merge pull request #171 from jedie/typeguard

Use typeguard in tests
main
Jens Diemer 2024-01-16 21:27:03 +01:00 zatwierdzone przez GitHub
commit ff210a0e17
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
4 zmienionych plików z 17 dodań i 0 usunięć

Wyświetl plik

@ -162,6 +162,7 @@ To make a new release, do this:
[comment]: <> (✂✂✂ auto generated history start ✂✂✂)
* [**dev**](https://github.com/jedie/PyInventory/compare/v0.19.3...main)
* 2024-01-16 - Use typeguard in tests
* 2024-01-16 - Update requirements
* [v0.19.3](https://github.com/jedie/PyInventory/compare/v0.19.2...v0.19.3)
* 2023-11-01 - Auto generate README history

Wyświetl plik

@ -2,7 +2,11 @@
Allow your-cool-package to be executable
through `python -m inventory`.
"""
import sys
from manage_django_project.manage import execute_django_from_command_line
from typeguard import install_import_hook
def main():
@ -10,6 +14,12 @@ def main():
entrypoint installed via pyproject.toml and [project.scripts] section.
Must be set in ./manage.py and PROJECT_SHELL_SCRIPT
"""
if 'test' in sys.argv:
# Install typeguard import hook to check for missing type annotations.
# Sadly we can't add this into: cli_base/tests/__init__.py
install_import_hook(packages=('inventory', 'inventory_project'))
execute_django_from_command_line()

Wyświetl plik

@ -51,6 +51,7 @@ dev = [
"safety", # https://github.com/pyupio/safety
"mypy", # https://github.com/python/mypy
"twine", # https://github.com/pypa/twine
"typeguard", # https://github.com/agronholm/typeguard/
# https://github.com/akaihola/darker
# https://github.com/ikamensh/flynt

Wyświetl plik

@ -1411,6 +1411,10 @@ twine==4.0.2 \
--hash=sha256:929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8 \
--hash=sha256:9e102ef5fdd5a20661eb88fad46338806c3bd32cf1db729603fe3697b1bc83c8
# via PyInventory (pyproject.toml)
typeguard==4.1.5 \
--hash=sha256:8923e55f8873caec136c892c3bed1f676eae7be57cdb94819281b3d3bc9c0953 \
--hash=sha256:ea0a113bbc111bcffc90789ebb215625c963411f7096a7e9062d4e4630c155fd
# via PyInventory (pyproject.toml)
types-python-dateutil==2.8.19.20240106 \
--hash=sha256:1f8db221c3b98e6ca02ea83a58371b22c374f42ae5bbdf186db9c9a76581459f \
--hash=sha256:efbbdc54590d0f16152fa103c9879c7d4a00e82078f6e2cf01769042165acaa2
@ -1425,6 +1429,7 @@ typing-extensions==4.9.0 \
# mypy
# pyee
# rich-click
# typeguard
urllib3==2.1.0 \
--hash=sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3 \
--hash=sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54