Title: stubgen fails with "TypeError: tuple object expected" running against `cattr` package · Issue #6639 · python/mypy · GitHub
Open Graph Title: stubgen fails with "TypeError: tuple object expected" running against `cattr` package · Issue #6639 · python/mypy
X Title: stubgen fails with "TypeError: tuple object expected" running against `cattr` package · Issue #6639 · python/mypy
Description: Are you reporting a bug, or opening a feature request? Bug Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to simplify your case to a minimal repro. No ...
Open Graph Description: Are you reporting a bug, or opening a feature request? Bug Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to si...
X Description: Are you reporting a bug, or opening a feature request? Bug Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to si...
Opengraph URL: https://github.com/python/mypy/issues/6639
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stubgen fails with \"TypeError: tuple object expected\" running against `cattr` package","articleBody":"* Are you reporting a bug, or opening a feature request?\r\n\r\nBug \r\n\r\n* Please insert below the code you are checking with mypy,\r\n or a mock-up repro if the source is private. We would appreciate\r\n if you try to simplify your case to a minimal repro.\r\n\r\nNo code, but I'm trying to generate stubs for `cattrs`, which lives here: https://github.com/Tinche/cattrs\r\n\r\nThe command I'm using, on MyPy 0.700, is `stubgen -p cattr`. MyPy does manage to find the package. (for instance, `stubgen -p cattrs` gives the expected message `Failed to import cattrs; skipping it`)\r\n\r\nI am running this inside a clean virtualenv.\r\n\r\n* What is the actual behavior/output?\r\n```\r\nTraceback (most recent call last):\r\n File \"/Users/peter/.local/share/virtualenvs/testpy-XO9km9Nb/bin/stubgen\", line 10, in \u003cmodule>\r\n sys.exit(main())\r\n File \"mypy/stubgen.py\", line 1191, in main\r\n File \"mypy/stubgen.py\", line 1075, in generate_stubs\r\n File \"mypy/stubgen.py\", line 899, in collect_build_targets\r\n File \"mypy/stubgen.py\", line 930, in find_module_paths_using_imports\r\nTypeError: tuple object expected\r\n```\r\n\r\n* What is the behavior/output you expect?\r\n\r\nI would expect the `out` directory to be created with some stubs.\r\n\r\n* What are the versions of mypy and Python you are using?\r\n\r\nPython 3.7.2, MyPy 0.700\r\n\r\n* Do you see the same issue after installing mypy from Git master?\r\nI get an entirely different error! Fascinating. \r\n\r\n```\r\nFailed to import cattr.vendor.python2.typing; skipping it\r\nFailed to import cattr.vendor.python3.typing; skipping it\r\nFailed to import cattr.vendor.typing; skipping it\r\nCritical error during semantic analysis: /Users/peter/.local/share/virtualenvs/testpy-XO9km9Nb/lib/python3.7/site-packages/cattr/converters.py:149: error: misplaced type annotation\r\n```\r\n\r\nI already expected that the error might lie within cattrs itself, but obviously the 0.700 error message was not helping me at all. This is a lot more useful. I suggest that this issue be closed once 0.710 is released and still manifests this improved error behavior, and then this issue may help others who are running into similar issues on older versions of MyPy.\r\n","author":{"url":"https://github.com/petergaultney","@type":"Person","name":"petergaultney"},"datePublished":"2019-04-06T00:58:37Z","url":"https://github.com/python/mypy/issues/6639"}
| 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:9ac25464-ff78-35f0-95c2-d9738149e6e3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C784:DCDA8:2FCCF35:3F03514:6B002589 |
| html-safe-nonce | 235e7d94a717d13636a08d35e3a33f34ea543ecfda2c9fac33f672c10470b393 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzg0OkRDREE4OjJGQ0NGMzU6M0YwMzUxNDo2QjAwMjU4OSIsInZpc2l0b3JfaWQiOiIxNjAzNTkyMDQ2ODE0MTc2NjQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3d23ba28d195e5b4164cc82256543c0568943aa3f7422df462040986e486ff96 |
| hovercard-subject-tag | issue:429980420 |
| 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/mypy/6639/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9587563fa26ae6316aa6704d0f86b29ff4978c4ce662eda7ef039fbf36043fe5/python/mypy/issues/6639 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9587563fa26ae6316aa6704d0f86b29ff4978c4ce662eda7ef039fbf36043fe5/python/mypy/issues/6639 |
| og:image:alt | Are you reporting a bug, or opening a feature request? Bug Please insert below the code you are checking with mypy, or a mock-up repro if the source is private. We would appreciate if you try to si... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | petergaultney |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width