Skip to content

pip_parse: Fix when using a python wrapper script#505

Merged
alexeagle merged 2 commits intobazel-contrib:mainfrom
plule-ansys:pip_parse_interpreter
Sep 12, 2021
Merged

pip_parse: Fix when using a python wrapper script#505
alexeagle merged 2 commits intobazel-contrib:mainfrom
plule-ansys:pip_parse_interpreter

Conversation

@plule-ansys
Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Does not include precompiled binaries, eg. .par files. See CONTRIBUTING.md for info
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

When using pip_parse with a python wrapper script in python_interpreter or python_interpreter_target, the declared whl_library do not use the wrapper script but directly the underlying python interpreter given by sys.executable.

We use a portable python distribution that needs some environment adaptation in the PATH and LD_LIBRARY_PRELOAD variables to run properly. Calling directly the python interpreter binary fails, so pip_parse itself is successful but the wheels cannot be retrieved.

What is the new behavior?

  • pip_parse now transmits python_interpreter and python_interpreter_target attributes to the whl_library targets
  • whl_library now takes python_interpreter_target in account

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

)
parser.add_argument(
"--python_interpreter_target",
help="Bazel target of the python interpreter. It will take precedence over python_interpreter.",
Copy link
Copy Markdown
Contributor

@hrfuller hrfuller Aug 10, 2021

Choose a reason for hiding this comment

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

Some documentation explaining that this has to be a reference to another external repository would be helpful. To me the name implies that this could be a reference to a target in the current workspace, which wouldn't work unless it was a prebuilt binary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's right thanks, outside of the .bzl this becomes much less obvious, I've updated the documentation. I've not changed the name of the argument to keep it consistent with whl_library/pip_parse though. (sorry for the slow reaction, I was away from computers!).

@thundergolfer
Copy link
Copy Markdown

@hrfuller :bump: this changes looks mergeable 👍

@alexeagle alexeagle force-pushed the pip_parse_interpreter branch from 117d0bf to 0586582 Compare September 12, 2021 22:13
Copy link
Copy Markdown
Contributor

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

Thanks!!

@alexeagle alexeagle merged commit fd43414 into bazel-contrib:main Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants