-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix: reload and merge easy-install pth file before save #3128
Fix: reload and merge easy-install pth file before save #3128
Conversation
50acef2
to
e849104
Compare
Hi @gst thank you very much for the PR! Any help is very appreciated. I probably lack the knowledge to properly review your PR, so I will leave that for the other maintainers. |
Hi @abravalheri I have got this : # CUTTED that I added in I'm not used to run setuptools tests I guess ;) |
Hi @gst. Something that is useful to run is If you have |
Could you add a little comment/note in this test explaining in which scenario the
(That is a way of signing for people changing this file in the future why this test should not be removed). |
(By the way, thank you very much for working in a test case, that really helps in the PR and to better understand the problem). |
That's my pleasure :) but I cannot get the test to succeed still.. I'm doube checking.. but it's not easy with tox I find. any direct |
That is a tricky question. I usually rely on pytest's ability to open pdb on failure, e.g.: tox -- -p no:cov -x --pdb setuptools/tests/test_easy_install.py If you want to avoid pytest -p no:cov -x --pdb setuptools/tests/test_easy_install.py (I never tested this way of running the tests though). |
e849104
to
d229f8c
Compare
voila. could make it to succeed. FWIW I could use : pytest -p no:cov -vs -x --pdb setuptools/tests/test_easy_install.py::TestPTHFileWriter::test_many_pth_distributions_merge_together after having uninstalled pytest-flake8 and flake8. |
3dd9371
to
2efee66
Compare
2efee66
to
d21e01a
Compare
Hi, any comment on the test case and the change/fix(or enhancement?) ? |
Hi @gst, I will have a look on the test case, thank you very much! Unfortunately, I will have to leave further review to other maintainers because this topic is a bit out of the areas of setuptools I am familiar with. I you need these changes in your workflow urgently, there are a few workarounds that you can use while this PR gets reviewed. For example, in your [build-system]
requires = [
"setuptools @ git+https://github.com/gst/setuptools@fix-easy-install-pth-file-not-reloaded-before-save",
...
] |
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.
Thank you very much @gst for working on this!
I added just some general code review comments. I am unable assess how this change might impact on existing code, or if there is any undesired side-effect for other use cases that might be caused by this change. So I will leave this part of the review for other maintainers.
Please correct me here if I am wrong: I am assuming this change is necessary to make editable installs (i.e. pip install -e
) work correctly, right? (In general we want to avoid changing easy_install
since it is deprecated, unless it is necessary to make other parts of setuptools work correctly).
Finally, I would like to say that my comments are just suggestions and I am aware that people have different coding styles :)
I also understand perfectly if you want to wait until you have feedback from other maintainers before spending more energy and add other changes to this PR (to make sure your efforts are not going to be wasted).
Currently, the CI seems to be unhappy. I recommend always running Of course you just run |
@abravalheri I made the first changes you proposed. I ran tox locally and everything succeed but 2 test cases .. not related. I'm waiting anymore comments or review. |
Thank you very much @gst, that is really appreciated. Just a minor comment: |
@abravalheri that's flaked now ;) |
Overall, this change looks reasonable. I'm sorry the pytest-flake8 reporting is so bad (due to tholo/pytest-flake8#81). I'll try to review this soon. |
Well, this is annoying - I replaced
But the errors are all for lines shorter than 88 characters, which is the declared limit. I'll need to track down this discrepancy. |
I found tholo/pytest-flake8#22, which shows some users having difficulty with pytest-flake8 getting it to honor the settings, so maybe that's what's happening. |
should I do something to help to make it pass ? |
Nah. I'll deal with that separately. |
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.
🥰🥰🥰
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.
💜💙❤️
a85759c
to
93ce5a0
Compare
ping |
3601d65
to
90f63de
Compare
90f63de
to
b60b007
Compare
Summary of changes
Refactor
PthDistributions._load
into/with a second_load_raw
. Re-use_load
fromPthDistributions.save()
.and thus use that in save() to reload/refresh the file content before saving. and merge the eventual new found items.
Closes #3126