Skip to content

Commit af2d0fb

Browse files
Add option to recompile submodule
1 parent c265467 commit af2d0fb

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

deps.py

+25-15
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,53 @@
33
import sys
44

55
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+
)
89
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+
)
1113

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"
1315

1416

1517
WHEELS = [
1618
"https://pytorch-geometric.com/whl/torch-1.7.0/torch_cluster-latest+{cuda}-{python}-{platform}.whl",
1719
"https://pytorch-geometric.com/whl/torch-1.7.0/torch_scatter-latest+{cuda}-{python}-{platform}.whl",
1820
"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",
2122
]
2223

2324

2425
def install_deps(cuda):
25-
pip_install_command = ['poetry', 'run', 'pip', 'install']
26+
pip_install_command = ["poetry", "run", "pip", "install"]
2627
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+
)
3032

3133

3234
def install_deps_cpu():
33-
install_deps('cpu')
35+
install_deps("cpu")
3436

3537

3638
def install_deps_cu101():
37-
install_deps('cu101')
39+
install_deps("cu101")
3840

3941

4042
def install_deps_cu102():
41-
install_deps('cu102')
43+
install_deps("cu102")
4244

4345

4446
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+
)

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ install_deps_cpu = "deps:install_deps_cpu"
4343
install_deps_cu101 = "deps:install_deps_cu101"
4444
install_deps_cu102 = "deps:install_deps_cu102"
4545
install_deps_cu110 = "deps:install_deps_cu110"
46+
rebuild_submodule = "deps:rebuild_submodule"

0 commit comments

Comments
 (0)