Skip to content

The vendored ruamel.yaml is imported under the namespace 'external'#9702

Closed
alalazo wants to merge 1 commit intospack:developfrom
epfl-scitas:fixes/ruamel_yaml_with_extra_namespace
Closed

The vendored ruamel.yaml is imported under the namespace 'external'#9702
alalazo wants to merge 1 commit intospack:developfrom
epfl-scitas:fixes/ruamel_yaml_with_extra_namespace

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Nov 1, 2018

fixes #9619
fixes #9206

closes #9261 (alternative solution to the same issue)
closes #9725 (alternative solution to the same issue)

ruamel.yaml generates a .pth file when installed via pip that has the effect of always preferring the version of this package installed at site scope (effectively preventing us from vendoring it). Here we work around the issue by putting our vendored version of the package under an additional namespace.

Note that we do this only for ruamel.yaml rather than consistently for every vendored dependency to avoid extensive changes in their source code, see #9206 (comment)

fixes spack#9206

ruamel.yaml generates a .pth file when installed via pip that has the
effect of always preferring the version of this package installed at
site scope (effectively preventing us from vendoring it).

Here we work around the issue by putting our vendored version of the
package under an additional namespace.
@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Nov 2, 2018

@alalazo: can we really not do this using sys.modules? I'd rather not have to patch the whole package or make major modifications to support this, but this might be the best way if sys.modules is not possible.

Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above -- I'd really rather do this by tweaking sys.modules, but if that isn't possible this may have to do.

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Nov 2, 2018

@tgamblin I'll try tweaking sys.modules in the next few days and submit a PR if I succeed.

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Nov 2, 2018

@alalazo: thanks! Sorry if I was misleading -- I thought I mentioned this earlier but @scheibelp pointed out I probably should've been more emphatic!

@alalazo alalazo deleted the fixes/ruamel_yaml_with_extra_namespace branch November 7, 2018 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

broken-develop bug Something isn't working hotfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python RecursionError when sourcing setup-env.sh Debian ruamel.yaml 0.15: Infinite Recoursion On Setup

2 participants