Я пытаюсь обновить версию infixpy
с помощью 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: ''
Какие исправления необходимы для моего процесса публикации? Я на Python 3.7 на macOS.
🤔 А знаете ли вы, что...
С Python можно создавать веб-скраперы для извлечения данных из веб-сайтов.
добавить * после dist/ вот так: twine upload -r pypi dist/*
Поскольку dist/ — это каталог, и он ожидает загрузки файла, а не любого каталога. Таким образом, файлы будут все (*) файлы внутри папки dist
Согласно документации для 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)
)
базовое имя для каталога — ''
, поэтому вывод не очень полезный.