Skip to content

Commit 3095abc

Browse files
authored
Merge pull request #142 from isuruf/sage
Update libsymengine to 0.3.0 and update tests
2 parents 9aca480 + 3d00ec6 commit 3095abc

File tree

6 files changed

+34
-44
lines changed

6 files changed

+34
-44
lines changed

.travis.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,17 @@ env:
2525
## statement, so if the variable is not set, the other if branch will get
2626
## executed.
2727
matrix:
28-
## Out of tree builds (default):
28+
# Debug builds:
2929
- BUILD_TYPE="Debug" WITH_BFD="yes" PYTHON_VERSION="2.7" TRIGGER_FEEDSTOCK="yes"
30+
- BUILD_TYPE="Debug" WITH_BFD="yes" PYTHON_VERSION="3.6"
3031

31-
## In-tree builds (we just check a few configurations to make sure they work):
32-
# Debug build with Python 2.7:
33-
- BUILD_TYPE="Debug" WITH_BFD="yes" PYTHON_VERSION="2.7"
34-
# Release build shared lib with Python 2.7:
32+
# Release builds:
3533
- PYTHON_VERSION="2.7" BUILD_SHARED_LIBS="yes"
36-
37-
# These test the setup.py file
38-
- PYTHON_VERSION="2.7" WITH_MPFR="yes" INTEGER_CLASS="gmp"
34+
- PYTHON_VERSION="2.7" WITH_MPFR="yes" INTEGER_CLASS="gmpxx"
3935
- PYTHON_VERSION="3.3" WITH_MPC="yes"
4036
- PYTHON_VERSION="3.4" WITH_MPFR="yes" WITH_NUMPY="yes"
41-
- PYTHON_VERSION="3.5" WITH_MPFR="yes" WITH_NUMPY="yes"
37+
- PYTHON_VERSION="3.5" WITH_MPC="yes" WITH_NUMPY="yes"
38+
- PYTHON_VERSION="3.6" WITH_MPC="yes" WITH_NUMPY="yes"
4239

4340
matrix:
4441
exclude:
@@ -81,13 +78,9 @@ matrix:
8178
- env: BUILD_TYPE="Release" PYTHON_VERSION="3.5"
8279
compiler: gcc
8380
os: osx
84-
- env: BUILD_TYPE="Release" WITH_SAGE="yes" WITH_MPC="yes"
81+
- env: BUILD_TYPE="Release" WITH_SAGE="yes" WITH_MPC="yes" PYTHON_VERSION="2.7"
8582
compiler: gcc
8683
os: linux
87-
addons:
88-
apt:
89-
packages:
90-
- lrzip
9184

9285
install:
9386
- export PYTHON_SOURCE_DIR=`pwd`
@@ -100,12 +93,13 @@ install:
10093
- git checkout `cat ../symengine_version.txt`
10194
- cd ..
10295

103-
# Setup travis for Python wrappers
104-
- source bin/install_travis.sh
105-
10696
# Setup travis for C++ library
10797
- cd $SOURCE_DIR
108-
- if [[ "${WITH_SAGE}" != "yes" ]]; then source bin/install_travis.sh; fi
98+
- source bin/install_travis.sh
99+
100+
# Setup travis for Python wrappers
101+
- cd $PYTHON_SOURCE_DIR
102+
- source bin/install_travis.sh
109103

110104
# Build C++ library
111105
- cd $SOURCE_DIR

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
22
project(python_wrapper)
33

44
set(CMAKE_PREFIX_PATH ${SymEngine_DIR} ${CMAKE_PREFIX_PATH})
5-
find_package(SymEngine 0.2.0 REQUIRED CONFIG
5+
find_package(SymEngine 0.3.0 REQUIRED CONFIG
66
PATH_SUFFIXES lib/cmake/symengine cmake/symengine CMake/)
77
message("SymEngine_DIR : " ${SymEngine_DIR})
88
set(CMAKE_BUILD_TYPE ${SYMENGINE_BUILD_TYPE})

bin/install_travis.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#!/usr/bin/env bash
22

3-
if [[ "${WITH_SAGE}" != "yes" ]]; then
4-
# symengine's bin/install_travis.sh will install miniconda
5-
conda_pkgs="python=${PYTHON_VERSION} pip cython sympy nose pytest"
6-
if [[ "${WITH_NUMPY}" == "yes" ]]; then
7-
conda_pkgs="${conda_pkgs} numpy";
8-
fi
9-
else
10-
wget -O- https://dl.dropboxusercontent.com/u/46807346/sage-6.9-x86_64-Linux-Ubuntu_12.04_64_bit.tar.gz | tar xz
11-
SAGE_ROOT=`pwd`/sage-6.9-x86_64-Linux
12-
export PATH="$SAGE_ROOT:$PATH"
13-
source $SAGE_ROOT/src/bin/sage-env
14-
export our_install_dir=$SAGE_LOCAL
3+
# symengine's bin/install_travis.sh will install miniconda
4+
export conda_pkgs="python=${PYTHON_VERSION} pip cython sympy nose pytest"
5+
6+
if [[ "${WITH_NUMPY}" == "yes" ]]; then
7+
export conda_pkgs="${conda_pkgs} numpy";
8+
fi
9+
10+
if [[ "${WITH_SAGE}" == "yes" ]]; then
11+
export conda_pkgs="${conda_pkgs} sage";
1512
fi
13+
14+
conda update -q -n root conda
15+
conda install ${conda_pkgs} libgap=4.8.3
16+
source activate $our_install_dir;

bin/test_travis.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ set -x
99
python setup.py install build_ext --inplace --symengine-dir=$our_install_dir
1010

1111
# Test python wrappers
12-
if [[ "${WITH_SAGE}" != "yes" ]]; then
13-
nosetests -v
14-
# If switching to py.test, the following collects correct tests:
15-
#py.test -v $PYTHON_SOURCE_DIR/symengine/tests/test_*.py
16-
mkdir -p empty
17-
cd empty
18-
python $PYTHON_SOURCE_DIR/bin/test_python.py
19-
fi
20-
if [[ "${WITH_SAGE}" == "yes" ]]; then
21-
sage -t $PYTHON_SOURCE_DIR/symengine/tests/test_sage.py
22-
fi
12+
nosetests -v
13+
# If switching to py.test, the following collects correct tests:
14+
#py.test -v $PYTHON_SOURCE_DIR/symengine/tests/test_*.py
15+
mkdir -p empty && cd empty
16+
python $PYTHON_SOURCE_DIR/bin/test_python.py
17+
cd ..
2318

2419
if [[ "${TRIGGER_FEEDSTOCK}" == "yes" ]]; then
2520
cd $PYTHON_SOURCE_DIR

symengine/tests/test_sage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from symengine import (Integer, symbols, sin, cos, pi, E, I, Add,
2-
function_symbol, DenseMatrix, sympify)
2+
function_symbol, DenseMatrix, sympify, log)
33
from symengine.lib.symengine_wrapper import (PyNumber, PyFunction,
44
sage_module, wrap_sage_function)
55

symengine_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0172e47349b7d158ee8a7186eb0a19a7f155a225
1+
v0.3.0

0 commit comments

Comments
 (0)