Check if venv Python version matches current Python. Binary dependencies (pyzmq, msgspec) aren't cross-version compatible, so the venv must use the same Python major.minor version. Args: venv_python: Path to the venv's Python interpreter. Returns: True if versions
(venv_python: str)
| 173 | |
| 174 | |
| 175 | def check_python_version_compatibility(venv_python: str) -> bool: |
| 176 | """Check if venv Python version matches current Python. |
| 177 | |
| 178 | Binary dependencies (pyzmq, msgspec) aren't cross-version compatible, |
| 179 | so the venv must use the same Python major.minor version. |
| 180 | |
| 181 | Args: |
| 182 | venv_python: Path to the venv's Python interpreter. |
| 183 | |
| 184 | Returns: |
| 185 | True if versions match, False otherwise. |
| 186 | """ |
| 187 | result = subprocess.run( |
| 188 | [ |
| 189 | venv_python, |
| 190 | "-c", |
| 191 | "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')", |
| 192 | ], |
| 193 | capture_output=True, |
| 194 | text=True, |
| 195 | ) |
| 196 | venv_version = result.stdout.strip() |
| 197 | current_version = f"{sys.version_info.major}.{sys.version_info.minor}" |
| 198 | |
| 199 | return venv_version == current_version |
| 200 | |
| 201 | |
| 202 | def install_marimo_into_venv(venv_python: str) -> None: |
searching dependent graphs…