我想使用 twine 将项目构建上传到 test.pypi.org。我正在关注twine GitHub 页面中基本用例的自述文件。我已经安装了最新版本的 twine:
$ twine --version
twine version 1.5.0 (pkginfo: 1.2.1, requests: 2.9.1, setuptools: 20.7.0)`
但是当我尝试上传我构建的项目时,我收到以下错误:
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
usage: twine upload [-h] [-r REPOSITORY] [-s] [--sign-with SIGN_WITH]
[-i IDENTITY] [-u USERNAME] [-p PASSWORD] [-c COMMENT]
dist [dist ...]
twine upload: error: unrecognized arguments: --repository-url
这是Python Packaging Tutorial和 Twine README 中引用的确切代码行,并且 --repository-url 应该是一个有效标志。这是传递给标志而不是标志本身的参数的错误,如果是这样,我需要修复的究竟是什么?
我的项目 setup.py 文件:
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='MyPackageName',
version='0.1.0',
author='J. Chamness',
author_email='myEmail@gmail.com',
description='MyDescription',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://test.pypi.org/legacy/',
packages=setuptools.find_packages(),
classifiers=(
'Programming Language :: Python :: 3',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: OS Independent',
),
)