|
42 | 42 | # Sample apps that need an in-app virtual environment for the E2E suite. |
43 | 43 | E2E_APPS = ("v1_style", "dtask_style") |
44 | 44 | PYTHON_VERSIONS = ("3.10", "3.11", "3.12", "3.13", "3.14") |
| 45 | +DEFAULT_CI_PYTHON = "3.14" |
45 | 46 |
|
46 | 47 |
|
47 | 48 | def _install_packages(session: nox.Session, editable: bool = False) -> None: |
@@ -139,16 +140,20 @@ def _start_azurite( |
139 | 140 | "Azurite is required for this session. Install it with " |
140 | 141 | "`npm install -g azurite` and run the session again.") |
141 | 142 |
|
142 | | - command = [executable, *arguments] |
| 143 | + command = [ |
| 144 | + executable, |
| 145 | + *arguments, |
| 146 | + "--location", |
| 147 | + session.create_tmp(), |
| 148 | + ] |
143 | 149 | if os.name == "nt" and executable.endswith(".ps1"): |
144 | 150 | command = [ |
145 | 151 | "powershell", |
146 | 152 | "-NoProfile", |
147 | 153 | "-ExecutionPolicy", |
148 | 154 | "Bypass", |
149 | 155 | "-File", |
150 | | - executable, |
151 | | - *arguments, |
| 156 | + *command, |
152 | 157 | ] |
153 | 158 |
|
154 | 159 | process = subprocess.Popen(command) |
@@ -399,11 +404,23 @@ def functions_e2e(session: nox.Session) -> None: |
399 | 404 |
|
400 | 405 | @nox.session(python=False) |
401 | 406 | def ci(session: nox.Session) -> None: |
402 | | - """Run all lint, type, unit, emulator, and end-to-end CI-equivalent checks.""" |
| 407 | + """Run the representative local lint, type, test, emulator, and E2E checks. |
| 408 | +
|
| 409 | + Pass a core/Azure Managed Python version after ``--`` to override the |
| 410 | + default representative version, for example ``nox -s ci -- 3.10``. |
| 411 | + """ |
| 412 | + if len(session.posargs) > 1 or ( |
| 413 | + session.posargs and session.posargs[0] not in PYTHON_VERSIONS |
| 414 | + ): |
| 415 | + session.error( |
| 416 | + "Pass at most one supported Python version after `--`: " |
| 417 | + f"{', '.join(PYTHON_VERSIONS)}.") |
| 418 | + |
| 419 | + python_version = session.posargs[0] if session.posargs else DEFAULT_CI_PYTHON |
403 | 420 | session.notify("lint") |
404 | 421 | session.notify("typecheck_core") |
405 | 422 | session.notify("typecheck_functions") |
406 | | - session.notify("core_tests") |
407 | | - session.notify("azuremanaged_tests") |
408 | | - session.notify("functions_unit") |
| 423 | + session.notify(f"core_tests-{python_version}") |
| 424 | + session.notify(f"azuremanaged_tests-{python_version}") |
| 425 | + session.notify("functions_unit-3.14") |
409 | 426 | session.notify("functions_e2e") |
0 commit comments