Title: Explore building third party stubs as packages · Issue #2491 · python/typeshed · GitHub
Open Graph Title: Explore building third party stubs as packages · Issue #2491 · python/typeshed
X Title: Explore building third party stubs as packages · Issue #2491 · python/typeshed
Description: This is an alternative to #2440 (disallowing third-party stubs). The idea is that typeshed remains/becomes a central repository for third-party stubs that are not bundled with the parent package, similar to DefinitelyTyped. In the future...
Open Graph Description: This is an alternative to #2440 (disallowing third-party stubs). The idea is that typeshed remains/becomes a central repository for third-party stubs that are not bundled with the parent package, s...
X Description: This is an alternative to #2440 (disallowing third-party stubs). The idea is that typeshed remains/becomes a central repository for third-party stubs that are not bundled with the parent package, s...
Opengraph URL: https://github.com/python/typeshed/issues/2491
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Explore building third party stubs as packages","articleBody":"This is an alternative to #2440 (disallowing third-party stubs). The idea is that typeshed remains/becomes a central repository for third-party stubs that are not bundled with the parent package, similar to [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped). In the future I expect type checkers will not want to bundle all third-party stubs for a variety of reasons, so third-party stubs would be distributed as separate [PEP 561](https://www.python.org/dev/peps/pep-0561/) stub-only packages, one per upstream package.\r\n\r\n(I tried to integrate points raised there into this issue, especially those by @JukkaL in [this comment](https://github.com/python/typeshed/issues/2440#issuecomment-423939393).)\r\n\r\n## Advantages\r\n\r\n* Due to typeshed's tests, packages in typeshed will continue to work with the latests versions of mypy and pytype.\r\n* Basic level of consistency and standards due to review by typeshed maintainers.\r\n* Consistent naming scheme for third-party stubs packages, allowing users to just \"pip install <guessed name>\" and it will work when there are stubs.\r\n* Tooling (like tests) is easier to manage as it can remain part of the typeshed package.\r\n* Easier to contribute to stubs, since contributors don't need to learn the intricacies of multiple stubs projects.\r\n* No need to start a separate project just to distribute stubs for a new package.\r\n\r\n## Issues\r\n\r\n* Workload issues for typeshed maintainers.\r\n* Typeshed maintainers will often not be familiar with the package for which pull requests are opened.\r\n* Publishing stubs takes longer due to the necessary reviews.\r\n\r\n## Further Considerations\r\n\r\nWhat should the generated packages be called? @ethanhs's PEP 561 actually requires stubs-only package to be named `\u003cpackage>-stubs`. typeshed could squat these names and release them (and remove the stubs) on the request of upstream maintainers. Alternatively, typeshed could add a common prefix or suffix (`ts`, `typeshed`) or in addition to or instead of the `-stubs` suffix. This would be in violation of PEP 561, so we'd need to get broader consensus to amend the PEP. My personal favorite would be `\u003cpackage>-ts`.\r\n\r\nTo guarantee a fairly quick turnaround on stubs, to minimize work for publishing stubs, and to prevent all third-party stub packages to be updated whenever a new typeshed version is released, stubs for a specific third-party package should be published automatically when it changes.\r\n\r\n## Possible Implementation\r\n\r\n* Add a generic `setup-tp.py` to typeshed that takes its package name from the directory it's in and uses the current date and time as version number.\r\n* Amend the CI process for `master` only so that after a successful test run, for every third-party package that was changed since the last successful run, the following is done automatically:\r\n 1. Copy `setup-tp.py` into the third-party module directory as `setup.py`.\r\n 1. Build the package in that directory.\r\n 1. Upload to pypi.\r\n","author":{"url":"https://github.com/srittau","@type":"Person","name":"srittau"},"datePublished":"2018-09-27T06:02:07Z","url":"https://github.com/python/typeshed/issues/2491"}
| 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:55877e2a-7d4a-8529-7660-36934860e81d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C69A:43251:1779012:1F3D0A7:6B002BCC |
| html-safe-nonce | b3466ae28065fc300fe23be5389386c45ef323f07b9717e2fb84014abcf4fef4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjlBOjQzMjUxOjE3NzkwMTI6MUYzRDBBNzo2QjAwMkJDQyIsInZpc2l0b3JfaWQiOiIzNTEzMDU3NTAyMTQ3MTI4MjY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8b1f1967a9b9ad63edcb7821082fad39c50a1bb86a68e45d89a53448a36cd717 |
| hovercard-subject-tag | issue:364316789 |
| 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/python/typeshed/2491/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7321488395185f601cb80af555203a7aed71737d6f70a45dede000e8aee79c5a/python/typeshed/issues/2491 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7321488395185f601cb80af555203a7aed71737d6f70a45dede000e8aee79c5a/python/typeshed/issues/2491 |
| og:image:alt | This is an alternative to #2440 (disallowing third-party stubs). The idea is that typeshed remains/becomes a central repository for third-party stubs that are not bundled with the parent package, s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | srittau |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width