Title: Enable Typechecking When Imported · Issue #379 · massive-com/client-python · GitHub
Open Graph Title: Enable Typechecking When Imported · Issue #379 · massive-com/client-python
X Title: Enable Typechecking When Imported · Issue #379 · massive-com/client-python
Description: Is your feature request related to a problem? Please describe. When type checking a project that uses this library with MyPy, type checks are skipped for the import: error: Skipping analyzing "polygon": module is installed, but missing l...
Open Graph Description: Is your feature request related to a problem? Please describe. When type checking a project that uses this library with MyPy, type checks are skipped for the import: error: Skipping analyzing "poly...
X Description: Is your feature request related to a problem? Please describe. When type checking a project that uses this library with MyPy, type checks are skipped for the import: error: Skipping analyzing "...
Opengraph URL: https://github.com/massive-com/client-python/issues/379
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enable Typechecking When Imported","articleBody":"**Is your feature request related to a problem? Please describe.**\r\nWhen type checking a project that uses this library with MyPy, type checks are skipped for the import:\r\n\r\n```\r\nerror: Skipping analyzing \"polygon\": module is installed, but missing library stubs or py.typed marker [import]\r\nnote: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports\r\n```\r\n\r\n**Describe the solution you'd like**\r\nInclude an empty `py.typed` file in the root of the module. See: https://peps.python.org/pep-0561/#packaging-type-information \r\n\r\n\r\n**Describe alternatives you've considered**\r\n\r\nPotential workarounds include disabling module typing entirely using `import polygon # type: ignore`, or using a script that automatically creates the py.typed file in the import before typechecking.\r\n\r\n```py\r\nfrom typing import Any\r\nfrom mypy import api\r\nimport polygon\r\n\r\n\r\ndef enable_typing(lib: Any) -> None: # type: ignore\r\n open(lib.__path__[0] + \"/py.typed\", 'a').close()\r\n\r\n\r\nenable_typing(polygon)\r\n\r\n\r\nresult = api.run([\".\"])\r\nif result[0]:\r\n print('\\nType checking report:\\n')\r\n print(result[0])\r\n\r\nif result[1]:\r\n print('\\nError report:\\n')\r\n print(result[1])\r\n\r\nprint('\\nExit status:', result[2])\r\nquit(result[2])\r\n```\r\n\r\nWorkarounds are fairly easy, but so is the solution so I figured I'd post this here.\r\n\r\n**Additional context**\r\nN/A\r\n","author":{"url":"https://github.com/mileswatson","@type":"Person","name":"mileswatson"},"datePublished":"2023-02-12T13:47:46Z","url":"https://github.com/massive-com/client-python/issues/379"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c9671ce6-f636-b26f-bf5b-85f1b1e2c002 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB3E:D707B:FA7DEB:14B6A14:6AFE9CD7 |
| html-safe-nonce | 3457fd3153231e8d0ffc41608a36fb4a486e24362020569e7147a68ac835bf33 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjNFOkQ3MDdCOkZBN0RFQjoxNEI2QTE0OjZBRkU5Q0Q3IiwidmlzaXRvcl9pZCI6IjgyNzc3MTk1NTY4OTQzOTk3MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | aa0923af5a6b68a62d1de4bb13cf97133aed86cdd9e21446087dc6edea5ac88c |
| hovercard-subject-tag | issue:1581265940 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/massive-com/client-python/379/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5cf30cada41919d750244fcb9c12a85287b7b1a713776bf043adce360706a135/massive-com/client-python/issues/379 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5cf30cada41919d750244fcb9c12a85287b7b1a713776bf043adce360706a135/massive-com/client-python/issues/379 |
| og:image:alt | Is your feature request related to a problem? Please describe. When type checking a project that uses this library with MyPy, type checks are skipped for the import: error: Skipping analyzing "poly... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mileswatson |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/massive-com/client-python git https://github.com/massive-com/client-python.git |
| octolytics-dimension-user_id | 191946194 |
| octolytics-dimension-user_login | massive-com |
| octolytics-dimension-repository_id | 216660192 |
| octolytics-dimension-repository_nwo | massive-com/client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 216660192 |
| octolytics-dimension-repository_network_root_nwo | massive-com/client-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width