python - 未知的分发格式:'' 通过 Twine 上传到 PyPI 时
问题描述
我正在尝试更新infixpy
using的版本twine
。这是我的~/.pypirc
:
index-servers =
pypi
pypitest
[pypi]
repository: https://upload.pypi.org/legacy/
username: myuser
password: mypassword
[pypitest]
repository: https://upload.testpypi.org/legacy
username: myuser
password: mypassword
这是命令行:
python setup.py build
twine upload -r pypi dist/
上传错误 InvalidDistribution: Unknown distribution format: ''
这是完整的输出:
Processing dependencies for infixpy==0.0.6
Finished processing dependencies for infixpy==0.0.6
Processing /Users/steve/git/infixpy
Building wheels for collected packages: infixpy
Building wheel for infixpy (setup.py) ... done
Created wheel for infixpy: filename=infixpy-0.0.6-py3-none-any.whl size=43459 sha256=01fed46f42fa86475079636a55685c93521989aa0ba6558726a9d35c01004b7a
Stored in directory: /private/var/folders/d6/m67jyndd7h754m3810cl3bpm0000gp/T/pip-ephem-wheel-cache-1bizg6_y/wheels/47/66/74/d79a56979feba04c8ef05e12fe861cacf813cecd397e57071f
Successfully built infixpy
Installing collected packages: infixpy
Attempting uninstall: infixpy
Found existing installation: infixpy 0.0.6
Uninstalling infixpy-0.0.6:
Successfully uninstalled infixpy-0.0.6
Successfully installed infixpy-0.0.6
Uploading distributions to https://upload.pypi.org/legacy/
InvalidDistribution: Unknown distribution format: ''
我的发布过程需要哪些更正?我在 macOS 上使用 Python 3.7。
解决方案
根据(强调我的)的文档:twine upload
positional arguments:
dist The distribution files to upload to the repository
(package index). Usually dist/* . May additionally
contain a .asc file to include an existing signature
with the file upload.
你传递了一个目录,而不是文件——正如文档所建议的那样,你可能想要dist/*
. 如果您传递一个目录,则没有已知发行版的匹配项,因为这些是基于文件扩展名的,因此您最终会遇到以下错误情况:
else:
raise exceptions.InvalidDistribution(
"Unknown distribution format: '%s'" % os.path.basename(filename)
)
目录的basename
是''
,因此输出不太有用。
推荐阅读
- java - 简化 java 流以查找重复属性
- json - 如何更新 JSON 值?
- go - 使用 go-sqlmock 模拟 gorm `updates` 时出现`could not match actual sql` 错误?
- python-3.x - 无法在python的exec命令中执行if语句
- python - 编写 Discord 机器人,新成员加入时出现错误
- javascript - 如何在html5中仅使用播放选项加载视频和音频选项
- arrays - 将二维数组公式输出为格式化字符串
- sql - 如何将内连接 SQL 查询转换为 Lambda 表达式
- python-3.x - views.py 需要为 googlemap api 附近搜索停止一秒钟吗?
- c - 每个字符串参数的长度