Skip to content

Commit cafc928

Browse files
committed
Add an option for forcing build from source.
1 parent 2e38b44 commit cafc928

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ This is re-packaged Nova Physics Python bindings, as currently official bindings
1212

1313
Install with ``pip install git+https://github.com/gresm/nova-physics-python-fixed.git``
1414

15-
The command will build the [Nova Physics](https://github.com/kadir014/nova-physics) from source, if you want to use pre-build Nova binaries run:
16-
``FORCE_NOVA_BINARIES="" pip install git+https://github.com/gresm/nova-physics-python-fixed.git``
17-
Binaries can be found [here](nova-binaries) but currently only for Linux x86/x86_64.
18-
They originate from the Nova Physics repository and can be downloaded [here](https://github.com/kadir014/nova-physics/releases/download/0.5.0/nova-physics-0.5.0-devel.tar.gz)
15+
The command will try to use the [Nova Physics](https://github.com/kadir014/nova-physics) binaries and fall-backs if none found, if you want to force usage pre-build Nova binaries run:
16+
``NOVA_FORCE="binaries" pip install git+https://github.com/gresm/nova-physics-python-fixed.git``
17+
Binaries can be found [here](nova-binaries) but currently only for Linux x86/x86_64. To force building from source run ``NOVA_FORCE="source" pip install git+https://github.com/gresm/nova-physics-python-fixed.git``
1918

2019
The package will be installed under ``nova-physics`` namespace, but to import it in python use ``import nova``. Uninstalling is simple as ``pip uninstall nova-physics``.
2120

setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from pathlib import Path
44
from setuptools import setup, Extension
55

6-
FORCE_BINARIES = "FORCE_NOVA_BINARIES" in os.environ
6+
FORCE_BINARIES = "NOVA_FORCE" in os.environ and os.environ["NOVA_FORCE"].lower() == "binaries"
7+
FORCE_BUILD_SOURCE = "NOVA_FORCE" in os.environ and os.environ["NOVA_FORCE"].lower() == "source"
78

89
PACKAGE_DIR = Path(__file__).parent
910

@@ -33,6 +34,8 @@
3334
def use_binaries():
3435
if FORCE_BINARIES:
3536
return True
37+
if FORCE_BUILD_SOURCE:
38+
return False
3639
return PREBUILT_OS_DIR.exists() and LOCAL_BINARIES.exists()
3740

3841

@@ -107,9 +110,14 @@ def main():
107110
# A dirty trick, for not-so-conventional implementation nova-python bindings.
108111
extra_compile_args=["-Wno-format-security"],
109112
extra_objects=[nova_to_link],
110-
depends=[nova_to_link],
111113
optional=False
112114
)
115+
116+
print(
117+
"See https://github.com/gresm/nova-physics-python-fixed/blob/master/troubleshooting-guide.md if error occurred "
118+
"to see whether there is solution for your problem."
119+
)
120+
113121
setup(
114122
name="nova-physics",
115123
version="0.4.0",

0 commit comments

Comments
 (0)