-
Notifications
You must be signed in to change notification settings - Fork 3k
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 a testing case for a future check integrity flag #8633
base: main
Are you sure you want to change the base?
Conversation
This commit adds a testing case for issue pypa#8579
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
While the feature is not fully developed, this test is expected to fail Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
@fbidu for CIs to pass, you also need to |
|
||
@pytest.mark.xfail( | ||
reason='Not yet implemented: https://github.com/pypa/pip/pull/8633', | ||
strict=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add raises=
arg here indicating what sort of exception is currently expected to happen?
I guess it's some kind of a subprocess error, right?
reason='Not yet implemented: https://github.com/pypa/pip/pull/8633', | ||
strict=True, | ||
) | ||
def test_check_integrity_errors_on_missing_files(data, script, tmpdir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, this is a negative test. It's probably reasonable to add a positive test too (for when the integrity is fine)
@pradyunsg WDYT? |
@fbidu I think you'll need to try implementing the feature because just a test case for something that does not exist won't get approvals from the pip maintainers. |
well, it makes sense. I'm a total newbie on this code base but I could give it a try! I think it would be better to go back to #8579 and discuss it a little bit further because right now we don't have much definition about what we want. What do you think, @webknjaz @pradyunsg |
I could even expand my very informal research on how other package managers handle this feature - if they handle at all - so that we can have more basis to discuss this |
This test case looks great @fbidu! However, as @webknjaz noted, I'm not sure adding in a test for a feature that hasn't been implemented I'm not keen on doing that given that our tests already take... an hour in CI. :) I think looking at how other package managers handle this sort of thing (as well as, the issue about pip being able to overwrite files - on mobile, can't look it up right now) would be great. As for whether we make this a subcommand or a flag, I'm not 100% sure myself. The easy answer is probably make it a flag (i.e. opt-in) because there's less possibility of disruption. OTOH, I think this won't be very disruptive, do making it the default with an "opt-out" would also work. |
I'd say just implement it with a flag and change if decided during the review stage. Swapping between flag vs command shouldn't be too much burden. |
To be clear, I'm saying we'd pick one of (a) and (b), for "enabled / not enabled": (a) |
I'd prefer (a). I'd assume such a check would both check that files existed and confirm they matched the hashes in If we want to only check file existence, then I'm less worried about performance, but I would say that it shouldn't be called "check integrity" as that implies (to me at least) a stronger check than we'd be doing. |
@pfmoore: how about |
Short version: We have no use case for hash checking, and #8579 said the feature may want to be optional as it's potentially costly. So my view is we should have a flag to enable this check, but as I said above, I don't like the term "integrity" for it because it implies a hash check which we're not doing. The bit below the break is what I wrote before I realised we'd digressed into talking about hash checks that no-one had asked for. Feel free to ignore it. Probably a good illustration of why we should be careful to focus on actual use cases 🙂 I don't have much use for Basically, I don't think we should be making up answers here, we need proper use cases. The original use case for ¹ Even longer-term it may remain valid, because of flags like |
Hello all! Well, as @pfmoore pointed out, the original issue asked for optional checking of the files that should be present. I think the optional bit is important, checking for all the files in a big package is probably going to be costly. That said, throwing a hash for integrity checking in the mix makes sense to me. This could be implemented as an yet another optional flag or as a 'second-pass' mechanism - first we check if all the files are present, halt if they are not and only if all the files are there, we hash them. But this is just something I made up right now. As for checking how our package-manager neighbours behave is something I find it interesting and my help us gauge how - and if - this issue is handled by them. I did a short field test with Yarn, Cargo, Mix and NPM when I started this, I can now take a closer look at them and bring the results. I'm considering:
What do you all think? |
@fbidu this sounds good. I haven't heard of Mix, though. Did you mean Nix? |
It is Elixir's Mix. I have played around with Elixir for the last few months, building micro-services at my current company. It is a very interesting language and Mix provides a nice "developer ergonomics", if that's a thing |
Why you guys didn't merge this pull request. |
Because it is not complete in itself. I created this as a means to test a future implementation of the linked issue, but we decided it does not make much sense to add a test for a feature we are not implementing right now. That said, @Yuvraj786, thanks for reminding me of this. This PR flew out of my attention but I'll get back to it |
@fbidu I think it might be a good idea to rebase this PR to see what's changed over time. |
@@ -10,6 +10,7 @@ __pycache__/ | |||
*.eggs | |||
*.egg-info/ | |||
MANIFEST | |||
pip-wheel-metadata/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can drop this now, FWIW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip-wheel-metadata/ |
@fbidu do you think you could rebase this effort? |
Hello all!
I was working on the EuroPython Packaging Sprint today and found issue #8579.
While the discussion is still young, I tried to come up with a failing test case for what the issue proposes.
Given this is my first attempt at working with pip code itself, I'm not at all familiar with the codebase and there are probably cleaner ways to achieve my goal. Also, the semantics of this new checking - a flag? a subcommand? - must be discussed. I simply guessed a
check --integrity
. What I tried to do was:check --integrity
Feedback is very much appreciated!
Thanks