Context: Using Poetry in Build (CI/CD) systems.
While using Poetry to upload a wheel file to Sonatype Nexus repository, Repository throws a 400 error if the wheel file with the same version is already available in the repository.
Example:
poetry publish $private_nexus_url --build
Run again without updating the version, i.e the project's version is still 0.1.0
poetry publish $private_nexus_url --build
Error message:
[HTTPError]
400 Client Error: Repository does not allow updating assets: pypi-internal
or url: <private repository url>
Improvement/Bug:
In the context of CI/CD systems, a non-zero exit code along with error message is required else the build systems fail silently without uploading the latest artifact.
Exit with a non zero code along with error message
Note: We could configure Nexus to allow republishing the same artifact version again.
Just curious: Do you still see this behavior with the latest version of Poetry?
@nchammas Yes, In poetry 0.11.4, still see the same behavior.
Publishing with wrong credentials ends up in the same behavior
same thing in last version :
In [6]: subprocess.check_output('poetry --version', shell=True).decode()
Out[6]: 'Poetry 0.12.6\n'
In [7]: subprocess.check_call('poetry publish --username=wrong_username_茅霉$d --password=mokmokmo', shell=True)
Publishing aaaaa (0.1.0) to PyPI
Out[7]: 0
should be labeled as a bug since it's definitely not the expected behavior
@nchammas yes, this behavior exists on 0.12.7.
This should be fixed in commit 903514060748496f9c87513ba7fb33ed29158325. It will be released in the next bugfix version.
Version 0.12.12 has just been released!
Most helpful comment
Publishing with wrong credentials ends up in the same behavior