rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

fix: Stop using PYTHONPATH to set up sys.path

Open philsc opened this issue 1 year ago • 2 comments

This patch is an experiment for setting up sys.path inside the final Python process instead of letting the runtime do it via PYTHONPATH.

The motivation here is to address these 2 issues:

  • #382
  • #792

Try it with:

$ bazel run //tools:wheelmaker -- --help

Look at the generated files.

philsc avatar Feb 27 '24 06:02 philsc

Do you think it would help #1174 as well?

aignas avatar Mar 01 '24 01:03 aignas

Do you think it would help #1174 as well?

Not as-is, no. But I think it could. In the python/private/common/entrypoint.tmpl.py file we could add an import hook that tries to resolve imports with the repository name.

philsc avatar Mar 11 '24 06:03 philsc

This PR was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"

github-actions[bot] avatar Jul 14 '24 22:07 github-actions[bot]