-
Notifications
You must be signed in to change notification settings - Fork 43
Fix typing exports #489
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerstriage doneIssues that are triaged by dev team and are in investigation.Issues that are triaged by dev team and are in investigation.triage neededFor new issues, not triaged yet.For new issues, not triaged yet.up for grabs 🙌Issues that are ready to be picked up for anyone interested. Please self-assign and remove the labelIssues that are ready to be picked up for anyone interested. Please self-assign and remove the label
Description
Is your feature request related to a problem? Please describe.
Tutorial snippets are not mypy compliant. Namely:
from mssql_python import connectraises the following typing error:
error: Module "mssql_python" does not explicitly export attribute "connect" [attr-defined]
And this can happen for every user-exposed object from mssql_python :(
Describe the solution you'd like
On mssql_python/__init__.py, add at the end of the module:
__all__ = [
"connect",
# ... every other object already imported on `__init__.py`
]Describe alternatives you've considered
If not, every doc should be updated to import from the inner modules, which may be less ergonomic under a pure developer experience optic.
Additional context
No breaking changes, no risk of circular imports nor breaking tests. Only risk is that the addition of __all__ becomes un-tracked, thus potentially broken. This can be solved using a Python linter such as ruff.
Reactions are currently unavailable
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerstriage doneIssues that are triaged by dev team and are in investigation.Issues that are triaged by dev team and are in investigation.triage neededFor new issues, not triaged yet.For new issues, not triaged yet.up for grabs 🙌Issues that are ready to be picked up for anyone interested. Please self-assign and remove the labelIssues that are ready to be picked up for anyone interested. Please self-assign and remove the label