【问题标题】:pypi information displayed in the wrong placepypi信息显示在错误的地方
【发布时间】:2021-03-11 22:27:25
【问题描述】:

使用 twine 将我的代码上传到 pypi 后,应该在侧边栏中显示的信息(即主页、分类器、关键字、作者、作者电子邮件)现在以纯文本形式显示在主体中(除了主页和author-email,即 url)。

我想知道这是否是我的 setup.py 的问题,但在 google 上还没有找到太多内容。

setup.py 的(删节)内容:

setup(
    name="binarycpython",
    version="0.2",
    description="""
    This is a python API for binary_c (versions {}) by David Hendriks, Rob Izzard and collaborators.
    Based on the initial set up by Jeff andrews.
    It is tested and designed to work for versions {}, we can't guarantee proper functioning for other versions

    If you want to use a different version of binary_c, download and install a different version of this package
    """.format(
        ','.join(str(REQUIRED_BINARY_C_VERSIONS)), ','.join(str(REQUIRED_BINARY_C_VERSIONS))
    ),
    author="David Hendriks",
    author_email="davidhendriks93@gmail.com",
    # long_description=readme(),
    long_description="hello",
    url="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python",
    license="gpl",
    keywords = ['binary_c', 'astrophysics', 'stellar evolution', 'population synthesis'],   # Keywords that define your package best
    packages=[
        "binarycpython",
        "binarycpython.utils",
        "binarycpython.core",
        "binarycpython.tests",
        "binarycpython.tests.c_bindings",
    ],
    install_requires=["numpy", "pytest", "h5py"],
    include_package_data=True,
    ext_modules=[BINARY_C_PYTHON_API_MODULE],  # binary_c must be loaded

    classifiers=[
        "Development Status :: 3 - Alpha",
        "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python :: 3",
        "Programming Language :: C",
        "Topic :: Education",
        "Topic :: Scientific/Engineering :: Physics",
        "Topic :: Software Development :: Libraries :: Python Modules",
    ],

    cmdclass={'build': CustomBuildCommand},

)

描述的格式也很奇怪:空行之后的行与其他行的位置不同。然而,这可能就是它的工作方式。

感谢任何建议/提示!

【问题讨论】:

    标签: python python-3.x setuptools pypi distutils


    【解决方案1】:

    您应该交换(短)descriptionlong_description。但除此之外,setup.py 中的所有内容看起来都是正确的。您可以通过查看生成的文件PKG-INFO 自己验证数据。

    我的建议是联系 PyPI 支持。

    【讨论】:

    • 所以 long_description 包含 readme.md 中的内容的占位符(我遇到了一个不同的问题,即使用降价文件而不是 .rst 文件),所以 description 包含我想要的内容有我想。关于 PKG-INFO:它确实包含正确的信息(即所有分类器、主页等)
    【解决方案2】:

    您的 description 字段不应包含换行符。

    这是https://github.com/pypa/setuptools/issues/1390

    【讨论】:

    • 这确实解决了格式错误的问题,以及我在 long_description 中使用 markdown 而不是 rst 时遇到的另一个问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-21
    • 2016-07-25
    • 2013-08-20
    • 2019-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多