René's URL Explorer Experiment


Title: Editable installs are not recognized as having typing when using py.typed (setuptools v64 issue) · Issue #13392 · python/mypy · GitHub

Open Graph Title: Editable installs are not recognized as having typing when using py.typed (setuptools v64 issue) · Issue #13392 · python/mypy

X Title: Editable installs are not recognized as having typing when using py.typed (setuptools v64 issue) · Issue #13392 · python/mypy

Description: Bug Report mypy does not recognize that libraries installed as editable using pip are fully typed even though the py.typed file is correctly included. To Reproduce Working script which installs a NON-editable version of library: # create...

Open Graph Description: Bug Report mypy does not recognize that libraries installed as editable using pip are fully typed even though the py.typed file is correctly included. To Reproduce Working script which installs a N...

X Description: Bug Report mypy does not recognize that libraries installed as editable using pip are fully typed even though the py.typed file is correctly included. To Reproduce Working script which installs a N...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Editable installs are not recognized as having typing when using py.typed (setuptools v64 issue)","articleBody":"\u003c!--\r\n  If you're new to mypy and you're not sure whether what you're experiencing is a mypy bug, please see the \"Question and Help\" form\r\n  instead.\r\n  Please also consider:\r\n\r\n  - checking our common issues page: https://mypy.readthedocs.io/en/stable/common_issues.html\r\n  - searching our issue tracker: https://github.com/python/mypy/issues to see if\r\n    it's already been reported\r\n  - asking on gitter chat: https://gitter.im/python/typing\r\n-->\r\n\r\n**Bug Report**\r\n\r\n\u003c!--\r\nNote: If the problem you are reporting is about a specific library function, then the typeshed tracker is better suited\r\nfor this report: https://github.com/python/typeshed/issues\r\n-->\r\n\r\nmypy does not recognize that libraries installed as editable using pip are fully typed even though the `py.typed` file is correctly included.\r\n\r\n**To Reproduce**\r\n\r\nWorking script which installs a NON-editable version of library:\r\n```\r\n# create python environment with pip\r\nrm -rf nionui\r\ngit clone https://github.com/nion-software/nionui.git\r\npushd nionui\r\ngit checkout 0.6.4\r\npython -m pip install mypy numpy imageio types-pytz types-tzlocal types-setuptools\r\n# the next line is the only change between these two scripts\r\npython -m pip install nionutils==0.4.4\r\nmypy --namespace-packages --ignore-missing-imports --follow-imports=silent --install-types --non-interactive --strict --no-warn-redundant-casts --no-warn-unused-ignores -p nion.ui -p nionui_app.nionui_examples\r\npopd\r\n# success\r\n```\r\n\r\nFailing version which installs an editable version of a library:\r\n```\r\n# create python environment with pip\r\nrm -rf nionui\r\ngit clone https://github.com/nion-software/nionui.git\r\npushd nionui\r\ngit checkout 0.6.4\r\npython -m pip install mypy numpy imageio types-pytz types-tzlocal types-setuptools nionutils\r\n# the next line is the only change between these two scripts\r\npython -m pip install -e git+https://github.com/nion-software/nionutils.git@0.4.4#egg=nionutils\r\nmypy --namespace-packages --ignore-missing-imports --follow-imports=silent --install-types --non-interactive --strict --no-warn-redundant-casts --no-warn-unused-ignores -p nion.ui -p nionui_app.nionui_examples\r\npopd\r\n# failure\r\n```\r\n\r\n\r\n**Expected Behavior**\r\n\r\n\u003c!--\r\n  How did you expect your project to behave?\r\n  It’s fine if you’re not sure your understanding is correct.\r\n  Write down what you thought would happen. If you just expected no errors, you can delete this section.\r\n-->\r\n\r\nThese should work the same. The source client and underlying library are the same in both cases except one is installed as an editable install.\r\n\r\n**Actual Behavior**\r\n\r\nThe failing version gives type errors:\r\n\r\n```\r\nnion/ui/DrawingContext.py:790: error: Returning Any from function declared to return \"Optional[str]\"\r\nnion/ui/DrawingContext.py:794: error: Returning Any from function declared to return \"Optional[str]\"\r\nnion/ui/DrawingContext.py:798: error: Returning Any from function declared to return \"Optional[str]\"\r\nnion/ui/CanvasItem.py:2780: error: Class cannot subclass \"Observable\" (has type \"Any\")\r\nnion/ui/UserInterface.py:3217: error: Returning Any from function declared to return \"int\"\r\nnion/ui/UserInterface.py:3224: error: Returning Any from function declared to return \"int\"\r\nnion/ui/UserInterface.py:3620: error: Class cannot subclass value of type \"Any\"\r\nnion/ui/UserInterface.py:3634: error: Class cannot subclass value of type \"Any\"\r\nnion/ui/Widgets.py:382: error: Returning Any from function declared to return \"AbstractSet[int]\"\r\nnion/ui/Declarative.py:949: error: Class cannot subclass \"Observable\" (has type \"Any\")\r\nnion/ui/Declarative.py:1112: error: Class cannot subclass \"Observable\" (has type \"Any\")\r\nnion/ui/GridCanvasItem.py:256: error: Returning Any from function declared to return \"int\"\r\nFound 12 errors in 6 files (checked 51 source files)\r\n```\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.971\r\n- Mypy command-line flags: see script\r\n- Mypy configuration options from `mypy.ini` (and other config files): None\r\n- Python version used: Python 3.10.5\r\n- Operating system and version: macOS, Ubuntu 20, didn't try Windows yet\r\n\r\n\u003c!--\r\nYou can freely edit this text, please remove all the lines\r\nyou believe are unnecessary.\r\n-->\r\n\r\nAlso note: this behavior seems to have changed around 2022-08-10 to 2022-08-11. Something in the Python ecosystem seems to have changed. Nevertheless, this seems to be a bug in `mypy` since it is all about whether `py.typed` is found or not.","author":{"url":"https://github.com/cmeyer","@type":"Person","name":"cmeyer"},"datePublished":"2022-08-12T00:51:03Z","url":"https://github.com/python/mypy/issues/13392"}

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:f324835e-9d92-5ae6-7f28-55dae460d5f3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC8EA:3FDF0C:48EA1E:617F0C:6B002CFB
html-safe-nonce369a26d43ea8aadc57222e151279fd9bc659a9ab9d4657f66c1c65fd3ad0ecf9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEVBOjNGREYwQzo0OEVBMUU6NjE3RjBDOjZCMDAyQ0ZCIiwidmlzaXRvcl9pZCI6IjI5NjkzOTQzNjU2NTY0NzY5MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace50947fe104b1d6e07657c80b4f0c859afd60a2fdd2b79fa05a3f2e9c8236c0c
hovercard-subject-tagissue:1336631371
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/13392/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f44ce7e521673b007ef33b1df81c421f5db63ca979b88320191afbb61658026c/python/mypy/issues/13392
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f44ce7e521673b007ef33b1df81c421f5db63ca979b88320191afbb61658026c/python/mypy/issues/13392
og:image:altBug Report mypy does not recognize that libraries installed as editable using pip are fully typed even though the py.typed file is correctly included. To Reproduce Working script which installs a N...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecmeyer
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
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
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/13392#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F13392
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%2F13392
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/13392
Reloadhttps://github.com/python/mypy/issues/13392
Reloadhttps://github.com/python/mypy/issues/13392
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 requests547 (547)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/13392
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/13392
Editable installs are not recognized as having typing when using py.typed (setuptools v64 issue)https://github.com/python/mypy/issues/13392#top
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/cmeyer
cmeyerhttps://github.com/cmeyer
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issue-1336631371
Nexthttps://github.com/python/mypy/issues/13392?timeline_page=1
cmeyerhttps://github.com/cmeyer
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on Aug 12, 2022https://github.com/python/mypy/issues/13392#event-7175778458
https://github.com/lawrence-law
lawrence-lawhttps://github.com/lawrence-law
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issuecomment-1212727421
https://setuptools.pypa.io/en/latest/history.html#v64-0-0https://setuptools.pypa.io/en/latest/history.html#v64-0-0
https://github.com/JacobHayes
JacobHayeshttps://github.com/JacobHayes
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issuecomment-1213267493
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issuecomment-1213483295
hauntsaninjahttps://github.com/hauntsaninja
on Aug 12, 2022https://github.com/python/mypy/issues/13392#event-7181717731
https://github.com/JacobHayes
JacobHayeshttps://github.com/JacobHayes
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issuecomment-1213521486
PEP 660https://peps.python.org/pep-0660/
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issuecomment-1213527559
https://mail.python.org/archives/list/typing-sig@python.org/thread/IIVBPYDZR5T5BGPAWFVYS5ZPYDXGVHQN/#OSWHT5VSRGKPSPYD7PQWR2M4OCSL5WO3https://mail.python.org/archives/list/typing-sig@python.org/thread/IIVBPYDZR5T5BGPAWFVYS5ZPYDXGVHQN/#OSWHT5VSRGKPSPYD7PQWR2M4OCSL5WO3
https://github.com/JacobHayes
JacobHayeshttps://github.com/JacobHayes
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issuecomment-1213539066
pypa/setuptools#3518https://github.com/pypa/setuptools/issues/3518
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issuecomment-1213544797
https://github.com/JacobHayes
JacobHayeshttps://github.com/JacobHayes
on Aug 12, 2022https://github.com/python/mypy/issues/13392#issuecomment-1213557253
herehttps://github.com/JacobHayes/editable-install-hooks-repro
https://github.com/rojvv
rojvvhttps://github.com/rojvv
on Dec 15, 2022https://github.com/python/mypy/issues/13392#issuecomment-1353626412
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Dec 15, 2022https://github.com/python/mypy/issues/13392#issuecomment-1353755024
setuptools issuehttps://github.com/pypa/setuptools/issues/3518
their current recommended solutionhttps://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior
https://github.com/rojvv
rojvvhttps://github.com/rojvv
on Dec 16, 2022https://github.com/python/mypy/issues/13392#issuecomment-1355014147
https://github.com/emmatyping
emmatypinghttps://github.com/emmatyping
on Jun 16, 2023https://github.com/python/mypy/issues/13392#issuecomment-1594170707
they no longer guarantee that (see attention note below linked section)https://setuptools.pypa.io/en/latest/userguide/development_mode.html#how-editable-installations-work
https://github.com/erictraut
erictrauthttps://github.com/erictraut
on Jun 16, 2023https://github.com/python/mypy/issues/13392#issuecomment-1594209324
document some workaroundshttps://microsoft.github.io/pyright/#/import-resolution?id=editable-installs
chipx86https://github.com/chipx86
on Sep 14, 2024https://github.com/python/mypy/issues/13392#event-14260582243
Switch Djblets's packaging to pyproject.toml.https://github.com/djblets/djblets/commit/e675f48d90c400b13facb46267a53512232e6265
e675f48https://github.com/djblets/djblets/commit/e675f48d90c400b13facb46267a53512232e6265
swhmirrorhttps://github.com/swhmirror
on Nov 26, 2024https://github.com/python/mypy/issues/13392#event-15440013128
bin/install: Force legacy behavior of editable installs with recent piphttps://github.com/SoftwareHeritage/swh-environment/commit/5979f0b015fb21ddbda449f56e5e6160c9262888
5979f0bhttps://github.com/SoftwareHeritage/swh-environment/commit/5979f0b015fb21ddbda449f56e5e6160c9262888
https://github.com/dfroger
dfrogerhttps://github.com/dfroger
on Feb 6, 2025https://github.com/python/mypy/issues/13392#issuecomment-2640462916
build/__editable__https://setuptools.pypa.io/en/latest/userguide/development_mode.html#strict-editable-installs
the search path https://github.com/python/mypy/issues/12313
https://github.com/emmatyping
emmatypinghttps://github.com/emmatyping
on Feb 14, 2025https://github.com/python/mypy/issues/13392#issuecomment-2658359967
cars-cneshttps://github.com/cars-cnes
on Mar 20, 2025https://github.com/python/mypy/issues/13392#event-16912839197
chore: declare that pandora is typedhttps://github.com/CNES/Pandora/commit/c624967ccce57165c7d8a9208229c27cd425caa6
c624967https://github.com/CNES/Pandora/commit/c624967ccce57165c7d8a9208229c27cd425caa6
chore: declare that pandora is typedhttps://github.com/CNES/Pandora/commit/afbea1afcfd41443bc8cfb3daf5fe73e998f0cce
afbea1ahttps://github.com/CNES/Pandora/commit/afbea1afcfd41443bc8cfb3daf5fe73e998f0cce
chore: declare that pandora is typedhttps://github.com/CNES/Pandora/commit/5c489f640c5e6fab362fc8ce5c6c51b11468ffde
5c489f6https://github.com/CNES/Pandora/commit/5c489f640c5e6fab362fc8ce5c6c51b11468ffde
https://github.com/bergentroll
bergentrollhttps://github.com/bergentroll
on Jun 26, 2025https://github.com/python/mypy/issues/13392#issuecomment-3008019631
nsoranzohttps://github.com/nsoranzo
on Oct 29, 2025https://github.com/python/mypy/issues/13392#event-20567949116
Workaround python/mypy#13392https://github.com/arash77/galaxy/commit/2fc3884d4525923461a34f2fb487064049c1928f
python/mypy#13392https://github.com/python/mypy/issues/13392
2fc3884https://github.com/arash77/galaxy/commit/2fc3884d4525923461a34f2fb487064049c1928f
Workaround python/mypy#13392https://github.com/arash77/galaxy/commit/4efcf3a72714368b4e48db9d1488d5c6632ed9e6
python/mypy#13392https://github.com/python/mypy/issues/13392
4efcf3ahttps://github.com/arash77/galaxy/commit/4efcf3a72714368b4e48db9d1488d5c6632ed9e6
Workaround python/mypy#13392https://github.com/arash77/galaxy/commit/2cac40bd2122866942f47a843beb42edda372674
python/mypy#13392https://github.com/python/mypy/issues/13392
2cac40bhttps://github.com/arash77/galaxy/commit/2cac40bd2122866942f47a843beb42edda372674
Workaround python/mypy#13392https://github.com/arash77/galaxy/commit/021b2c98002e7300cb55fcefc8e2a3a728d488f4
python/mypy#13392https://github.com/python/mypy/issues/13392
021b2c9https://github.com/arash77/galaxy/commit/021b2c98002e7300cb55fcefc8e2a3a728d488f4
Workaround python/mypy#13392https://github.com/arash77/galaxy/commit/0fdec3bed5fbe61e35b040209415ddd89a1a41b8
python/mypy#13392https://github.com/python/mypy/issues/13392
0fdec3bhttps://github.com/arash77/galaxy/commit/0fdec3bed5fbe61e35b040209415ddd89a1a41b8
Workaround python/mypy#13392https://github.com/arash77/galaxy/commit/ed994279cf0d77ee1d79d17023f06c9dd1db8b91
python/mypy#13392https://github.com/python/mypy/issues/13392
ed99427https://github.com/arash77/galaxy/commit/ed994279cf0d77ee1d79d17023f06c9dd1db8b91
checkmkreporeplicatorhttps://github.com/apps/checkmkreporeplicator
on Aug 11, 2026https://github.com/python/mypy/issues/13392#event-29284006000
Makefile: stop leaking legacy-editable into third party buildshttps://github.com/Checkmk/checkmk/commit/359768bffde2bf0338b2d112bac476fa9ab646c7
359768bhttps://github.com/Checkmk/checkmk/commit/359768bffde2bf0338b2d112bac476fa9ab646c7
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/13392
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/13392
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%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.