Skip to content
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

pip install path remap #866

Merged

Conversation

j0yu
Copy link
Contributor

@j0yu j0yu commented Mar 22, 2020

Closes #861
Closes #863

New configuration setting to allow people to map and configure rez-pip --install of unknown RECORD paths.

For example, for #861, a new entry like so can be added to capture and re-map and move all ../../* paths that are unknown/not handled by rez-pip to just live under the root rez package installation like so:

# Inside rezconfig.py...
pip_install_remaps = [

    # ...add these before the end

    # # Fix for greenlet in https://github.com/nerdvegas/rez/issues/861
    # Path in record          | pip installed to    | copy to rez destination
    # ------------------------|---------------------|--------------------------
    # usr/local/*             | *                   | python/*
    {
        "record_path": r"(.*){sep}usr{sep}local{sep}(.*)",
        "pip_install": r"\1{sep}usr{sep}local{sep}\2",
        "rez_install": r"\2",
    },

    # # Fix for Qt.py in https://github.com/nerdvegas/rez/issues/861
    # Path in record          | pip installed to    | copy to rez destination
    # ------------------------|---------------------|--------------------------
    # ../../NOT PARDIR        | *                   | *
    {
        "record_path": r"^{p}{s}{p}{s}(?!{p})(.*)",
        "pip_install": r"\1",
        "rez_install": r"\1",
    },
]

@smaragden, want to give these a test?


Added

  • rez.config.PipInstallRemaps setting to extend validate to perform token substitutions for...
  • ...new rez.rezconfig.pip_install_remaps setting

Changed

  • More detailed error message for unknown source file
  • Tidied imports in rez.pip

@j0yu j0yu changed the title Feature pip path remap pip install path remap Mar 22, 2020
@zachlewis
Copy link
Contributor

Thanks @j0yu, I think this is pretty effective. The error message with the detailed instructions is really helpful, and the tokens are quite nice. This helped me rez-pip install ipykernel, which was having similar trouble with stuff in '../../share/*'

@nerdvegas nerdvegas merged commit 8d61fcd into AcademySoftwareFoundation:master Mar 31, 2020
@j0yu j0yu deleted the feature-pip-path-remap branch March 31, 2020 09:15
@nerdvegas
Copy link
Contributor

Real clean @j0yu cheers,
A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rez-pip - no case for ../../include/... file
3 participants