FelixTheC / strongtyping

Decorator which checks whether the function is called with the correct type of parameters.
https://pypi.org/project/strongtyping/
108 stars 3 forks source link

No pyi files in strongtyping-stubs 3.11.1 on PyPI #120

Open ramblehead opened 1 year ago

ramblehead commented 1 year ago

Both "Source Distribution" (strongtyping-3.11.1.tar.gz) and "Built Distribution" (strongtyping-3.11.1-py3-none-any.whl) do not include any strongtyping-stubs/**/*.pyi files. Thus, no type hints when installing from PyPI.

This issue appears to be related to setuptools. Adding package_data param to setup() function seems to solve it:

setup(
    name="strongtyping",
    version="3.11.2",
    description="Decorator which checks whether the function is called with the correct type of parameter
    long_description=README,
    long_description_content_type="text/markdown",
    url="https://strongtyping.readthedocs.io/en/latest/",
    author="FelixTheC",
    author_email="fberndt87@gmail.com",
    license="MIT",
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3.11",
    ],
    packages=packages,
    package_data={'strongtyping-stubs': ['**/*.py', '**/*.pyi']},
    python_requires=">=3.11",
    include_package_data=True,
)
FelixTheC commented 1 year ago

Thanks a lot for this issues I will prepare a fix ASAP.

FelixTheC commented 1 year ago

fixed with release 3.11.3

ramblehead commented 1 year ago

It looks like 3.11.3 still does not have strongtyping-stubs/**/*.pyi :sweat_smile:

In your last commit strongtyping-stubs/__init__.py has been deleted. Therefore find_packages() no longer recognises it as a package.

Can be fixed with the following setup (notice packages and package_data param changes):

setup(
    name="strongtyping",
    version="3.11.3",
    description="Decorator which checks whether the function is called with the correct type of parameters",
    long_description=README,
    long_description_content_type="text/markdown",
    url="https://strongtyping.readthedocs.io/en/latest/",
    author="FelixTheC",
    author_email="fberndt87@gmail.com",
    license="MIT",
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3.11",
    ],
    packages=packages + ["strongtyping-stubs"],
    package_data={"strongtyping-stubs": ["**/*.pyi"]},
    python_requires=">=3.11",
    include_package_data=True,
)

(See https://mypy.readthedocs.io/en/latest/installed_packages.html#making-pep-561-compatible-packages)

FelixTheC commented 1 year ago

That's interresting cause I recreated it with mypy again. I will have a look into it again. Thanks for your Support and your patience.