From 022ab80af02228ff72660258442fa28051730eaf Mon Sep 17 00:00:00 2001 From: masklinn Date: Sat, 5 Oct 2024 14:07:21 +0200 Subject: [PATCH] Add py.typed This marker file is necessary when *distributing* libraries, in order for the consumer side to know that the library is typed and for typecheckers to know to use it directly rather than look for a stub package (or give up on typing). Closes #218 --- MANIFEST.in | 15 +++++++++------ pyproject.toml | 6 ++++++ src/ua_parser/py.typed | 0 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 src/ua_parser/py.typed diff --git a/MANIFEST.in b/MANIFEST.in index 9c004de5..d8aabc5b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,9 +1,12 @@ -exclude .* -prune .github -global-exclude *~ - include README.rst include LICENSE + graft uap-core -exclude uap-core/.* -recursive-exclude uap-core *.js + +prune .github +prune uap-core/.github +global-exclude *~ +global-exclude .* +global-exclude *.js +global-exclude __pycache__ +global-exclude *.py[co] diff --git a/pyproject.toml b/pyproject.toml index 920fcd0f..1dae0e60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,12 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy" ] +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +"ua_parser" = ["py.typed"] + [tool.ruff.lint] select = ["F", "E", "W", "I", "RET", "RUF", "PT"] ignore = [ diff --git a/src/ua_parser/py.typed b/src/ua_parser/py.typed new file mode 100644 index 00000000..e69de29b