Skip to content

Commit 6a90152

Browse files
Merge pull request #52 from renan-r-santos/fix-blocking-subprocess-call
Fix: check for OS before choosing blocking version of subprocess.run
2 parents 2bb0060 + 28d9d61 commit 6a90152

File tree

5 files changed

+585
-509
lines changed

5 files changed

+585
-509
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
15-
pixi-version: ['0.30.0', '0.41.4']
15+
pixi-version: ['0.30.0', '0.45.0']
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Checkout repo

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pixi-kernel",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"description": "Jupyter kernels using Pixi for reproducible notebooks.",
55
"keywords": [
66
"kernel",

pixi_kernel/async_subprocess.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
import platform
12
import subprocess
2-
from asyncio import SelectorEventLoop, create_subprocess_exec, get_event_loop
3+
from asyncio import SelectorEventLoop, create_subprocess_exec, get_running_loop
34
from asyncio.subprocess import PIPE
45
from typing import Any
56

67

78
async def subprocess_exec(program: str, *args: str, **kwargs: Any) -> tuple[int, str, str]:
89
# The SelectorEventLoop does not support asyncio.subprocess
910
# https://github.com/renan-r-santos/pixi-kernel/issues/39
10-
if isinstance(get_event_loop(), SelectorEventLoop):
11+
if isinstance(get_running_loop(), SelectorEventLoop) and platform.system() == "Windows":
1112
result = subprocess.run([program, *args], capture_output=True, text=True, **kwargs) # noqa: ASYNC221
1213
return result.returncode, result.stdout, result.stderr
1314
else:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pixi-kernel"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
description = "Jupyter kernels using Pixi for reproducible notebooks"
55
license = { text = "MIT" }
66
authors = [

0 commit comments

Comments
 (0)