ali5h / rules_pip

pip package rules for bazel that are fast (incremental fetch), support different python versions and work with all kinds of packages (i.e. packages with namespaces)
MIT License
60 stars 23 forks source link

don't use backslashes in Python interpreter path on Windows #50

Closed dae closed 3 years ago

dae commented 3 years ago

When passing in a runtime to pip_import() that is symlinked to a Windows path, eg:

    python_runtime = "@python//:python",

which is symlinked to c:\python\python.exe

then the backslash-containing path is included verbatim in the generated repositories.bzl file. When Bazel tries to read the file, it complains about unrecognized control characters. Converting the backslashes to forward slashes fixes the error, and allows the build to proceed.

ali5h commented 3 years ago

thank you! I never tried running this on Windows. Tests are failing because of formatting issue. Would you run black on the changed file?

dae commented 3 years ago

Done, but the issue wasn't with my change :-)