You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is intended by the maintainers of pdpyras. If the maintainers expect users to enjoy type hints in the pdpyras, it's nice to fix this problem.
Solution
It would be great if we can simply add the py.typed file to pdpyras, but it doesn't work because
pdpyras is a library that has one top-level module pdpyras.py, not a package.
Hello @ymyzk , thank you for the suggestions! Type hints have up to this point been added as a forward-looking style convention and to simplify the built-in documentation (e.g. replacing :type: and :rtype: in Sphinx docstrings).
The refactor/restructuring of the module into a package may be undertaken as a future project, but for now (FYI) we're holding off on authoring and reviewing bigger changes while we work on migrating this project to the new pagerduty name in the package index, of which we just recently gained custody.
I'm going to leave this issue open so it doesn't get forgotten in the process and will cross-link the new issue when it's created in the new project.
Thanks for the thoughtful answer, @Deconstrained! I can understand project's plan and wait for the type hints to be available to the pdpyras users in the future. It's also great to hear that this project can be moved to "pagerduty" on PyPI. 👍
Problem
#131 added type hints to the pdpyras library. However, users of pdpyras cannot use the type hints in their projects using pdpyras. Here's an example
This is because pdpyras does not have
py.typed
marker file in the packaged distribution. Reference: https://typing.readthedocs.io/en/latest/guides/libraries.htmlI'm not sure if this is intended by the maintainers of pdpyras. If the maintainers expect users to enjoy type hints in the pdpyras, it's nice to fix this problem.
Solution
It would be great if we can simply add the
py.typed
file to pdpyras, but it doesn't work becausepdpyras.py
, not a package.py.typed
is not supported for such top-level modules yet. Issue: Type stubs for single-file top-level modules python/typing#1333There are a few approaches we could fix the issue.
pdpyras.py
from a module to a package and putpy.typed
in the package. I've created a PoC for this: main...ymyzk:pdpyras:py-typed-pocI'm happy to create a PR for this issue, but I'd like to know what is the preferred solution by the maintainers first. Thanks!
The text was updated successfully, but these errors were encountered: