Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return a non-zero exit code when publishing to a repository fails #239

Closed
ratanos opened this issue Jun 20, 2018 · 8 comments
Closed

Return a non-zero exit code when publishing to a repository fails #239

ratanos opened this issue Jun 20, 2018 · 8 comments
Labels
area/publishing Related to PyPI/PEP 503 publishing kind/bug Something isn't working as expected

Comments

@ratanos
Copy link

ratanos commented Jun 20, 2018

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

  1. Builds a wheel file my_wheel_file_0.1.0
  2. Uploads the wheel file to Nexus Repository => Version on Nexus: my_wheel_file_0.1.0

Run again without updating the version, i.e the project's version is still 0.1.0
poetry publish $private_nexus_url --build

  1. Builds a wheel file my_wheel_file_0.0.1
  2. Tries to upload the wheel file my_wheel_file_0.0.1 to Nexus Repository and returns an error message.
  3. "poetry publish" fails silently by displaying the error message.

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.

@nchammas
Copy link
Contributor

Just curious: Do you still see this behavior with the latest version of Poetry?

@ratanos
Copy link
Author

ratanos commented Aug 8, 2018

@nchammas Yes, In poetry 0.11.4, still see the same behavior.

@Roger
Copy link

Roger commented Oct 3, 2018

Publishing with wrong credentials ends up in the same behavior

@jgirardet
Copy link
Contributor

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

@jared-mackey
Copy link

@nchammas yes, this behavior exists on 0.12.7.

@sdispater sdispater added kind/bug Something isn't working as expected area/publishing Related to PyPI/PEP 503 publishing labels Mar 2, 2019
sdispater added a commit that referenced this issue Mar 21, 2019
@sdispater
Copy link
Member

This should be fixed in commit 9035140. It will be released in the next bugfix version.

@sdispater
Copy link
Member

Version 0.12.12 has just been released!

Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/publishing Related to PyPI/PEP 503 publishing kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

6 participants