简体   繁体   English

点子显示未显示要求

[英]pip show not showing requirements

When I run the pip show command on my package Classeviva.py I get the following.当我在包Classeviva.py上运行pip show命令时,我得到以下信息。

D:\Python\Python\Classeviva>pip show classeviva.py
Name: Classeviva.py
Version: 0.1.1.post1
Summary: Classeviva Python API wrapper
Home-page: https://github.com/Lioydiano/Classeviva
Author: FLAK-ZOSO
Author-email: @gmail.com
License: 
Location: c:\users\...\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages
Requires: 
Required-by: 

In particular the field Requires: is empty, despite being included in setup.py (current version at url).特别是字段Requires:是空的,尽管它包含在setup.py (当前版本在 url)中。

requires=["requests"]

And in pyproject.toml too.pyproject.toml中也是如此。 In it I specified license too, so I don't get why pip isn't showing it in the field license .在其中我也指定了license ,所以我不明白为什么pip没有在现场license中显示它。

[build-system]
license = "MIT"
requires = ["setuptools>=42", "requests>=2.27.1"]
build-backend = "setuptools.build_meta"

Edit编辑


This is the folder structure under D:\\Python\Python\Classeviva , it can be found on GitHub at the repository, except for .gitignore d files and folders.这是D:\\Python\Python\Classeviva下的文件夹结构,可以在 GitHub 的存储库中找到,除了.gitignore d 文件和文件夹。

...

Edit (1)编辑 (1)


Adding install_requires='requests>=2.27' as argument to the setuptools.setup call, as suggested below by Iguananaut , made the requirement visible via pip .正如Iguananaut下面所建议的那样,添加install_requires='requests>=2.27'作为setuptools.setup调用的参数,通过pip使需求可见。

Requires: requests

Use of setup.py files are all but deprecated (in favor of static setup.cfg files).几乎不推荐使用setup.py文件(支持静态setup.cfg文件)。 What's more, the requires= keyword is an even older artifact of distutils and is not really used at all in setuptools.更重要的是, requires=关键字是 distutils 的一个更古老的工件,在 setuptools 中根本没有真正使用。

What you want here is the deceptively similar install_requires='requests>=2.27'您在这里想要的是看似相似的install_requires='requests>=2.27'

Putting requires=['requests'] in pyproject.toml is, unless you know exactly what you're doing, pretty useless.除非您确切知道自己在做什么,否则将requires=['requests']放入pyproject.toml是毫无用处的。 This requires is just what the build system for your project requires, and has no connection to the runtime requirements of your project.这正是您项目的构建系统所requires的,与您项目的运行时要求无关。

Welcome to the not at all confusing world of Python packaging.欢迎来到 Python 打包这个完全不令人困惑的世界。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM