-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Hg / pip compatibility #729
Conversation
@@ -2,5 +2,6 @@ | |||
requires = [ | |||
"setuptools>=45", | |||
"packaging>=20.0", | |||
"typing_extensions", |
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.
I had to add this to avoid a bug in the installation of setuptools_scm (Python 3.9).
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.
is this python 3.9 only or python 3.9+?
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.
I tried only with 3.9 and I had an import error without this line. However, I don't understand well how we are supposed to use typing_extensions, since "The typing_extensions module serves two related purposes". I don't know if it is also useful for python > 3.9. It seems that it depends on what exactly is used in the code.
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.
@paugier ah, its my fault - i missed to make the _t import in hg/hg_git support optional, if you like you can replicate what i did for git,
The first commit is actually only about improving debug logging. |
1269bcc
to
bfcd8e1
Compare
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.
I like what I see there
A good opt out for the env cleanup is unclear to me as well
I think it's a good idea to keep pip and git cleanup in separate functions
src/setuptools_scm/utils.py
Outdated
trace("cmd", repr(cmd)) | ||
trace(" in", cwd) | ||
if isinstance(cmd, list): | ||
cmd_4_trace = " ".join(cmd) |
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 to use shlex quoting to avoid commands one can't safely run copy pasted
src/setuptools_scm/utils.py
Outdated
if os.name == "posix" and not isinstance(cmd, (list, tuple)): | ||
cmd = shlex.split(cmd) | ||
|
||
res = _run(cmd, cwd) | ||
if res.stdout: | ||
trace("out", repr(res.stdout)) | ||
trace("out:\n", res.stdout) |
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.
Ideally those add a indent level
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.
looks good to me thanks
anything you want to add, or should i aim for a swift release?
I open this PR to discuss about these changes that would avoid the problem describe in pypa/pip#10635.
This is a now a draft implementation of solution 2 described in pypa/pip#10635 (comment).
I see that there are already a function to clean up the environment of Git specific environment variables. A possibility would be to merge my new function
avoid_pip_isolation
andno_git_env
to one unique function cleaning the environment to call the programs.I wonder if it would be necessary to have a mechanism to deactivate this cleaning?