Skip to content

Commit 1d18f52

Browse files
committed
Merge remote-tracking branch 'origin/master' into sym_pyobject
2 parents 96114f5 + 27b1c81 commit 1d18f52

File tree

303 files changed

+9107
-3561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+9107
-3561
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ temp_sym_python_cmd.py
99
inlog.txt
1010
outlog.txt
1111
octsympy_tests.log
12+
fntests.log
1213

13-
# matlab package subdir
14-
matlab/
14+
# packaging subdir
15+
tmp/
1516

1617
# autoconf
1718
src/configure

.mailmap

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Prevent git from showing duplicate names with commands like "git shortlog"
2+
# See the manpage of git-shortlog for details.
3+
# The syntax is:
4+
# Name that should be used <email that should be used> Bad name <bad email>
5+
#
6+
# You can skip Bad name if it is the same as the one that should be used, and is unique.
7+
#
8+
# This file is up-to-date if the command git log --format="%aN <%aE>" | sort -u
9+
# gives no duplicates.
10+
Colin B. Macdonald <[email protected]> Colin Macdonald <[email protected]>
11+
Colin B. Macdonald <[email protected]> Colin B. Macdonald <[email protected]>
12+
Colin B. Macdonald <[email protected]> Colin Macdonald <[email protected]>
13+
Abhinav Tripathi <[email protected]> Abhinav <[email protected]>
14+
15+
Carnë Draug <[email protected]> carandraug <devnull@localhost>
16+
17+
John W. Eaton <[email protected]> jwe <devnull@localhost>
18+
19+
Andrés Prieto <[email protected]> maprieto <[email protected]>
20+
21+

.travis.yml

+45-25
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,69 @@ language: generic
55

66
matrix:
77
include:
8-
- python: "2.7"
9-
env: PYTAVE=yes SYMPY_VER=1.0 OCT_PPA=yes DOCTEST=yes COLUMNS=80
10-
- python: "2.7"
11-
env: PYTAVE=no SYMPY_VER=1.0 OCT_PPA=yes DOCTEST=yes COLUMNS=80
12-
- python: "3.5"
13-
env: PYTAVE=no SYMPY_VER=1.0 OCT_PPA=yes DOCTEST=yes COLUMNS=80
8+
- env: PYTHON=python2 PYTHON_VER= PYTAVE=no SYMPY_VER=1.0 OCT=ppa DOCTEST=yes COLUMNS=80
9+
- env: PYTHON=python3 PYTHON_VER=3 PYTAVE=no SYMPY_VER=1.0 OCT=ppa DOCTEST=yes COLUMNS=80
10+
- env: PYTHON=python2 PYTHON_VER= PYTAVE=no SYMPY_VER=1.0 OCT=daily DOCTEST=no COLUMNS=80
11+
- env: PYTHON=python3 PYTHON_VER=3 PYTAVE=no SYMPY_VER=1.0 OCT=daily DOCTEST=no COLUMNS=80
12+
- env: PYTHON=python2 PYTHON_VER= PYTAVE=yes SYMPY_VER=1.0 OCT=daily DOCTEST=no COLUMNS=80
13+
- env: PYTHON=python3 PYTHON_VER=3 PYTAVE=yes SYMPY_VER=1.0 OCT=daily DOCTEST=no COLUMNS=80
14+
allow_failures:
15+
- env: PYTHON=python2 PYTHON_VER= PYTAVE=no SYMPY_VER=1.0 OCT=daily DOCTEST=no COLUMNS=80
16+
- env: PYTHON=python3 PYTHON_VER=3 PYTAVE=no SYMPY_VER=1.0 OCT=daily DOCTEST=no COLUMNS=80
17+
- env: PYTHON=python2 PYTHON_VER= PYTAVE=yes SYMPY_VER=1.0 OCT=daily DOCTEST=no COLUMNS=80
18+
- env: PYTHON=python3 PYTHON_VER=3 PYTAVE=yes SYMPY_VER=1.0 OCT=daily DOCTEST=no COLUMNS=80
1419

