feat: Allow `-` in module name discovery

未关闭
#14,660 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
compilers

调研方向

从 issue 中链接的模块映射文档开始,使用 namespace-pkg 目录复现其中展示的 MYPYPATH/mypy 命令。确定类似 allow_all_module_names 的 flag 应如何影响带连字符的模块名以及“Duplicate module names”情况。Done 应包括已达成一致的选项行为,以及对文档示例的覆盖。

由索引模型根据 Issue 内容生成。

描述

feature

Feature

Can we allow - in module name discovery in https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules
with a flag allow_all_module_names or something

such that we can do:

For example, say your directory tree consists solely of src/namespace-pkg/mod.py. If you run the following command, mypy will correctly associate mod.py with namespace-pkg.mod:

 MYPYPATH=src mypy --namespace-packages --explicit-package-bases .

Pitch

This option is needed to circumvent the Duplicate module names. I want to treat everything as a module also if technically the name is not consistent with a python module. Could we make that more agnostic?

主要语言
Python
星标
20.6k
派生
3.3k
平均合并
1 天 18 小时
30 天内合并 PR
54

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python/mypy 的其他 Issue

查看 python/mypy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。