Title: Better error messages for invalid Python package directory names · Issue #2775 · python/mypy · GitHub
Open Graph Title: Better error messages for invalid Python package directory names · Issue #2775 · python/mypy
X Title: Better error messages for invalid Python package directory names · Issue #2775 · python/mypy
Description: It looks like mypy can't handle absolute paths to where the parent directory has a dot in the name. Specifically I accidentally had an __init__.py in the root of my project, and cloned my project into a directory with a dot in its name. ...
Open Graph Description: It looks like mypy can't handle absolute paths to where the parent directory has a dot in the name. Specifically I accidentally had an __init__.py in the root of my project, and cloned my project i...
X Description: It looks like mypy can't handle absolute paths to where the parent directory has a dot in the name. Specifically I accidentally had an __init__.py in the root of my project, and cloned my proje...
Opengraph URL: https://github.com/python/mypy/issues/2775
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Better error messages for invalid Python package directory names","articleBody":"It looks like mypy can't handle absolute paths to where the parent directory has a dot in the name. Specifically I accidentally had an `__init__.py` in the root of my project, and cloned my project into a directory with a dot in its name. When I ran mypy it failed with `mypy: can't find module '\u003cmodule-name>'`. I realize that what I was doing was wrong, but it took me cloning mypy and stepping through it with a debugger to understand what was wrong and why it was failing. It would be awesome to have a clearer error message in these cases (eg maybe check that the directories found in the `crawl_up` method are valid package names and fail if they're not: https://github.com/python/mypy/blob/f1dd3bd3540d9bfd043d2c0335037c459a3e46f7/mypy/main.py#L481)\r\n\r\nTo repro, create a directory with a dot in it (eg `mkdir tmp.dir`), place an empty `__init__.py` and an empty `main.py` in it, then run `mypy $(pwd)/main.py` from within that directory.\r\n\r\nNote that this is related to but slightly different from https://github.com/python/mypy/issues/2773.","author":{"url":"https://github.com/FuegoFro","@type":"Person","name":"FuegoFro"},"datePublished":"2017-01-30T23:18:59Z","url":"https://github.com/python/mypy/issues/2775"}
| 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:071027eb-33ad-fb55-8a0d-ae79369f8b29 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECF2:23D776:FE9422:14FDD25:6B0009DC |
| html-safe-nonce | 716e3660ed5b94fe9550e6fd0e4af91265be4ea63aab8d9d0737bf4028195758 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0YyOjIzRDc3NjpGRTk0MjI6MTRGREQyNTo2QjAwMDlEQyIsInZpc2l0b3JfaWQiOiIyMTM0NTUyODgxOTUxNDEwNjUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9d6f33c3b6803deb0bde6a0bf9ec16bddd9073f3e2f4ea203a977e42d7ff0b8a |
| hovercard-subject-tag | issue:204159791 |
| 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/2775/issue_layout |
| twitter:image | https://opengraph.githubassets.com/827888c8dccf1ef37a1d15ad2e816430573ad01985aeec9219a7c3edeca2c866/python/mypy/issues/2775 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/827888c8dccf1ef37a1d15ad2e816430573ad01985aeec9219a7c3edeca2c866/python/mypy/issues/2775 |
| og:image:alt | It looks like mypy can't handle absolute paths to where the parent directory has a dot in the name. Specifically I accidentally had an __init__.py in the root of my project, and cloned my project i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | FuegoFro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width