1520
# need octave devel pkgs for doctest (has compiled code as of July 2015)
16-
install:
17-
- if [ "x$OCT_PPA" = "xyes" ]; then
21+
before_install:
22+
- if [ "x$OCT" = "xppa" ]; then
1823
sudo apt-add-repository -y ppa:octave/stable;
1924
fi
20-
- sudo apt-get update -qq -y;
21-
- sudo apt-get install -qq -y octave liboctave-dev;
22-
- sudo apt-get install -qq -y python;
23-
- "pip install --user sympy==$SYMPY_VER"
25+
- sudo apt-get update -qq
26+
- sudo apt-get install -y liboctave-dev
27+
- sudo apt-get install -y octave
28+
- if [ "x$OCT" = "xdaily" ]; then
29+
sudo apt-get install -y libarpack2-dev libgl2ps-dev libgraphicsmagick++-dev libqrupdate-dev libsuitesparse-dev;
30+
wget https://s3.amazonaws.com/octave-snapshot/public/octave-ubuntu-trusty-snapshot.tar.xz;
31+
sudo tar --extract --directory=/usr/local --strip-components=1 --file=octave-ubuntu-trusty-snapshot.tar.xz;
32+
fi
33+
- sudo apt-get install -y python$PYTHON_VER-pip
34+
# we need python-dev and python3-dev but we can drop numpy after https://bitbucket.org/mtmiller/pytave/issues/84 is resolved.
35+
- if [ "x$PYTAVE" = "xyes" ]; then
36+
sudo apt-get install -y python$PYTHON_VER-dev python$PYTHON_VER-numpy;
37+
fi
38+
39+
install:
40+
- pip$PYTHON_VER install --user sympy==$SYMPY_VER
2441
- if [ "x$DOCTEST" = "xyes" ]; then
25-
octave -W --no-gui --eval "pkg install -forge doctest";
42+
mkdir ${HOME}/octave;
43+
wget https://github.com/catch22/octave-doctest/releases/download/v0.5.0/doctest-0.5.0.tar.gz;
44+
octave -W --no-gui --eval "pkg install doctest-0.5.0.tar.gz";
2645
fi
2746
- if [ "x$PYTAVE" = "xyes" ]; then
28-
sudo apt-get install -qq -y libboost-python-dev python-numpy;
29-
hg clone https://bitbucket.org/genuinelucifer/pytave_main;
30-
cd pytave_main;
47+
hg clone https://bitbucket.org/mtmiller/pytave pytave;
48+
pushd pytave;
3149
pwd;
32-
autoreconf --install;
33-
./configure;
34-
make;
35-
cd ..;
50+
autoreconf --install || exit 1;
51+
./configure PYTHON_VERSION=$PYTHON_VER && make || exit 1;
52+
popd;
3653
fi
3754

38-
3955
# all commands here must have exit code 0 for the build to be called "passing"
4056
# debugging: octave -W --no-gui --eval "syms x; A = [x sin(x) x^3]; A; exit(0)"
4157
script:
4258
- octave -W --no-gui --eval "ver; pwd; exit(0)"
43-
- stty cols 80 rows 40
59+
- stty cols $COLUMNS rows 40
4460
- tput cols; stty size
45-
- pushd src; make; popd
4661
- pushd inst
47-
- octave --path=/home/travis/build/cbm755/octsympy/pytave_main -W --no-gui --eval "r = octsympy_tests; exit(r)"
62+
- if [ "x$PYTAVE" = "xyes" ]; then
63+
export IPC=native;
64+
else
65+
export IPC=default;
66+
fi
67+
- octave --path=$TRAVIS_BUILD_DIR/pytave -W --no-gui --eval "sympref ipc $IPC; r = octsympy_tests; exit(r)";
4868
- cat octsympy_tests.log
4969
- if [ "x$DOCTEST" = "xyes" ]; then
50-
octave --path=/home/travis/build/cbm755/octsympy/pytave_main -W --no-gui --eval "pkg load doctest; syms x; r = doctest('.'); exit(~r)";
70+
octave --path=$TRAVIS_BUILD_DIR/pytave -W --no-gui --eval "pkg load doctest; sympref ipc $IPC; syms x; r = doctest('.'); exit(~r)";
5171
fi
5272
- popd
5373

CONTRIBUTORS

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Eric Chassande-Mottin
1515
Nicol N. Schraudolph
1616
Sylvain Pelissier
1717
Alex Vong
18+
Marco Falke
19+
NVS Abhilash
1820

