Skip to content

Commit efdbc61

Browse files
authored
Merge pull request #3 from pollockjj/main
PyIsolate Update: Production-Ready Process Isolation for ComfyUI
2 parents ad64e40 + 41e5778 commit efdbc61

92 files changed

Lines changed: 12154 additions & 4693 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[run]
2+
parallel = True
3+
sigterm = True
4+
source = .
5+
omit =
6+
tests/*
7+
.venv/*
8+
branch = True
9+
10+
[report]
11+
show_missing = True
12+
skip_covered = False

.github/workflows/build-wheels.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: Build Wheels
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
workflow_dispatch:
8+
release:
9+
types: [published]
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: build-wheels-${{ github.workflow }}-${{ github.ref || github.run_id }}
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
name: Build ${{ matrix.os }} py${{ matrix.python-version }}
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 20
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ubuntu-latest, macos-latest, windows-latest]
27+
python-version: ["3.10", "3.11", "3.12"]
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Install build tooling
39+
run: |
40+
python -m pip install --upgrade pip
41+
python -m pip install build
42+
43+
- name: Build wheel and sdist
44+
run: python -m build
45+
46+
- name: Upload build artifacts
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: dist-${{ matrix.os }}-py${{ matrix.python-version }}
50+
path: dist/*
51+
if-no-files-found: error
52+
retention-days: 7
53+
54+
smoke-test:
55+
name: Smoke Test Built Artifacts
56+
runs-on: ubuntu-latest
57+
timeout-minutes: 15
58+
needs: [build]
59+
60+
steps:
61+
- name: Setup Python
62+
uses: actions/setup-python@v5
63+
with:
64+
python-version: "3.11"
65+
66+
- name: Download artifacts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: dist-ubuntu-latest-py3.11
70+
path: artifacts
71+
72+
- name: Install wheel and run smoke test
73+
shell: bash
74+
run: |
75+
python -m venv .venv
76+
source .venv/bin/activate
77+
python -m pip install --upgrade pip
78+
79+
wheel_path="$(find artifacts -type f -name '*.whl' | head -n 1)"
80+
if [ -z "$wheel_path" ]; then
81+
echo "No wheel artifact found."
82+
exit 1
83+
fi
84+
python -m pip install "$wheel_path"
85+
86+
sdist_path="$(find artifacts -type f -name '*.tar.gz' | head -n 1)"
87+
if [ -z "$sdist_path" ]; then
88+
echo "No sdist artifact found."
89+
exit 1
90+
fi
91+
92+
temp_dir="$(mktemp -d)"
93+
cd "$temp_dir"
94+
python -c "import pyisolate; print(pyisolate.__version__)"
95+
96+
publish:
97+
name: Publish To PyPI (Trusted Publishing)
98+
runs-on: ubuntu-latest
99+
timeout-minutes: 10
100+
needs: [build, smoke-test]
101+
if: >-
102+
github.repository == 'Comfy-Org/pyisolate' &&
103+
github.event_name == 'release' &&
104+
github.event.action == 'published' &&
105+
github.event.release.tag_name != '' &&
106+
startsWith(github.event.release.tag_name, 'v')
107+
permissions:
108+
id-token: write
109+
contents: read
110+
concurrency:
111+
group: publish-pypi-${{ github.event.release.tag_name }}
112+
cancel-in-progress: false
113+
114+
steps:
115+
- name: Download artifacts
116+
uses: actions/download-artifact@v4
117+
with:
118+
pattern: dist-*
119+
merge-multiple: false
120+
path: downloaded
121+
122+
- name: Collect distributions
123+
shell: bash
124+
run: |
125+
mkdir -p dist
126+
find downloaded -type f \( -name "*.whl" -o -name "*.tar.gz" \) -print0 | while IFS= read -r -d '' src; do
127+
base="$(basename "$src")"
128+
dest="dist/$base"
129+
if [ -e "$dest" ]; then
130+
# Deduplicate byte-identical files produced in multiple matrix legs.
131+
if cmp -s "$src" "$dest"; then
132+
continue
133+
fi
134+
echo "Conflicting distribution filename with different content: $base"
135+
exit 1
136+
fi
137+
cp "$src" "$dest"
138+
done
139+
140+
wheel_count="$(find dist -maxdepth 1 -type f -name '*.whl' | wc -l)"
141+
sdist_count="$(find dist -maxdepth 1 -type f -name '*.tar.gz' | wc -l)"
142+
if [ "$wheel_count" -eq 0 ] || [ "$sdist_count" -eq 0 ]; then
143+
echo "Expected at least one wheel and one sdist for publish."
144+
exit 1
145+
fi
146+
147+
ls -l dist
148+
149+
- name: Publish to PyPI via OIDC
150+
uses: pypa/gh-action-pypi-publish@release/v1
151+
with:
152+
packages-dir: dist

.github/workflows/ci.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python-version: ['3.9', '3.10', '3.11', '3.12']
17+
python-version: ['3.10', '3.11', '3.12']
1818
os: [ubuntu-latest, ubuntu-22.04, ubuntu-24.04]
1919

2020
steps:
@@ -25,6 +25,9 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28+
- name: Install bubblewrap
29+
run: sudo apt-get update && sudo apt-get install -y bubblewrap
30+
2831
- name: Install uv
2932
uses: astral-sh/setup-uv@v3
3033

@@ -56,23 +59,23 @@ jobs:
5659
include:
5760
- container: debian:11
5861
python-install: |
59-
apt-get update && apt-get install -y python3 python3-pip python3-venv git curl
62+
apt-get update && apt-get install -y python3 python3-pip python3-venv git curl bubblewrap
6063
extras: "dev,test"
6164
- container: debian:12
6265
python-install: |
63-
apt-get update && apt-get install -y python3 python3-pip python3-venv git curl
66+
apt-get update && apt-get install -y python3 python3-pip python3-venv git curl bubblewrap
6467
extras: "dev,test"
6568
- container: fedora:38
6669
python-install: |
67-
dnf install -y python3 python3-pip git curl
70+
dnf install -y python3 python3-pip git curl bubblewrap
6871
extras: "dev,test"
6972
- container: fedora:39
7073
python-install: |
71-
dnf install -y python3 python3-pip git curl
74+
dnf install -y python3 python3-pip git curl bubblewrap
7275
extras: "dev,test"
7376
- container: rockylinux:9
7477
python-install: |
75-
dnf install -y python3 python3-pip git
78+
dnf install -y python3 python3-pip git bubblewrap
7679
extras: "dev,test"
7780

7881
container: ${{ matrix.container }}
@@ -130,6 +133,7 @@ jobs:
130133
ruff check pyisolate tests
131134
ruff format --check pyisolate tests
132135
133-
# - name: Run mypy
134-
# run: |
135-
# mypy pyisolate
136+
- name: Run mypy
137+
run: |
138+
source .venv/bin/activate
139+
mypy pyisolate

.github/workflows/pytorch.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python-version: ['3.9', '3.11']
17+
python-version: ['3.10', '3.11']
1818
pytorch-version: ['2.0.0', '2.1.0', '2.2.0', '2.3.0']
1919

2020
steps:
@@ -25,6 +25,9 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28+
- name: Install bubblewrap
29+
run: sudo apt-get update && sudo apt-get install -y bubblewrap
30+
2831
- name: Install uv
2932
uses: astral-sh/setup-uv@v3
3033

@@ -71,12 +74,12 @@ jobs:
7174
- name: Install uv
7275
uses: astral-sh/setup-uv@v3
7376

74-
- name: Install NVIDIA GPU drivers
77+
- name: Install NVIDIA GPU drivers and bubblewrap
7578
run: |
7679
# Note: GitHub Actions doesn't have GPU support, but we can still test CUDA builds
7780
# The tests will run on CPU but with CUDA-enabled PyTorch builds
7881
sudo apt-get update
79-
sudo apt-get install -y nvidia-cuda-toolkit
82+
sudo apt-get install -y nvidia-cuda-toolkit bubblewrap
8083
8184
- name: Install PyTorch with CUDA
8285
run: |

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python-version: ['3.9', '3.10', '3.11', '3.12']
17+
python-version: ['3.10', '3.11', '3.12']
1818

1919
steps:
2020
- uses: actions/checkout@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,6 @@ cython_debug/
154154

155155
# UV cache directory (for hardlinking optimization)
156156
.uv_cache/
157+
158+
# Generated demo venvs
159+
comfy_hello_world/node-venvs/

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ repos:
1212
- id: debug-statements
1313

1414
- repo: https://github.com/astral-sh/ruff-pre-commit
15-
rev: v0.11.8
15+
rev: v0.14.0
1616
hooks:
1717
- id: ruff
18-
args: [--fix]
18+
args: [--fix, --unsafe-fixes]
1919
- id: ruff-format

0 commit comments

Comments
 (0)