- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我不是很清楚,setup.cfg
的状态是什么? .我正在为我的 other question 寻找解决方案关于 PEP 508 环境标记,我完全糊涂了。
在我看来,setup.cfg
是对 setup.py
的改进,因为它是声明性的,不涉及运行任意代码以使软件包可安装,使分发恶意 Python 软件包变得更加困难,使运行 Python 软件包注册表等变得更加容易。
所以,here in setuptools
docs提到 setuptools 在 30.3.0 (8 Dec 2016)
中获得了对 setup.cfg 的支持版本,这是相当新的。所以,这一定是一个新事物,对吧?
不完全的。 distutils
had support for setup.cfg
for a long time ,至少从 2.6 开始。已经9年了。
同时,here in wheel
docs据说setup.cfg
现在已弃用,最好通过 extras_require
提供环境标记范围。它提到了 setuptools,所以它不是关于 setup.cfg
的可能已弃用的 distutils 风格.
那么,究竟发生了什么?是 setup.cfg
已弃用,还是最近的做事方式?
最佳答案
我想就最近的发展补充几点说明:
PEP 518仍处于临时状态,但我将其解释为邀请使用 pyproject.toml
而不是 setup.cfg
.引自 PEP:
There are two issues with
setup.cfg
used by setuptools as a general format. One is that they are.ini
files which have issues as mentioned in the configparser discussion above. The other is that the schema for that file has never been rigorously defined and thus it's unknown which format would be safe to use going forward without potentially confusing setuptools installations.
PEP 518 defines
pyproject.toml
as a configuration file to store build system requirements for Python projects. With the help of tools like Poetry or Flit it can fully replace the need forsetup.py
andsetup.cfg
files.
pyproject.toml
指定构建后端.
setuptools
有一个标题为“
Merge setup.cfg spec with pyproject.toml one and deprecate setup.py and setup.cfg”的未解决问题。然而,
setuptools
伙计们还没有决定这个。有一个
open discussion关于如何进行。
关于python - `setup.cfg` 是否已弃用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44878600/
我是一名优秀的程序员,十分优秀!