-
Notifications
You must be signed in to change notification settings - Fork 307
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
Add --skip-existing support for Artifactory PyPI repository type #326
Add --skip-existing support for Artifactory PyPI repository type #326
Conversation
There is no need to descend into this function if skip_existing is False.
…tations. Where possible detect the target first - any signature in the headers that can be used should allow you to branch your logic. Otherwise we fall back to the original two scenarios.
We aren't actually skipping the upload, that horse has already bolted. Instead we're making a decision on whether or not we should blow up and alarm the user, or if we think it's safe to proceed because this failure was expected.
The literal output that Artifactory emits is JSON and not PEP8 compliant. Adding whitespace to make it pass the PEP8 tests.
Codecov Report
@@ Coverage Diff @@
## master #326 +/- ##
==========================================
- Coverage 68.84% 68.59% -0.25%
==========================================
Files 12 12
Lines 597 605 +8
Branches 95 100 +5
==========================================
+ Hits 411 415 +4
Misses 158 158
- Partials 28 32 +4
Continue to review full report at Codecov.
|
Hi, @goodtune and thank you for this PR! I appreciate the the clear explanation in the comment and here in the PR in particular. I'm taking a look at this now. Clearly the various Python package indexes could be a bit more congruent with each other when it comes to an upload API. I've started pypa/packaging-problems#128 for proposing a PEP to get some basics in place. Do you have a JFrog Artifactory contact I could reach out to? |
I don't actually have a name of anyone at JFrog – I developed against our on-premise instance by capturing the response under the (albeit naively construed) scenarios that correspond to the behaviours already being tested. Thanks for creating the ticket to attack the broader problem of specification-by-implementation. |
Hi @brainwane is there anything else I can do? Are there any implementation concerns? |
Hi @goodtune and sorry for the delay. Yesterday I was putting out Twine 1.11.0 and I just started looking at your PR, and haven't delved into it as deeply as I would like yet. I would like to confer with fellow maintainers before accepting this -- @sigmavirus24 especially. I can tell you a few things you could do to make this a little easier to review (I'm sorry to ask but I do think they will help):
Thank you. I am sorry for the wait. |
A quick scan of this makes me confident this is a good change going forward. I think all of @brainwane's suggestions are good ones. We could use betamax to record an interaction with Artifactory, but that seems like a lot of set-up for @goodtune to do. It would be good for codecov to be happy with this patch, although, I think @brainwane has had other issues with it. |
I typically use I'd consider dedicating some time to that in a future PR. |
FWIW: I support this enhancement. :) |
Closing in favor of #363 |
We use Artifactory for a variety of purposes, and one of the supported repository types is PyPI.
We typically have permissions set such that publishers are prevented from overwriting packages. The response from Artifactory is different to that which PyPI and pypiserver deliver so it is not possible to use the
--skip-existing
switch withtwine
when Artifactory is your server.This pull request refactors the
skip_upload
(internal API) such that:--skip-existing
switch at the command lineignore_upload_failure
because it was never avoiding an upload, only dealing with the result of an attempt to uploadThis is backwards compatible and makes no changes to the public API.