-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Consider using virtualenv for managing upstream Python dependencies #8392
Comments
I am pretty much on record with hating reinventing |
(For myself) A tiny breadcrumb for patching local PIP packages: UPDATE: I believe I understand Robin's comments more now about |
On the subject of needing |
I am certainly not in favor of patching packages. |
Posted responses about package patching in #8116. |
I had seen some discussions on Slack about I'm not sure if we've considered it before, but there do seem to be some mechanisms to enable having a checked-in (or, I would assume, a generated) Python runtime, This could also pave the way towards containing support Python2+3 per #8352, most likely via a configuration switch. |
I am not generally as worried about making our development and test environment work. I am most worried about how the installed pydrake interacts with the rest of the python universe. I think the clearest way to look at this question (and the wider python2/3 and forked-dependencies questions) is to first explain what the installed experience looks like, and then from there work out what the development environment looks like. |
Given that I am strongly against patching packages, I am not sure a (My personal opinion is that whether to use a |
Ran into another case of desiring this: Better FYI @RussTedrake |
A motivating use case is on the rise -- Homebrew seems incapable of making a Python minor version transition without breaking all of non-first-party Python libraries as they go (e.g., recently It's probable that Drake on macOS should only use the Python interpreter from Homebrew, and for other Python ecosystem dependencies we use |
Update: I have somewhat of a prototype of this now in TRI Anzu. After we gain some experience with that over the next week or two, I'll dump a snapshot of the code into this ticket, along with some more specific goals, and we can take it from there. |
For kitware:
Here's the sample Anzu code to get started: anzu-snippets.zip. Notes:
This should at least be able to supplant the For |
I have no idea what an "anzu" is. I'm guessing all instances of that should be replaced with "drake"? If I do that, I can run the scripts, but it isn't clear how this is supposed to be actually consumed by other Drake bits that need the venv. Also, if this is intended to replace what's currently |
It's the codename for TRI's internal git repository.
Yes.
That's this part:
The way to check is to find a test that needs something from pip in order to succeed, and then iterate to get that working.
Probably not. Users who are installing Drake from source (e.g. via CMake) should only by default need to pay the download cost of the non-testonly dependencies. The |
One update from f2f: the unique challenge of "default" vs "testonly" (versus what Anzu does) is to have |
Okay, this one is puzzling:
It seems like the correct patch (ignore the likely style error) is: diff --git a/tools/workspace/styleguide/package.BUILD.bazel b/tools/workspace/styleguide/package.BUILD.bazel
index 03b5770120..8001a7291d 100644
--- a/tools/workspace/styleguide/package.BUILD.bazel
+++ b/tools/workspace/styleguide/package.BUILD.bazel
@@ -22,6 +22,7 @@ py_binary(
python_version = "PY3",
srcs_version = "PY3",
visibility = [],
+ deps = ["@venv"],
)
alias( ...but I'm still getting the above error. |
Another issue... since we're only doing macOS for now, just adding |
It would be simpler for me if you could post all questions using Reviewable, on the pull request, so we can discuss in situ. |
Per @rdeits's comment in #8352:
My 2 cents:
virtualenv
does sound like a good option.I'm not sure if I'm a fan of our present re-inventing of
pip
in Bazel; understandably, it's for reproducibility and keeping most of the dependencies in Bazel, but seems like it may be brittle when the wheels are more complex or have more comprehensive dependencies (e.g.numpy
). We can always teach Bazel to scan and incorporate the upstream Python dependencies forhermetic-nessdeterminism with remote caching.Additionally, if the custom-dtype solution for #8116 ends up working, it would greatly smooth out having an optionally patched version of
numpy
for memory management.That being said,
virtualenv
is additional tweaking on the environment that does have a bit of a funny (and semi-invasive) smell to it. However, if it reduces headaches (e.g. if we can figure out how to teachnlopt
from Homebrew to not screw around with / conflict withpip
packgaes), I'm all for it.@jwnimmer-tri @jamiesnape Can I ask what your opinions are?
EDIT: Working with
virtualenv
will be a workflow similar to what we may want with ROS workspaces.EDIT 2: For now marking priority as
medium
. Can update if needed.\cc @calderpg-tri
The text was updated successfully, but these errors were encountered: