Warnings don#39;t work about unresolved references after using development install(使用开发安装后,警告对未解决的引用不起作用)
问题描述
我有一个 PyCharm 错误,在我使用 development install pip install -v -e .
之后,IDE 不会警告我任何未解决的引用.例如,对于未解析的引用,您通常会得到以下信息:
但现在在开发安装后未解析的引用不会给出任何警告(对于任何名称、函数、变量、模块...):
我认为这个错误是在我
是Reader模式
造成的,请投给https://youtrack.jetbrains.com/issue/PY-45708(在标题附近竖起大拇指)
I have a bug with PyCharm, after I use development install pip install -v -e .
the IDE does not warn me about any unresolved references. For example, with unresolved references normally you get this:
But now after development install unresolved references don't give any warnings (for any names, functions, variables, modules...):
I think this bug was triggered after I named a module by mistake with a dash (in setup.py
) and installed it, like this:
entry_points={
"console_scripts": [
"adapt-entry = adapt.entry.point-of-entry:run_program",
],
It installed at first, after a while the IDE warned the name was illegal. But after I changed the name to use underscores instead of the dashs the reference inspections of the IDE had become broken for all projects and interpreters if I use development install.
I tried all the usual solutions from this list for reference errors (invalidating cache, deleting .idea
folder, new venv
, changing interpreter, restart, reboot, etc...). But except clearing IDE wide user preferences (I want to avoid it) or reinstalling the IDE (even worse) I tried everything on the list and nothing solved the problem. For all effects my reference inspections are broken the moment I use development install.
I'm using the usual src
layout with a minimal setup.py
and a regular venv
, the following file and directory structure:
C:.
adapt
├───src
│ ├───data
│ ├─ __init__.py
│ │
│ ├───entry
│ ├─ point_of_entry.py
│ └─ __init__.py
│
setup.py
and a minimal setup.py
setup(
name='adapt',
version='0.1',
package_dir={'': 'src'},
zip_safe=False,
packages=find_packages(where='src'),
package_data={
"adapt.data": ["*.txt", "*.csv"],
'adapt': ['py.typed'],
},
include_package_data=True,
entry_points={
"console_scripts": [
"adapt_entry = adapt.entry.point_of_entry:run_program",
],
}
),
The more common error is references not resolving, but in this case it's the opposite: the code runs and finds the references. The problem is (as shown in the 2nd screenshots) it doesn't warn about any unresolved references I introduce on purpose.
But when I run an inspection all the other warnings seem to be issued correctly. (I think I have the proper inspections activated, shown in the screenshot below.) How to solve this short wiping IDE wide user preferences or reinstalling the IDE altogether? Could there be some indirect cause I'm failing to realize?
It is caused by the Reader mode
, please vote for https://youtrack.jetbrains.com/issue/PY-45708 (thumbs up near the title)
这篇关于使用开发安装后,警告对未解决的引用不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用开发安装后,警告对未解决的引用不起作用
基础教程推荐
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 筛选NumPy数组 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01