Skip to content

Commit

Permalink
Use venv for Python dependencies (macOS)
Browse files Browse the repository at this point in the history
Create a series of scripts to set up and manage a Python virtual
environment that can be used to build (and test) Drake. Remove Python
packages from macOS setup. Add dependencies to the virtual environment
as needed.
  • Loading branch information
mwoehlke-kitware committed Aug 23, 2024
1 parent c1cabbb commit 63543b1
Show file tree
Hide file tree
Showing 22 changed files with 995 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@

# User-specified configuration
/user.bazelrc
/requirements.txt
2 changes: 2 additions & 0 deletions bindings/pydrake/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ drake_py_library(
],
deps = [
"//bindings/pydrake/common:_init_py",
"@venv",
],
)

Expand Down Expand Up @@ -399,6 +400,7 @@ drake_py_binary(
":all_py",
"@mypy_internal//:mypy",
"@stable_baselines3_internal//:stable_baselines3",
"@venv",
],
)

Expand Down
26 changes: 26 additions & 0 deletions requirements-base.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# PyPI packages to make available as Drake's bazel `@venv` repository.

# WARNING: If you change this file, then it is up to you to regenerate
# the "locked" requirements.txt file via:
#
# tools/workspace/venv/upgrade

# Packages that we are happy to take the most recent version any time we
# update requirements. The versions of these packages are "locked" in the
# requirements.txt file and change any time it updates. This should be
# the overwhelming majority of our requirements.

ipython
ipywidgets
matplotlib
notebook
numpy < 2.1
Pillow
pydot
PyYAML

# The following are constrained or pinned version of packages.

# Keep `black` and `isort` fixed until we want to explicitly update.
black == 22.10.0
isort == 5.1.3
18 changes: 18 additions & 0 deletions requirements-test.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# PyPI packages to make available as Drake's bazel `@venv` repository.

# WARNING: If you change this file, then it is up to you to regenerate
# the "locked" requirements.txt file via:
#
# tools/workspace/venv/upgrade

# Packages that we are happy to take the most recent version any time we
# update requirements. The versions of these packages are "locked" in the
# requirements.txt file and change any time it updates. This should be
# the overwhelming majority of our requirements.

flask
six
u-msgpack-python
websockets

# The following are constrained or pinned version of packages.
Loading

0 comments on commit 63543b1

Please sign in to comment.