From a9f54b678cd11bbdc039915eb355bcd7d63d483b Mon Sep 17 00:00:00 2001 From: dgelessus Date: Mon, 6 Jul 2020 23:57:25 +0200 Subject: [PATCH] Add py.typed marker file for PEP 561 This allows type checkers like mypy to use the type hints in our code when type-checking another project that imports this library. --- README.rst | 1 + rsrcfork/py.typed | 0 setup.cfg | 7 +++++++ 3 files changed, 8 insertions(+) create mode 100644 rsrcfork/py.typed diff --git a/README.rst b/README.rst index 5b2ad91..1bf442a 100644 --- a/README.rst +++ b/README.rst @@ -120,6 +120,7 @@ Version 1.7.1 (next version) * Added filtering support to the ``list`` subcommand. * Added a ``resource-info`` subcommand to display technical information about resources (more detailed than what is displayed by ``list`` and ``read``). * Added a ``raw-compress-info`` subcommand to display technical header information about standalone compressed resource data. +* Made the library PEP 561-compliant by adding a py.typed file. * Fixed an incorrect ``AssertionError`` when using the ``--no-decompress`` command-line options. Version 1.7.0 diff --git a/rsrcfork/py.typed b/rsrcfork/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/setup.cfg b/setup.cfg index c3dd4b5..418f243 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,9 +41,16 @@ keywords = macos [options] +# mypy can only find type hints in the package if zip_safe is set to False, +# see https://mypy.readthedocs.io/en/latest/installed_packages.html#making-pep-561-compatible-packages +zip_safe = False python_requires = >=3.6 packages = find: +[options.package_data] +rsrcfork = + py.typed + [options.packages.find] include = rsrcfork