Skip to content

Conversation

@mattem
Copy link
Collaborator

@mattem mattem commented May 18, 2022

Fixes #21

$ which python3
/opt/homebrew/bin/python3

$ python3 --version
Python 3.9.10

$ bazel run --override_repository rules_py=/Users/matt/Documents/workspace/rules_py ipython
INFO: Analyzed target //:ipython (26 packages loaded, 95 targets configured).
INFO: Found 1 target...
Target //:ipython up-to-date:
  bazel-bin/ipython
INFO: Elapsed time: 1.458s, Critical Path: 1.33s
INFO: 3 processes: 2 internal, 1 darwin-sandbox.
INFO: Build completed successfully, 3 total actions
INFO: Build completed successfully, 3 total actions

Python: /private/var/tmp/_bazel_matt/b28310042610550fd4cf1ffc282c1f7a/execroot/rules_py_example/bazel-out/darwin_arm64-fastbuild/bin/ipython.runfiles/ipython.venv/bin/python_real
version: 3.9.10 (main, Jan 15 2022, 11:40:53)
[Clang 13.0.0 (clang-1300.0.29.3)]
version info: sys.version_info(major=3, minor=9, micro=10, releaselevel='final', serial=0)
cwd: /private/var/tmp/_bazel_matt/b28310042610550fd4cf1ffc282c1f7a/execroot/rules_py_example/bazel-out/darwin_arm64-fastbuild/bin/ipython.runfiles/rules_py_example
site-packages folder: ['/private/var/tmp/_bazel_matt/b28310042610550fd4cf1ffc282c1f7a/execroot/rules_py_example/bazel-out/darwin_arm64-fastbuild/bin/ipython.runfiles/ipython.venv/lib/python3.9/site-packages']
VIRTUAL_ENV=/private/var/tmp/_bazel_matt/b28310042610550fd4cf1ffc282c1f7a/execroot/rules_py_example/bazel-out/darwin_arm64-fastbuild/bin/ipython.runfiles/ipython.venv
Python 3.9.10 (main, Jan 15 2022, 11:40:53)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.3.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]:

@mattem mattem requested a review from alexeagle May 18, 2022 00:49
Copy link
Member

@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.

Does this necessarily belong in rules_py? Should rules_python have such a thing?

)

def register_autodetecting_python_toolchain(name):
"""Registers an autodecting Python toolchain that can be used with rules_py.
Copy link
Member

Choose a reason for hiding this comment

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

What does auto detecting mean? Should point out its non hermetic but works better with c/c++ wheel builds

@mattem mattem force-pushed the feat/autodecting_toolchain branch from b4ccd5d to 61b3b54 Compare May 20, 2022 15:33
@mattem
Copy link
Collaborator Author

mattem commented May 20, 2022

Does this necessarily belong in rules_py? Should rules_python have such a thing?

I don't think this should be part of rules_python, the venv handling is specific to rules_py.

@mattem mattem merged commit 7b5b88f into main May 20, 2022
@mattem mattem deleted the feat/autodecting_toolchain branch June 2, 2022 02:07
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.

Autodetecting toolchain causes call cycle

3 participants