-
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
Fix pip freeze not showing correct entry for mercurial packages that use subdirectories. #7072
Conversation
…so it porperly detects that subdirectories are under mercurial control.
…t a setup.py in a repo subdirectory.
…her the source or setup.py is located in a subdirectory of the repo root.
- fixed lint errors.
…t installed, causing errors to be logged.
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
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.
Hello! Thanks for the contribution.
This looks like a good approach, I have a few minor comments.
…rial`, adding `get_repo_root_dir()` for the vcs specific code. - Reverted behaviour of `Git.controls_location()` and `Mercurial.controls_location()` to call the vcs command if the base `VersionControl.controls_location()` doesn't detect the vcs directory. - Added `log_failed_cmd` argument `VcsSupport.run_command()` to allow vcs commands to be tried without logging errors if they aren't present. - Corrected indentation. - Removed `expect_stderr=True` in `test_freeze_mercurial_clone_srcdir` as its not required.
…`Git.get_subdirectory()` and `Mercurial.get_subdirectory()`. Added `find_path_to_setup_from_repo_root()` function to perform the common parts of `get_subdirectory()`.
It looks like LF got converted to CRLF on the latest commit. |
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.
Thanks for your patience! I think this is coming together nicely. Just two more comments.
…n optimization that belongs in another PR.
only got found after reverting `VersionControl.controls_location()`
This has apparently conflicts with master: could you rebase it ? |
@xavfernandez I could merge this in, so I did. Lemme know if I did something wrong? |
Strange, Github wasn't letting me merge it 🤔 |
Brilliant! Big thanks to @chrahunt for your eagle eyes and patience on this. |
fixes #7071
Changes are based on functionality that exists in the Git implementation, copied and modified for Mercurial.
Also changes the behavior of
VcsSupport.controls_location()
which now traverses up the filesystem looking for an appropriate vcs directory (.git, .hg etc) before invoking the applicable vcs command. This solves the problem of errors being printed to stderr due to vcs commands being run when no such vcs is installed. i.e. installing as editable from mercurial would causepip freeze
to callgit
and print an error ifgit
is not installed.