-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use modern tooling to build and test Python wheels (#667)
- Loading branch information
Showing
19 changed files
with
456 additions
and
5,922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
python3 -m venv .venv | ||
. .venv/bin/activate | ||
|
||
pip install setuptools build tox | ||
|
||
./autogen.sh | ||
./configure PYTHON=/usr/bin/python3 CC=clang CXX=clang++ CXXFLAGS='-O1' | ||
./configure CC=clang CXX=clang++ CXXFLAGS='-O1' | ||
make -C Python | ||
make -C Python wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
python3 -m venv .venv | ||
. .venv/bin/activate | ||
|
||
pip install Python/dist/QuantLib-*.whl | ||
grep -v QuantLib binder/requirements.txt > Python/examples/requirements.txt | ||
pip install -r Python/examples/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cpp/quantlib_wrap.cpp | ||
cpp/quantlib_wrap.h | ||
csharp/*.cs | ||
NQuantLib.dll | ||
cpp/build | ||
csharp/obj | ||
examples/*/bin | ||
examples/*/obj | ||
.vs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
bin/ | ||
quantlib_wrap.cpp | ||
quantlib_wrap.h | ||
QuantLib.jar | ||
*.jnilib | ||
org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
src/QuantLib/quantlib_wrap.cpp | ||
src/QuantLib/QuantLib.py | ||
src/QuantLib.egg-info | ||
build | ||
dist | ||
examples/*.ipynb | ||
examples/.ipynb_checkpoints | ||
*.pyc | ||
.cache/ | ||
**/.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
|
||
CLEANFILES = QuantLib/quantlib_wrap.cpp QuantLib/QuantLib.py .build-stamp | ||
CLEANFILES = src/QuantLib/quantlib_wrap.cpp src/QuantLib/QuantLib.py .build-stamp | ||
|
||
BUILT_SOURCES = QuantLib/quantlib_wrap.cpp QuantLib/QuantLib.py | ||
BUILT_SOURCES = src/QuantLib/quantlib_wrap.cpp src/QuantLib/QuantLib.py | ||
|
||
if HAVE_PYTHON | ||
if BUILD_PYTHON | ||
|
||
all-local: .build-stamp | ||
|
||
.build-stamp: QuantLib/quantlib_wrap.cpp QuantLib/QuantLib.py setup.py | ||
CXXFLAGS="$(CXXFLAGS) $(CXXWARNINGFLAGS)" CC="$(CC)" CXX="$(CXX)" $(PYTHON) setup.py build | ||
.build-stamp: src/QuantLib/quantlib_wrap.cpp src/QuantLib/QuantLib.py setup.py | ||
CXXFLAGS="$(CXXFLAGS) $(CXXWARNINGFLAGS)" CC="$(CC)" CXX="$(CXX)" $(PYTHON) -m build --wheel | ||
rm -f LICENSE.TXT | ||
touch .build-stamp | ||
|
||
check-local: .build-stamp | ||
$(PYTHON) setup.py test | ||
|
||
install-exec-local: .build-stamp | ||
$(PYTHON) setup.py install | ||
tox run | ||
|
||
wheel: .build-stamp | ||
$(PYTHON) setup.py bdist_wheel | ||
|
||
clean-local: | ||
rm -rf build | ||
rm -rf build dist | ||
|
||
endif | ||
endif | ||
|
||
QuantLib/quantlib_wrap.cpp QuantLib/QuantLib.py: ../SWIG/*.i | ||
$(SWIG) -python -c++ -outdir QuantLib \ | ||
-o QuantLib/quantlib_wrap.cpp ../SWIG/quantlib.i | ||
src/QuantLib/quantlib_wrap.cpp src/QuantLib/QuantLib.py: ../SWIG/*.i | ||
$(SWIG) -python -c++ -outdir src/QuantLib -o src/QuantLib/quantlib_wrap.cpp ../SWIG/quantlib.i | ||
|
||
dist-hook: | ||
mkdir -p $(distdir)/examples | ||
cp ./examples/*.py $(distdir)/examples | ||
mkdir -p $(distdir)/test | ||
cp ./test/*.py $(distdir)/test | ||
|
||
EXTRA_DIST = README.txt setup.py setup.cfg QuantLib/__init__.py $(BUILT_SOURCES) | ||
EXTRA_DIST = README.txt pytest.ini setup.cfg setup.py swig.cmd tox.ini src/QuantLib/__init__.py $(BUILT_SOURCES) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
filterwarnings = ignore:builtin type .* has no __module__ attribute:DeprecationWarning |
Oops, something went wrong.