René's URL Explorer Experiment


Title: Incremental parsing issue with namespace packages · Issue #12664 · python/mypy · GitHub

Open Graph Title: Incremental parsing issue with namespace packages · Issue #12664 · python/mypy

X Title: Incremental parsing issue with namespace packages · Issue #12664 · python/mypy

Description: Given a local file which uses something which is a namespace package and then another local file which uses the first one, there's an intermittent bug where the namespace packaged module's types aren't found. This seems likely similar to...

Open Graph Description: Given a local file which uses something which is a namespace package and then another local file which uses the first one, there's an intermittent bug where the namespace packaged module's types ar...

X Description: Given a local file which uses something which is a namespace package and then another local file which uses the first one, there's an intermittent bug where the namespace packaged module's ...

Opengraph URL: https://github.com/python/mypy/issues/12664

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incremental parsing issue with namespace packages","articleBody":"Given a local file which uses something which is a namespace package and then another local file which uses the first one, there's an intermittent bug where the namespace packaged module's types aren't found.\r\nThis seems likely similar to https://github.com/python/mypy/issues/7276, however even with https://github.com/python/mypy/pull/10937 in place (i.e: on a more recent mypy release) the issue remains.\r\n\r\n**To Reproduce**\r\n\r\n``` shell\r\n$ mkdir demo\r\n$ echo 'import ruamel.yaml' > demo/wrapper.py \r\n$ echo 'import wrapper' > demo/consumer.py\r\n```\r\n``` shell\r\n$ mypy demo  # first run\r\nSuccess: no issues found in 2 source files\r\n```\r\n``` shell\r\n$ mypy demo  # second run\r\ndemo/wrapper.py:1: error: Skipping analyzing \"ruamel\": module is installed, but missing library stubs or py.typed marker\r\ndemo/consumer.py:1: error: Skipping analyzing \"ruamel\": module is installed, but missing library stubs or py.typed marker\r\ndemo/consumer.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports\r\nFound 2 errors in 2 files (checked 2 source files)\r\n```\r\n\r\nSubsequent runs will alternate between success and failure. Any additional source files in the project (whether they import the `wrapper` or not) will also have the error message applied to them, which makes failing runs vastly less useful.\r\n\r\nRunning with `--no-incremental` appears to avoid the issue; I can run several times in a row with `--no-incremental` without encountering the failure mode (and have not seen it with that flag enabled).\r\n\r\nRunning with `--namespace-packages` appears to have no effect.\r\n\r\nUnfortunately as `ruamel.yaml` is a typed library, ignoring the imports with `type: ignore[import]` ends up generating more errors as the ignores appear unused on a \"successful\" run (and you have `warn_unused_ignores` enabled).\r\n\r\n\u003cdetails>\r\n\u003csummary>Setup & versions\u003c/summary>\r\n\r\n``` shell\r\npython3.9 -m venv venv\r\n. venv/bin/activate\r\npip install -U pip setuptools wheel\r\npip install mypy ruamel.yaml\r\n```\r\n``` shell\r\n$ pip list\r\nPackage           Version\r\n----------------- -------\r\nmypy              0.942\r\nmypy-extensions   0.4.3\r\npip               22.0.4\r\nruamel.yaml       0.17.21\r\nruamel.yaml.clib  0.2.6\r\nsetuptools        62.1.0\r\ntomli             2.0.1\r\ntyping_extensions 4.2.0\r\nwheel             0.37.1\r\n```\r\n\r\n\u003c/details>\r\n\r\n**Your Environment**\r\n\r\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n- Mypy version used: 0.942\r\n- Mypy command-line flags: see above\r\n- Mypy configuration options from `mypy.ini` (and other config files): none\r\n- Python version used: 3.9 (though similar behaviour observed on other versions; at least on 3.8)\r\n- Operating system and version: Ubuntu 20.04 LTS\r\n","author":{"url":"https://github.com/PeterJCLaw","@type":"Person","name":"PeterJCLaw"},"datePublished":"2022-04-23T21:43:27Z","url":"https://github.com/python/mypy/issues/12664"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:af83cff4-7468-6ed8-d592-c5da21dcd90a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEAA8:142FA7:E5BFB:135744:6B001D3D
html-safe-noncedcd87aaded43ea46cafb36647fda44922391d06db61034a7587e3057882600fb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUE4OjE0MkZBNzpFNUJGQjoxMzU3NDQ6NkIwMDFEM0QiLCJ2aXNpdG9yX2lkIjoiMzk2NzA4MzcwNDgwMjYxNDU4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac028e53d82bb6348e74c10cae7f80a4aa18a7983ff71492c97eb106276155f7dc
hovercard-subject-tagissue:1213460893
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/12664/issue_layout
twitter:imagehttps://opengraph.githubassets.com/de37800a6486eac6da85f31436ba459ec93b907ab33157e37bce7a7c418d651e/python/mypy/issues/12664
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/de37800a6486eac6da85f31436ba459ec93b907ab33157e37bce7a7c418d651e/python/mypy/issues/12664
og:image:altGiven a local file which uses something which is a namespace package and then another local file which uses the first one, there's an intermittent bug where the namespace packaged module's types ar...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamePeterJCLaw
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
turbo-cache-controlno-preview
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/12664#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F12664
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F12664
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/issues/12664
Reloadhttps://github.com/python/mypy/issues/12664
Reloadhttps://github.com/python/mypy/issues/12664
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests546 (546)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/12664
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/12664
#18907https://github.com/python/mypy/pull/18907
RagnarGrootKoerkamp/BAPCtools#493https://github.com/RagnarGrootKoerkamp/BAPCtools/pull/493
Incremental parsing issue with namespace packageshttps://github.com/python/mypy/issues/12664#top
#18907https://github.com/python/mypy/pull/18907
RagnarGrootKoerkamp/BAPCtools#493https://github.com/RagnarGrootKoerkamp/BAPCtools/pull/493
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-incrementalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-incremental%22
https://github.com/PeterJCLaw
PeterJCLawhttps://github.com/PeterJCLaw
on Apr 23, 2022https://github.com/python/mypy/issues/12664#issue-1213460893
#7276https://github.com/python/mypy/issues/7276
#10937https://github.com/python/mypy/pull/10937
Nexthttps://github.com/python/mypy/issues/12664?timeline_page=1
PeterJCLawhttps://github.com/PeterJCLaw
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on Apr 23, 2022https://github.com/python/mypy/issues/12664#event-6485035992
AlexWaygoodhttps://github.com/AlexWaygood
topic-incrementalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-incremental%22
on Apr 23, 2022https://github.com/python/mypy/issues/12664#event-6485092042
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Apr 23, 2022https://github.com/python/mypy/issues/12664#issuecomment-1107663408
#12250https://github.com/python/mypy/pull/12250
#13124https://github.com/python/mypy/pull/13124
#13085 (comment)https://github.com/python/mypy/issues/13085#issuecomment-1178036945
https://github.com/jacleggmsr
jacleggmsrhttps://github.com/jacleggmsr
on Nov 21, 2022https://github.com/python/mypy/issues/12664#issuecomment-1322072322
https://github.com/sfc-gh-dschumann
sfc-gh-dschumannhttps://github.com/sfc-gh-dschumann
on Mar 28, 2023https://github.com/python/mypy/issues/12664#issuecomment-1486999268
https://github.com/ssbarnea
ssbarneahttps://github.com/ssbarnea
on May 2, 2023https://github.com/python/mypy/issues/12664#issuecomment-1531509570
#8823https://github.com/python/mypy/issues/8823
ssbarneahttps://github.com/ssbarnea
on May 2, 2023https://github.com/python/mypy/issues/12664#event-9146136536
Make mypy execution more reproduciblehttps://github.com/ansible/ansible-lint/commit/0f5e897d2684416f0c35245d36129ee898e6430c
0f5e897https://github.com/ansible/ansible-lint/commit/0f5e897d2684416f0c35245d36129ee898e6430c
https://github.com/davnat
davnathttps://github.com/davnat
on May 31, 2023https://github.com/python/mypy/issues/12664#issuecomment-1569919429
https://github.com/florian-cl
florian-clhttps://github.com/florian-cl
on Dec 8, 2023https://github.com/python/mypy/issues/12664#issuecomment-1847809714
sbdchdhttps://github.com/sbdchd
on Jan 4, 2024https://github.com/python/mypy/issues/12664#event-11385068399
ui,api: allow uploading images for profileshttps://github.com/recipeyak/recipeyak/commit/cb5f4987591a86c3f98e94f890d9c76b352223e2
cb5f498https://github.com/recipeyak/recipeyak/commit/cb5f4987591a86c3f98e94f890d9c76b352223e2
https://github.com/dahlbaek
dahlbaekhttps://github.com/dahlbaek
on Jan 19, 2024https://github.com/python/mypy/issues/12664#issuecomment-1899915476
https://github.com/DBCerigo
DBCerigohttps://github.com/DBCerigo
on May 8, 2024https://github.com/python/mypy/issues/12664#issuecomment-2099711139
https://github.com/Sh4pe
Sh4pehttps://github.com/Sh4pe
on Jun 10, 2024https://github.com/python/mypy/issues/12664#issuecomment-2157873202
https://github.com/petergaultney
petergaultneyhttps://github.com/petergaultney
on Jul 29, 2024https://github.com/python/mypy/issues/12664#issuecomment-2257156088
https://github.com/rworkduo
rworkduohttps://github.com/rworkduo
on Aug 1, 2024https://github.com/python/mypy/issues/12664#issuecomment-2263073295
https://github.com/ohshazbot
ohshazbothttps://github.com/ohshazbot
on Dec 17, 2024https://github.com/python/mypy/issues/12664#issuecomment-2549384069
https://github.com/ego-thales
ego-thaleshttps://github.com/ego-thales
on Mar 12, 2025https://github.com/python/mypy/issues/12664#issuecomment-2717694660
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Mar 21, 2025https://github.com/python/mypy/issues/12664#issuecomment-2742484522
https://github.com/ego-thales
ego-thaleshttps://github.com/ego-thales
on Mar 21, 2025https://github.com/python/mypy/issues/12664#issuecomment-2742709809
@hauntsaninjahttps://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Apr 11, 2025https://github.com/python/mypy/issues/12664#event-17215933559
Fix incremental issue with namespace packageshttps://github.com/hauntsaninja/mypy/commit/e0b87384ba0d32f18b722df5fe06e44c217d332b
https://docs.github.com/articles/closing-issues-via-commit-messages
e0b8738https://github.com/hauntsaninja/mypy/commit/e0b87384ba0d32f18b722df5fe06e44c217d332b
Fix incremental issue with namespace packageshttps://github.com/hauntsaninja/mypy/commit/cadecd6cb421d750b72d5701d1159d9abc9084b4
https://docs.github.com/articles/closing-issues-via-commit-messages
cadecd6https://github.com/hauntsaninja/mypy/commit/cadecd6cb421d750b72d5701d1159d9abc9084b4
hauntsaninjahttps://github.com/hauntsaninja
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#18907https://github.com/python/mypy/pull/18907
on Apr 11, 2025https://github.com/python/mypy/issues/12664#event-17229935161
hauntsaninjahttps://github.com/hauntsaninja
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
54975a0https://github.com/python/mypy/commit/54975a008f229941c29b4df5ecd755d4f5166d71
on Apr 11, 2025https://github.com/python/mypy/issues/12664#event-17229935221
sthagenhttps://github.com/sthagen
on Apr 12, 2025https://github.com/python/mypy/issues/12664#event-17232137708
Fix incremental issue with namespace packages (option 1) (python#18907)https://github.com/sthagen/python-mypy/commit/54975a008f229941c29b4df5ecd755d4f5166d71
python#18907https://github.com/python/mypy/pull/18907
https://docs.github.com/articles/closing-issues-via-commit-messages
54975a0https://github.com/sthagen/python-mypy/commit/54975a008f229941c29b4df5ecd755d4f5166d71
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on May 29, 2025https://github.com/python/mypy/issues/12664#issuecomment-2920588603
happzhttps://github.com/happz
on Aug 1, 2025https://github.com/python/mypy/issues/12664#event-18933788715
Revert changes for `ruamel` in precommit mypy (#3905)https://github.com/teemtee/tmt/commit/38432bd3a4d9518d9eea3c3972c82f2939713fd0
#3905https://github.com/teemtee/tmt/pull/3905
38432bdhttps://github.com/teemtee/tmt/commit/38432bd3a4d9518d9eea3c3972c82f2939713fd0
bajertomhttps://github.com/bajertom
on Aug 11, 2025https://github.com/python/mypy/issues/12664#event-19092611618
Revert changes for `ruamel` in precommit mypy (#3905)https://github.com/teemtee/tmt/commit/a5f7d65d3075868fb46c386b63bd06ce8a6e0910
#3905https://github.com/teemtee/tmt/pull/3905
a5f7d65https://github.com/teemtee/tmt/commit/a5f7d65d3075868fb46c386b63bd06ce8a6e0910
rudenkornkhttps://github.com/rudenkornk
on Jan 18, 2026https://github.com/python/mypy/issues/12664#event-22121279286
refactor(lint): remove non-incremental W/A for mypyhttps://github.com/rudenkornk/dotfiles/commit/4a8e501e8474a3e97b03ee9f7ed83dbdbe5949b4
4a8e501https://github.com/rudenkornk/dotfiles/commit/4a8e501e8474a3e97b03ee9f7ed83dbdbe5949b4
refactor(lint): remove non-incremental W/A for mypyhttps://github.com/rudenkornk/dotfiles/commit/4b98cc3b9dba7cad40c0404f938fc310f731d033
4b98cc3https://github.com/rudenkornk/dotfiles/commit/4b98cc3b9dba7cad40c0404f938fc310f731d033
refactor(lint): remove non-incremental W/A for mypyhttps://github.com/rudenkornk/dotfiles/commit/8539d42e7bf3ab8a0f3489283d3936d186a3b836
8539d42https://github.com/rudenkornk/dotfiles/commit/8539d42e7bf3ab8a0f3489283d3936d186a3b836
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/12664
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/12664
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-incrementalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-incremental%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.