1921
(Please contact the developers if your name should be here but isn't!)
2022

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: symbolic
2-
Version: 2.4.0
3-
Date: 2016-05-24
2+
Version: 2.5.0
3+
Date: 2017-02-01
44
Author: Colin B. Macdonald <[email protected]>
55
Maintainer: Colin B. Macdonald <[email protected]>
66
Title: Octave Symbolic Package using SymPy

HOWTO-release.md

+12-26
Original file line numberDiff line numberDiff line change
@@ -15,48 +15,38 @@ Checklist
1515

1616
- update version number (remove "-dev", check if bump needed).
1717

18-
- Make sure snippet defaults to false.
19-
2018
* Update DESCRIPTION file (version number and date).
2119

2220
* Update NEWS file (date, version number, reformat).
2321

24-
* Update version in src/configure.ac. Test the bootstrap script (note
25-
the scripts below will run bootstrap for the packages).
26-
27-
* Check minimum sympy version is consistent: its in:
28-
configure.ac, DESCRIPTION, assert_have_python_and_sympy.m
22+
* Check minimum sympy version is consistent: its in
23+
DESCRIPTION, assert_have_python_and_sympy.m
2924

30-
* Packages: need to run the following two scripts. I recommend
31-
testing them first without using the tag. Then test the packages
32-
by running the test suite.
25+
* Packages: need to run the following two scripts:
3326

34-
- make_release_packages.sh, use "day-to-day testing" mode instead
35-
of tag.
27+
- Use the maintainer makefile: "make clean", "make dist".
3628

37-
- make_windows_package.sh, use "day-to-day testing" mode.
29+
- make_windows_package.sh, use "day-to-day testing" mode. I
30+
recommend testing them first without using the tag. Then test
31+
the packages by running the test suite.
3832

39-
* Test regenerating the html documentation. Needs version >= 0.1.7.
40-
- pkg load generate_html
41-
- options = get_html_options ("octave-forge");
42-
- generate_package_html ("symbolic", "html", options)
33+
* Test regenerating html documentation: "make html"
4334

4435
* If packages seem ok, then tag the repo with:
4536

46-
`git tag -a v2.0.0 -m "Version 2.0.0"`
37+
`git tag -a v2.x.y -m "Version 2.x.y"`
4738

4839
* `git push --tags origin master`. If messed up and want to change
4940
anything after this, need to bump version number (tag is public).
5041

5142
* Push and push tags to sourceforge.
5243

53-
* Then redo the packages using the "tag" mode.
44+
* Then redo the packages (Windows bundle will need "tag" mode).
5445

5546
- compute the md5sums, upload the packages to github release
5647
page, and copy-paste the md5sums.
5748

58-
- regenerate the html documentation. It will create a directory
59-
called "html". Then "tar -zcvf symbolic-html.tar.gz html".
49+
- regenerate the html documentation.
6050

6151
- create ticket for binaries and doc tarball on sourceforge.
6252

@@ -69,11 +59,7 @@ AFTER release
6959
in sympref.m. See
7060
[PEP 440](https://www.python.org/dev/peps/pep-0440).
7161

72-
* Update the version in src/configure.ac: -dev seems ok there.
73-
74-
* Optionally, update the make_*releases* scripts.
62+
* Optionally, update the make_windows_bundle script.
7563

7664
* Leave old version in DESCRIPTION ("-dev" not supported here). We
7765
will bump it at the next release. FIXME: this is unfortunate.
78-
79-
* Snippets could default to true in sympref.m

Makefile

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
SHELL := /bin/bash
2+
3+
## Copyright 2016-2017 Colin B. Macdonald
4+
##
5+
## Copying and distribution of this file, with or without modification,
6+
## are permitted in any medium without royalty provided the copyright
7+
## notice and this notice are preserved. This file is offered as-is,
8+
## without any warranty.
9+
10+
PACKAGE := $(shell grep "^Name: " DESCRIPTION | cut -f2 -d" ")
11+
VERSION := $(shell grep "^Version: " DESCRIPTION | cut -f2 -d" ")
12+
MATLAB_PACKAGE_NAME := octsympy
13+
14+
BUILD_DIR := tmp
15+
MATLAB_PKG := ${BUILD_DIR}/${MATLAB_PACKAGE_NAME}-matlab-${VERSION}
16+
MATLAB_PKG_ZIP := ${BUILD_DIR}/${MATLAB_PACKAGE_NAME}-matlab-${VERSION}.zip
17+
OCTAVE_RELEASE := ${BUILD_DIR}/${PACKAGE}-${VERSION}
18+
OCTAVE_RELEASE_TARBALL := ${BUILD_DIR}/${PACKAGE}-${VERSION}.tar.gz
19+
20+
INSTALLED_PACKAGE := ~/octave/${PACKAGE}-${VERSION}/packinfo/DESCRIPTION
21+
HTML_DIR := ${BUILD_DIR}/${PACKAGE}-html
22+
HTML_TARBALL := ${HTML_DIR}.tar.gz
23+
24+
OCTAVE ?= octave
25+
MATLAB ?= matlab
26+
27+
.PHONY: help clean install test doctest dist dist_zip html matlab_test matlab_pkg
28+
29+
help:
30+
@echo Available rules:
31+
@echo " clean clean all temporary files"
32+
@echo " install install package in Octave"
33+
@echo " test run tests with Octave"
34+
@echo " doctest run doctests with Octave"
35+
@echo " dist create Octave package (${OCTAVE_RELEASE_TARBALL})"
36+
@echo " html create Octave Forge website"
37+
@echo
38+
@echo " matlab_test run tests with Matlab"
39+
@echo " matlab_pkg create Matlab package (${MATLAB_PKG_ZIP})"
40+
41+
42+
GIT_DATE := $(shell git show -s --format=\%ci)
43+
# Follows the recommendations of https://reproducible-builds.org/docs/archives
44+
define create_tarball
45+
$(shell cd $(dir $(1)) \
46+
&& find $(notdir $(1)) -print0 \
47+
| LC_ALL=C sort -z \
48+
| tar c --mtime="$(GIT_DATE)" \
49+
--owner=root --group=root --numeric-owner \
50+
--no-recursion --null -T - -f - \
51+
| gzip -9n > "$(2)")
52+
endef
53+
54+
%.tar.gz: %
55+
$(call create_tarball,$<,$(notdir $@))
56+
57+
%.zip: %
58+
cd "$(BUILD_DIR)" ; zip -9qr - "$(notdir $<)" > "$(notdir $@)"
59+
60+
$(OCTAVE_RELEASE): .git/index | $(BUILD_DIR)
61+
@echo "Creating package version $(VERSION) release ..."
62+
-$(RM) -r "$@"
63+
git archive --format=tar --prefix="$@/" HEAD | tar -x
64+
$(RM) "$@/README.matlab.md" \
65+
"$@/HOWTO-release.md" \
66+
"$@/README.bundled.md" \
67+
"$@/TODO.md" \
68+
"$@/.gitignore" \
69+
"$@/.travis.yml" \
70+
"$@/.mailmap" \
71+
"$@/screenshot.png" \
72+
"$@/screenshot-install.png"
73+
$(RM) -r "$@/testing" "$@/util"
74+
chmod -R a+rX,u+w,go-w "$@"
75+
76+
$(HTML_DIR): install | $(BUILD_DIR)
77+
@echo "Generating HTML documentation. This may take a while ..."
78+
-$(RM) -r "$@"
79+
$(OCTAVE) --no-window-system --silent \
80+
--eval "pkg load generate_html; " \
81+
--eval "pkg load $(PACKAGE);" \
82+
--eval "options = get_html_options ('octave-forge');" \
83+
--eval "generate_package_html ('${PACKAGE}', '${HTML_DIR}', options)"
84+
chmod -R a+rX,u+w,go-w $@
85+
86+
dist: $(OCTAVE_RELEASE_TARBALL)
87+
html: $(HTML_TARBALL)
88+
89+
${BUILD_DIR} ${MATLAB_PKG}/private ${MATLAB_PKG}/tests_matlab ${MATLAB_PKG}/@sym ${MATLAB_PKG}/@symfun ${MATLAB_PKG}/@logical ${MATLAB_PKG}/@double:
90+
mkdir -p "$@"
91+
92+
clean:
93+
rm -rf "${BUILD_DIR}"
94+
@#rm -f fntests.log
95+
rm -f inst/octsympy_tests.log
96+
97+
test:
98+
@echo "Testing package in GNU Octave ..."
99+
@$(OCTAVE) --no-gui --silent --path "${PWD}/inst" \
100+
--eval "set (0, 'defaultfigurevisible', 'off'); \
101+
anyfail = octsympy_tests; \
102+
sympref reset; \
103+
exit (anyfail)"
104+
@echo
105+
106+
doctest:
107+
@# Workaround for OctSymPy issue 273, we must pre-initialize the package
108+
@# Otherwise, it will make the doctests fail
109+
@echo "Testing documentation strings ..."
110+
@$(OCTAVE) --no-gui --silent --path "${PWD}/inst" \
111+
--eval "pkg load doctest; \
112+
sym ('x'); \
113+
set (0, 'defaultfigurevisible', 'off'); \
114+
success = doctest('inst/'); \
115+
sympref reset; \
116+
exit (!success)"
117+
@echo
118+
119+
120+
## Install in Octave (locally)
121+
install: ${INSTALLED_PACKAGE}
122+
${INSTALLED_PACKAGE}: ${OCTAVE_RELEASE_TARBALL}
123+
$(OCTAVE) --silent --eval "pkg install $<"
124+
125+
## Matlab packaging
126+
## TODO: should be written to properly use artfacts
127+
matlab_pkg: $(MATLAB_PKG_ZIP)
128+
129+
${MATLAB_PKG}: $(BUILD_DIR) ${MATLAB_PKG}/private ml_extract_tests
130+
131+
## Matlab: extract unit tests from Octave files, place in separate files
132+
ml_extract_tests: ${MATLAB_PKG}/tests_matlab ml_copy
133+
cp -pR misc/octassert.m ${MATLAB_PKG}/tests_matlab/
134+
cp -pR misc/extract_tests_for_matlab.m ${MATLAB_PKG}/
135+
cp -pR misc/octsympy_tests_matlab.m ${MATLAB_PKG}/
136+
cd ${MATLAB_PKG}/; ${OCTAVE} -q --eval "extract_tests_for_matlab"
137+
rm -f ${MATLAB_PKG}/extract_tests_for_matlab.m
138+
rm -f ${MATLAB_PKG}/tests_matlab/tests__sympref.m # temp
139+
140+
## Matlab: copy files
141+
ml_copy: ml_convert_comments
142+
cp -pR inst/private ${MATLAB_PKG}/
143+
cp -pR inst/@sym/private ${MATLAB_PKG}/@sym/
144+
cp -pR inst/@symfun/private ${MATLAB_PKG}/@symfun/
145+
cp -pR misc/my_print_usage.m ${MATLAB_PKG}/private/print_usage.m
146+
cp -pR misc/my_print_usage.m ${MATLAB_PKG}/@sym/private/print_usage.m
147+
cp -pR misc/my_print_usage.m ${MATLAB_PKG}/@symfun/private/print_usage.m
148+
cp -fp CONTRIBUTORS ${MATLAB_PKG}/
149+
cp -fp NEWS ${MATLAB_PKG}/
150+
cp -fp COPYING ${MATLAB_PKG}/
151+
cp -fp matlab_smt_differences.md ${MATLAB_PKG}/
152+
cp -fp README.md ${MATLAB_PKG}/
153+
cp -fp README.matlab.md ${MATLAB_PKG}/
154+
rm -f ${MATLAB_PKG}/octsympy_tests.m
155+
156+
## Matlab: extract and convert comments to Matlab style
157+
ml_convert_comments: ${MATLAB_PKG}/@sym ${MATLAB_PKG}/@symfun ${MATLAB_PKG}/@double ${MATLAB_PKG}/@logical
158+
$(OCTAVE) --path ${PWD}/util --silent --eval "pwd, convert_comments('inst/', '', '../${MATLAB_PKG}/')"
159+
$(OCTAVE) --path ${PWD}/util --silent --eval "pwd, convert_comments('inst/', '@symfun', '../${MATLAB_PKG}/')"
160+
$(OCTAVE) --path ${PWD}/util --silent --eval "pwd, convert_comments('inst/', '@sym', '../${MATLAB_PKG}/')"
161+
$(OCTAVE) --path ${PWD}/util --silent --eval "pwd, convert_comments('inst/', '@double', '../${MATLAB_PKG}/')"
162+
$(OCTAVE) --path ${PWD}/util --silent --eval "pwd, convert_comments('inst/', '@logical', '../${MATLAB_PKG}/')"
163+
164+
matlab_test:
165+
${MATLAB} -nojvm -nodisplay -nosplash -r "addpath('inst'); octsympy_tests_matlab"

0 commit comments

Comments
 (0)