-
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
Use better temporary files mechanism #7904
Conversation
@siAyush Please don't reference issues in the title of another PR/issue, or in commits; since that can result in unnecessary noise created by GitHub's cross-linking. |
Thanks, @pradyunsg for correcting me, can you please check this PR. |
@siAyush you've closed the PR. Was that intentional? If so, if you could tell us why, that'd be great! |
sorry @pradyunsg its happened by mistake actually I lost the internet connection. |
Hehe, no worries. This looks good to me. /cc @pfmoore for inputs here, in case he has any. |
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.
This needs a rewrite, as it's stopped using open_for_csv
for the output file, and the whole point of open_for_csv
is that it ensures the right open parameters for a file that's being passed to the csv module.
I'm a strong -1 on any approach that doesn't use open_for_csv
- it's very easy to get tricky line ending problems if you get the open parameters wrong, it's an annoying and fiddly cross-platform compatibility issue, and not reusing the function we have that's explicitly designed to get it right seems to me to be a mistake.
I'm not 100% sure there's a need for this PR in any case - certainly adjacent_tmp_file
is a more robust approach, but have we had any actual issues caused by our current approach, or is this simply being done for theoretical reasons?
Sorry for the negative review, but there's more subtlety involved here than is obvious at first glance. I'm not sure I'd have classed this as a "good first issue" because of that. However, thanks @siAyush for picking it up - if you need any additional help or clarification, please ping me.
thanks, @pradyunsg, and @pfmoore (for the reviews) one if my code is right why the test is failing. |
The test is failing with a lint (code style) eror. You can see the specific message by clicking on "Details" next to the failing test and finding the line with the red "X" next to it ("Test with tox"). Click on the line to expand it and you'll see the full test log. The error here is
|
You can also ensure consistent coding style by running |
So I was thinking if previous approach is right. And don't need any modifications as per @pfmoore. |
Thanks, @deveshks for help. |
@pfmoore FTR I opened #7699 following a suggestion by @chrahunt in #7612. This seemed simple enough at the time to warrant the good first issue label (which I have now removed). Apologies if that created trouble to anyone. |
@sbidoul Not at all! I think the idea is sound, but the details are tricky because of the annoying subtleties of handling CSV files. Maybe it shouldn't have been flagged as a "good first issue", but even that depends on whether you want to target someone who knows Python well but is new to pip, or people who are relatively new to Python. @siAyush I think that it might be possible to make the approach you have here work, but it would need a more extensive change than you currently have, as you might need to generalise the underlying code further. That may be more than you're comfortable doing, in which case by all means say so and we can close this PR and leave the original issue for someone else to pick up. But if you want to continue working on this, and feel comfortable doing so, that's absolutely fine - it's a useful improvement so we'd be glad to have your contribution. |
Thanks, @pradyunsg @pfmoore @sbidoul for guiding me and pointing out my mistakes and helping me. I think pip has the best maintainers. |
updated wheel.py