Skip to content

Commit eec3c0c

Browse files
committed
Initial commit
0 parents  commit eec3c0c

Some content is hidden

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

42 files changed

+5907
-0
lines changed

.github/workflows/ci.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-python-versions:
12+
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ['3.9', '3.10', '3.11', '3.12']
18+
os: [ubuntu-latest, ubuntu-20.04, ubuntu-22.04]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install -e ".[dev]"
32+
33+
- name: Run tests with coverage
34+
run: |
35+
pytest --cov=pyisolate --cov-report=xml --cov-report=term-missing -v
36+
37+
- name: Upload coverage to Codecov
38+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
39+
uses: codecov/codecov-action@v4
40+
with:
41+
file: ./coverage.xml
42+
flags: unittests
43+
name: codecov-umbrella
44+
45+
test-linux-distros:
46+
name: Test on ${{ matrix.container }}
47+
runs-on: ubuntu-latest
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
include:
52+
- container: debian:11
53+
python-install: |
54+
apt-get update && apt-get install -y python3 python3-pip python3-venv git
55+
- container: debian:12
56+
python-install: |
57+
apt-get update && apt-get install -y python3 python3-pip python3-venv git
58+
- container: fedora:38
59+
python-install: |
60+
dnf install -y python3 python3-pip git
61+
- container: fedora:39
62+
python-install: |
63+
dnf install -y python3 python3-pip git
64+
- container: rockylinux:9
65+
python-install: |
66+
dnf install -y python3 python3-pip git
67+
- container: alpine:latest
68+
python-install: |
69+
apk add --no-cache python3 py3-pip git gcc musl-dev python3-dev
70+
71+
container: ${{ matrix.container }}
72+
73+
steps:
74+
- name: Install Python and Git
75+
run: ${{ matrix.python-install }}
76+
77+
- uses: actions/checkout@v4
78+
79+
- name: Install package
80+
run: |
81+
python3 -m pip install --upgrade pip
82+
python3 -m pip install -e ".[dev]"
83+
84+
- name: Run tests
85+
run: |
86+
python3 -m pytest -v
87+
88+
lint-and-type:
89+
name: Lint and Type Check
90+
runs-on: ubuntu-latest
91+
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Set up Python
96+
uses: actions/setup-python@v5
97+
with:
98+
python-version: '3.11'
99+
100+
- name: Install dependencies
101+
run: |
102+
python -m pip install --upgrade pip
103+
pip install -e ".[dev]"
104+
105+
- name: Run ruff
106+
run: |
107+
ruff check pyisolate tests
108+
ruff format --check pyisolate tests
109+
110+
# - name: Run mypy
111+
# run: |
112+
# mypy pyisolate

.github/workflows/docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: '3.11'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install -e ".[docs]"
34+
35+
- name: Build HTML documentation
36+
run: |
37+
cd docs
38+
make html
39+
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: ./docs/_build/html
44+
45+
deploy:
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
runs-on: ubuntu-latest
50+
needs: build
51+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

.github/workflows/pytorch.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: PyTorch Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-pytorch-cpu:
12+
name: Test with PyTorch CPU
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ['3.9', '3.11']
18+
pytorch-version: ['2.0.0', '2.1.0', '2.2.0', '2.3.0']
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install torch==${{ matrix.pytorch-version }} --index-url https://download.pytorch.org/whl/cpu
32+
pip install -e ".[dev]"
33+
34+
- name: Run tests
35+
run: |
36+
pytest tests/test_integration.py -v -k "torch"
37+
38+
- name: Test example with PyTorch
39+
run: |
40+
cd example
41+
python main.py -v
42+
43+
test-pytorch-cuda:
44+
name: Test with PyTorch CUDA
45+
runs-on: ubuntu-latest
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
include:
50+
- pytorch-version: '2.1.0'
51+
cuda-version: '11.8'
52+
- pytorch-version: '2.2.0'
53+
cuda-version: '11.8'
54+
- pytorch-version: '2.3.0'
55+
cuda-version: '12.1'
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Set up Python
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: '3.11'
64+
65+
- name: Install NVIDIA GPU drivers
66+
run: |
67+
# Note: GitHub Actions doesn't have GPU support, but we can still test CUDA builds
68+
# The tests will run on CPU but with CUDA-enabled PyTorch builds
69+
sudo apt-get update
70+
sudo apt-get install -y nvidia-cuda-toolkit
71+
72+
- name: Install PyTorch with CUDA
73+
run: |
74+
python -m pip install --upgrade pip
75+
if [ "${{ matrix.cuda-version }}" = "11.8" ]; then
76+
pip install torch==${{ matrix.pytorch-version }} --index-url https://download.pytorch.org/whl/cu118
77+
elif [ "${{ matrix.cuda-version }}" = "12.1" ]; then
78+
pip install torch==${{ matrix.pytorch-version }} --index-url https://download.pytorch.org/whl/cu121
79+
fi
80+
pip install -e ".[dev]"
81+
82+
- name: Check PyTorch CUDA availability
83+
run: |
84+
python -c "import torch; print(f'PyTorch version: {torch.__version__}'); print(f'CUDA available: {torch.cuda.is_available()}'); print(f'CUDA version: {torch.version.cuda if torch.version.cuda else \"N/A\"}')"
85+
86+
- name: Run tests
87+
run: |
88+
pytest tests/test_integration.py -v -k "torch"
89+
90+
- name: Test example with PyTorch
91+
run: |
92+
cd example
93+
python main.py -v

.github/workflows/windows.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Windows Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-windows:
12+
name: Test on Windows - Python ${{ matrix.python-version }}
13+
runs-on: windows-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ['3.9', '3.10', '3.11', '3.12']
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -e ".[dev]"
31+
32+
- name: Run tests
33+
run: |
34+
pytest -v
35+
36+
- name: Test example
37+
run: |
38+
cd example
39+
python main.py -v
40+
41+
test-windows-pytorch:
42+
name: Test on Windows with PyTorch
43+
runs-on: windows-latest
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
pytorch-version: ['2.1.0', '2.3.0']
48+
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: '3.11'
56+
57+
- name: Install PyTorch and dependencies
58+
run: |
59+
python -m pip install --upgrade pip
60+
pip install torch==${{ matrix.pytorch-version }} --index-url https://download.pytorch.org/whl/cpu
61+
pip install -e ".[dev]"
62+
63+
- name: Check PyTorch
64+
run: |
65+
python -c "import torch; print(f'PyTorch version: {torch.__version__}')"
66+
67+
- name: Run PyTorch tests
68+
run: |
69+
pytest tests/test_integration.py -v -k "torch"

0 commit comments

Comments
 (0)