为什么我的设置.py在pypi上显示长描述?

2024-09-30 03:26:04 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试上传一个包到pypi,除了我的详细描述之外,一切都正常。它是为了通读我的自述文件.rst但在pypi上它是空白的。docutils rst2html没有抛出任何错误,设置.py--长描述打印出我的自述文件,设置.py-检查也不会产生错误。在

https://pypi.python.org/pypi/cryptocli

在设置.py公司名称:

# -*- coding: utf-8 -*-

from setuptools import setup, find_packages


with open('README.rst') as f:
    readme = f.read()

with open('LICENSE') as f:
    license = f.read()

setup(
    name='cryptocli',
    version='0.1.3',
    description='CLI to query cryptocurrency value',
    long_description=readme,
    author='huwwp',
    author_email='hpigott@gmail.com',
    url='https://github.com/huwwp/cryptocli',
    license=license,
    keywords='crypto cli query cryptocurrency bitcoin',
    packages=find_packages(exclude=('tests', 'docs')),
    install_requires=['requests'],
    py_modules=['cryptocli'],
    entry_points = {
        'console_scripts': ['cryptocli = cryptocli:main'],
    }
)

在自述文件.rst公司名称:

^{pr2}$

Tags: pyhttps名称pypilicensepackages错误with
1条回答
网友
1楼 · 发布于 2024-09-30 03:26:04

license参数用于提供正在使用的软件许可证的名称(例如,'MIT'或{}),而不是提供许可证的整个文本。显然,无论您使用什么版本的setuptools构建sdist都无法处理多行许可证,因为sdist中的PKG-INFO文件如下所示:

Metadata-Version: 1.0
Name: cryptocli
Version: 0.1.3
Summary: CLI to query cryptocurrency value
Home-page: https://github.com/huwwp/cryptocli
Author: huwwp
Author-email: hpigott@gmail.com
License: MIT License

Copyright (c) 2017 huwwp

Permission is hereby granted, ...

Description: cryptocli
        =========

        Command line interface for querying current value of cryptocurrenies in
        given fiat.
...

setuptools未能缩进许可证文本会导致PKG-INFO的所有后续字段(包括长描述和关键字)都无法解析,因此它们不会出现在PyPI上。你应该把license='MIT'写在你的setup.py中。在

{{cd8>文件中没有{cd8>,除非你的文件{cd8}不在,否则你的cd8}不会自动包含在你的cd8}中在

相关问题 更多 >

    热门问题