【问题标题】:Can`pip wheel` command create *universal* wheels?`pip wheel` 命令可以创建*通用* 轮子吗?
【发布时间】:2018-11-14 02:59:35
【问题描述】:

有没有办法使用pip wheel 命令来创建通用轮子?

例如,以aws_requests_auth为例,如果我执行
pip wheel aws_requests_auth,会创建一个Python3轮:aws_requests_auth-0.4.1-py3-none-any.whl

我可以改变一些东西来创建一个py2.py3-none-any.whl 轮子吗?

上例中用到的文件:

$ ls -R
.:
aws_requests_auth  CHANGELOG.md  dist  LICENSE  MANIFEST  MANIFEST.in  PKG-INFO  README.md  setup.py

./aws_requests_auth:
aws_auth.py                               boto_utils.py                           chardet-3.0.4-py2.py3-none-any.whl  __init__.py                           tests
aws_requests_auth-0.4.1-py3-none-any.whl  certifi-2018.4.16-py2.py3-none-any.whl  idna-2.6-py2.py3-none-any.whl       requests-2.18.4-py2.py3-none-any.whl  urllib3-1.22-py2.py3-none-any.whl

./aws_requests_auth/tests:
__init__.py  test_aws_auth.py  test_boto_utils.py

./dist:
aws-requests-auth-0.4.1.tar.gz

$ cat setup.py 
from distutils.core import setup


setup(
    name='aws-requests-auth',
    version='0.4.1',
    author='David Muller',
    author_email='davehmuller@gmail.com',
    packages=['aws_requests_auth'],
    url='https://github.com/davidmuller/aws-requests-auth',
    description='AWS signature version 4 signing process for the python requests module',
    long_description='See https://github.com/davidmuller/aws-requests-auth for installation and usage instructions.',
    install_requires=['requests>=0.14.0'],
    classifiers=[
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
    ]
)

【问题讨论】:

  • 您是否尝试过添加--universal,如the docs 中所述?
  • 是的,@abarnert,我试过 $ pip wheel --universal --wheel-dir=aws-requests-auth-0.4.1 Unidecode,pip 抱怨:no such option: --universal, 因为我认为 --universal 参数适用于 pip 以外的命令。

标签: python python-3.x pip setup.py python-wheel


【解决方案1】:

setup.cfg:

[bdist_wheel]
universal=1

参考:https://wheel.readthedocs.io/en/stable/#defining-the-python-version

【讨论】:

    猜你喜欢
    • 2020-04-08
    • 1970-01-01
    • 1970-01-01
    • 2017-02-28
    • 1970-01-01
    • 2021-03-12
    • 2013-11-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多