You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/design/venv-strategy.rst
+38-33Lines changed: 38 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,10 @@ This supports a structure like:
36
36
37
37
~/Developer/mongodb/
38
38
├── .venv/ # Base venv (shared across all groups)
39
+
├── projects/
40
+
│ ├── .venv/ # Shared venv for all Django projects
41
+
│ ├── myproject/
42
+
│ └── another_project/
39
43
├── pymongo/
40
44
│ ├── .venv/ # Group-level venv (optional)
41
45
│ ├── mongo-python-driver/
@@ -95,6 +99,18 @@ Run tests using the most specific venv found:
95
99
# Uses repo, group, or base venv — whichever is most specific
96
100
dbx test mongo-python-driver
97
101
102
+
dbx project add
103
+
~~~~~~~~~~~~~~~
104
+
105
+
Django project creation uses a project-specific lookup order:
106
+
107
+
1. ``projects/.venv`` — shared venv for all projects (group level)
108
+
2. ``base_dir/django/.venv`` — django group venv, if it exists
109
+
3. ``base_dir/.venv`` — base venv
110
+
4. Activated venv
111
+
112
+
If no venv is found and ``--install`` is active (the default), one is created automatically at ``projects/.venv`` and Django is bootstrapped into it. See :doc:`wagtail-support` for how this interacts with Wagtail projects.
113
+
98
114
Venv Detection
99
115
--------------
100
116
@@ -121,7 +137,7 @@ Technical Implementation
121
137
Running Commands in Venvs
122
138
~~~~~~~~~~~~~~~~~~~~~~~~~~
123
139
124
-
When ``dbx`` (running in uvx's isolated environment) needs to execute commands in a venv, it cannot use ``source`` or activation scripts in subprocesses. Instead, it must directly invoke the venv's Python executable:
140
+
When ``dbx`` (installed via pipx into an isolated environment) needs to execute commands in a venv, it cannot use ``source`` or activation scripts in subprocesses. Instead, it must directly invoke the venv's Python executable:
125
141
126
142
.. code-block:: python
127
143
@@ -140,46 +156,35 @@ This is because:
140
156
Venv Detection Example
141
157
~~~~~~~~~~~~~~~~~~~~~~
142
158
159
+
The actual ``get_venv_info`` signature includes an optional ``fallback_paths`` list for intermediate group lookups (used by ``dbx project`` commands to check the ``django`` group before falling back to base):
0 commit comments