ansible-lint: Unset PYTHONPATH in wrapper #251948
Closed
wfdewith wants to merge 2 commits intoNixOS:masterfrom
Closed
ansible-lint: Unset PYTHONPATH in wrapper #251948wfdewith wants to merge 2 commits intoNixOS:masterfrom
wfdewith wants to merge 2 commits intoNixOS:masterfrom
Conversation
There seems to be a weird interaction between PYTHONPATH and the explicitly set Python search paths with site.addsitedir. Since ruamel.yaml updated to 0.17.32, ansible-lint errors with the following error: ModuleNotFoundError: No module named 'ruamel.yaml' By unsetting the PYTHONPATH, this mitigates the issue, though a more thorough fix is still needed.
Contributor
|
I'm sorry that this causes you pain. It's only on |
Member
Author
|
Oh, that's great! I'll try it, and if it works I will change this PR to only include the update. |
Member
Author
|
Closed in favor of #252021 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Since the update of
ruamel.yamlto 0.17.32 (5330b05),ansible-lintis broken with the following error, when ran from anix-shell:I did some investigation, and it appears to have something to do with different versions of Python namespaces. I'm not very familiar with the Python packaging and module loading process, so that was as far as I got. @tjni has been working on this (see here), so I hope that he understands the problem better than I do. In any case, I found that unsetting the
PYTHONPATHenvironment variable fixes the problem foransible-lintso this PR does exactly that.I think a better fix needs to be found in the future, but for now, this fix at least mitigates the issue.
In addition, since an update for
ansible-lintwas released in the meantime, this PR includes a version bump.Things done
For non-Linux: Issandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)(Package updates) Added a release notes entry if the change is major or breaking(Module updates) Added a release notes entry if the change is significant(Module addition) Added a release notes entry if adding a new NixOS module