|
3 | 3 | import sys
|
4 | 4 |
|
5 | 5 | if sys.version_info.minor < 8:
|
6 |
| - PYTHON_VERSION = 'cp{major}{minor}-cp{major}{minor}m'.format( |
7 |
| - major=sys.version_info.major, minor=sys.version_info.minor) |
| 6 | + PYTHON_VERSION = "cp{major}{minor}-cp{major}{minor}m".format( |
| 7 | + major=sys.version_info.major, minor=sys.version_info.minor |
| 8 | + ) |
8 | 9 | else:
|
9 |
| - PYTHON_VERSION = 'cp{major}{minor}-cp{major}{minor}'.format( |
10 |
| - major=sys.version_info.major, minor=sys.version_info.minor) |
| 10 | + PYTHON_VERSION = "cp{major}{minor}-cp{major}{minor}".format( |
| 11 | + major=sys.version_info.major, minor=sys.version_info.minor |
| 12 | + ) |
11 | 13 |
|
12 |
| -PLATFORM = "macosx_10_9_x86_64" if sys.platform == 'darwin' else "linux_x86_64" |
| 14 | +PLATFORM = "macosx_10_9_x86_64" if sys.platform == "darwin" else "linux_x86_64" |
13 | 15 |
|
14 | 16 |
|
15 | 17 | WHEELS = [
|
16 | 18 | "https://pytorch-geometric.com/whl/torch-1.7.0/torch_cluster-latest+{cuda}-{python}-{platform}.whl",
|
17 | 19 | "https://pytorch-geometric.com/whl/torch-1.7.0/torch_scatter-latest+{cuda}-{python}-{platform}.whl",
|
18 | 20 | "https://pytorch-geometric.com/whl/torch-1.7.0/torch_sparse-latest+{cuda}-{python}-{platform}.whl",
|
19 |
| - "https://pytorch-geometric.com/whl/torch-1.7.0/torch_spline_conv-latest+{cuda}-{python}-{platform}.whl" |
20 |
| - |
| 21 | + "https://pytorch-geometric.com/whl/torch-1.7.0/torch_spline_conv-latest+{cuda}-{python}-{platform}.whl", |
21 | 22 | ]
|
22 | 23 |
|
23 | 24 |
|
24 | 25 | def install_deps(cuda):
|
25 |
| - pip_install_command = ['poetry', 'run', 'pip', 'install'] |
| 26 | + pip_install_command = ["poetry", "run", "pip", "install"] |
26 | 27 | for wheel in WHEELS:
|
27 |
| - subprocess.call(pip_install_command + [wheel.format( |
28 |
| - cuda=cuda, python=PYTHON_VERSION, platform=PLATFORM |
29 |
| - )]) |
| 28 | + subprocess.call( |
| 29 | + pip_install_command |
| 30 | + + [wheel.format(cuda=cuda, python=PYTHON_VERSION, platform=PLATFORM)] |
| 31 | + ) |
30 | 32 |
|
31 | 33 |
|
32 | 34 | def install_deps_cpu():
|
33 |
| - install_deps('cpu') |
| 35 | + install_deps("cpu") |
34 | 36 |
|
35 | 37 |
|
36 | 38 | def install_deps_cu101():
|
37 |
| - install_deps('cu101') |
| 39 | + install_deps("cu101") |
38 | 40 |
|
39 | 41 |
|
40 | 42 | def install_deps_cu102():
|
41 |
| - install_deps('cu102') |
| 43 | + install_deps("cu102") |
42 | 44 |
|
43 | 45 |
|
44 | 46 | def install_deps_cu110():
|
45 |
| - install_deps('cu110') |
| 47 | + install_deps("cu110") |
| 48 | + |
| 49 | + |
| 50 | +def rebuild_submodule(): |
| 51 | + # Might need to uninstall first if it was installed using poetry |
| 52 | + subprocess.call(["poetry", "run", "pip", "uninstall", "torch_persistent_homology"]) |
| 53 | + subprocess.call( |
| 54 | + ["poetry", "run", "pip", "install", "-U", "repos/torch_persistent_homology"] |
| 55 | + ) |
0 commit comments