Skip to content

Commit b97fc9f

Browse files
authored
Fix setup (#526)
* fix * refine * refine * refine * reformat * refine * py3.9->py3.10 * refine * refine github workflow * refine * test * test * test * test * test * test * test * test * test * test * test * test * test * ci run success
1 parent 4185118 commit b97fc9f

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.github/workflows/py.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Python 3.6
2424
uses: actions/setup-python@v2
2525
with:
26-
python-version: 3.6
26+
python-version: '3.6'
2727

2828
- name: Install dependencies
2929
# flake8-bugbear flake8-comprehensions are useful but not available internally
@@ -52,18 +52,13 @@ jobs:
5252
steps:
5353
- uses: actions/checkout@v2
5454

55-
- name: Set up Python 3.9
56-
uses: actions/setup-python@v2
57-
with:
58-
python-version: 3.9
59-
6055
- name: Install dependencies
6156
run: |
6257
python -m pip install --upgrade pip
63-
python -m pip install --pre oneflow -f https://staging.oneflow.info/branch/master/cpu
58+
python -m pip install --pre oneflow -f https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cpu
6459
python -m pip install pybind11
6560
python -m pip install torch torchvision torchaudio
66-
61+
6762
- name: Build and install
6863
run: |
6964
python -m pip install -e .

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ def write_version_file():
4646

4747

4848
def get_pybind11():
49-
import pybind11 as pb
50-
49+
try:
50+
import pybind11 as pb
51+
except ImportError:
52+
print("pybind11 not found, installing...")
53+
os.system(f"{sys.executable} -m pip install pybind11")
54+
import pybind11 as pb
5155
return pb
5256

5357

0 commit comments

Comments
 (0)