FIX: Unset GIT_DIR environment variable while retrieving version information from git#280
Conversation
e13f169 to
16540cd
Compare
a7c822b to
875fa45
Compare
3a176bd to
faf3122
Compare
faf3122 to
725ea8d
Compare
…R` from the environment variables
mathijsvdv
left a comment
There was a problem hiding this comment.
I have reviewed your code and added the pull request effigies#1 with my suggested changes. Have a look!
|
I tried this PR in the context of the functionality were you identified the previous fix for the interference of It seems with this PR the The relevant change seems to be this one: - out, rc = run_command(GITS, ["--git-dir=.git", "rev-parse", "--git-dir"], cwd=root,
- hide_stderr=True)
+ # GIT_DIR can interfere with correct operation of Versioneer.
+ # It may be intended to be passed to the Versioneer-versioned project,
+ # but that should not change where we get our version from.
+ os.environ.pop("GIT_DIR", None)
+
+ _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root,
+ hide_stderr=True)(from diff'ing the effective change to that DataLad extension package's code after updating versioneer in it). It would be great if the environment modification could be constraint to versioneer itself, rather than effecting the entire process. Thx! |
|
Did you apply the mock as well? That is intended to protect the environment from being changed downstream. |
|
I did not do any custom editing. I only reinstalled versioneer in the project, assuming that would be enough. |
|
Hmm. Okay. Let me try again... |
bfdf761 to
156afd1
Compare
|
Missed @mathijsvdv's PR. Seems like a better approach. |
|
Okay, Windows tests are passing, which was the big hold up before. @mih Can you try again with these updates? |
|
Hey @mih, have you had a chance to check this? If we fail again, could you share a reproduction? |
|
Sorry for the delay. I was now able to verify that things are splendid now! Thx much for taking the time to wait for the feedback! Looking forward to the coming release. |
|
Thanks for testing! Will plan to release today. |
Closes #279.
Unclear whether there should be a config variable to allow for different.gitlocations. May not be worth the complexity to cover if the edge case is never actually hit.