Skip to content

Commit 5ba9aa6

Browse files
authored
Build system update for 0.10.1 dev (#22)
* Workaround for conda-build using separate win32 and win64 environments; closes #20 * Enable CI on all commits * Disable conda-build on non-tagged commits * Cache downloaded dependencies on AppVeyor * Increment version
1 parent de30a8c commit 5ba9aa6

13 files changed

+151
-97
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Python bindings and misc tools for using OpenDSS (EPRI Distribution System Simul
88

99
If you are looking for the custom OpenDSS C-API library, see [`DSS C-API`](http://github.com/dss-extensions/dss_capi/).
1010

11-
Version 0.10.0, based on OpenDSS revision 2395. While we plan to add a lot more funcionality into DSS Python, the main goal of creating a COM-compatible API has been reached.
11+
Version 0.10.1, based on OpenDSS revision 2504. While we plan to add a lot more funcionality into DSS Python, the main goal of creating a COM-compatible API has been reached.
1212

1313
This module mimics the COM structure (as exposed via `win32com` or `comtypes`), effectively enabling multi-platform compatibility at Python level.
1414
Most of the COM documentation can be used as-is, but instead of returning tuples or lists, this modules returns/accepts NumPy arrays for numeric data exchange.
@@ -19,7 +19,8 @@ If you are not bound to the COM API and its quirks, you might be insterested in
1919

2020
## Recent changes
2121

22-
- **2018-11-17 / version 0.10.0: Lots of changes, fixes and new features. Check the new [changelog](docs/changelog.md#0100) document for a list.**
22+
- **2019-02-17 / version 0.10.1: Under development. Check the new [changelog](docs/changelog.md#0101) document for a list.**
23+
- 2018-11-17 / version 0.10.0: Lots of changes, fixes and new features. Check the new [changelog](docs/changelog.md#0100) document for a list.
2324
- 2018-08-12 / version 0.9.8: Reorganize modules (v7 and v8), adds 8 missing methods and new backend methods for OpenDSSDirect.py v0.3+. Integrates many fixes from DSS_CAPI and the upstream OpenDSS.
2425
- 2018-04-30 / version 0.9.7: Fix some of the setters that used array data.
2526
- 2018-04-05 / version 0.9.6: Adds missing `ActiveCircuit.CktElements[index]` (or `...CktElements(index)`) and `ActiveCircuit.Buses[index]` (or `...Buses(index)`).

appveyor.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
version: '{build}'
2-
skip_non_tags: true
3-
image: Previous Visual Studio 2017
2+
skip_non_tags: false
3+
image: Visual Studio 2017
44
clone_folder: c:\projects\dss_python
5+
cache:
6+
- c:\projects\VCForPython27.msi
7+
- c:\projects\FPC-win32-win64-3.0.4.7z
8+
- c:\projects\SuiteSparse-5.3.0.tar.gz
59
environment:
610
ANACONDA_API_TOKEN:
711
secure: 78d9aslKXYoP2gVc7p5A5BJj3bSDPd2kZjQAlvEd64cCcxaf185CexeDNYNeNPuU
12+
matrix:
13+
- CONDA_SUBDIR: win-32
14+
- CONDA_SUBDIR: win-64
815

916
build_script:
1017
- cmd: >-
@@ -14,9 +21,28 @@ build_script:
1421
1522
git clone --branch 0.10.1 https://github.com/dss-extensions/dss_capi ../dss_capi
1623
17-
set path=c:\cygwin64\bin;c:\cygwin64\usr\bin;c:\FPC\3.0.4\bin\i386-win32;c:\Program Files (x86)\Microsoft Visual Studio 14.0\vc\bin;c:\miniconda3-x64;c:\miniconda3-x64\scripts;%path%
24+
set originalpath=%path%
25+
26+
IF "%CONDA_SUBDIR%"=="win-32" SET MINICONDA_DIR=c:\miniconda3
27+
28+
IF "%CONDA_SUBDIR%"=="win-64" SET MINICONDA_DIR=c:\miniconda3-x64
29+
30+
set path=c:\cygwin64\bin;c:\cygwin64\usr\bin;c:\FPC\3.0.4\bin\i386-win32;c:\Program Files (x86)\Microsoft Visual Studio 14.0\vc\bin;%MINICONDA_DIR%;%MINICONDA_DIR%\scripts;%originalpath%
1831
1932
c:\cygwin64\bin\bash ci/build_windows.sh
2033
34+
set path=c:\FPC\3.0.4\bin\i386-win32;c:\Program Files (x86)\Microsoft Visual Studio 14.0\vc\bin;%MINICONDA_DIR%;%MINICONDA_DIR%\scripts;%originalpath%
35+
36+
%MINICONDA_DIR%\scripts\activate %MINICONDA_DIR%
37+
38+
conda config --set always_yes yes
39+
40+
IF DEFINED APPVEYOR_REPO_TAG_NAME conda-build --quiet --no-test --output-folder "c:\projects\artifacts" conda
41+
42+
set path=c:\cygwin64\bin;c:\cygwin64\usr\bin;c:\FPC\3.0.4\bin\i386-win32;c:\Program Files (x86)\Microsoft Visual Studio 14.0\vc\bin;%MINICONDA_DIR%;%MINICONDA_DIR%\scripts;%originalpath%
43+
44+
c:\cygwin64\bin\bash ci/upload_windows.sh
45+
2146
dir ..\artifacts\*.whl ..\artifacts\*.tar.bz2 /s
47+
2248
test: off

ci/build_linux.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
set -e -x
22

3-
# This will run in the docker environment, we need to install CMake
4-
53
cd /io
64

75
if [ ! -f /io/dss_capi/lib/linux_x64/libklusolve.so ]; then

ci/build_linux_conda.sh

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
# Install Miniconda
2-
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh -q
3-
bash miniconda.sh -b -p $HOME/miniconda
4-
export PATH="$HOME/miniconda/bin:$PATH"
5-
conda config --set always_yes yes --set changeps1 no
6-
conda install conda-build anaconda-client
7-
conda update -q conda-build
8-
#conda info -a
1+
if [ -n "$TRAVIS_TAG" ]; then # only run conda-build on tags, takes too long
2+
# Install Miniconda
3+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh -q
4+
bash miniconda.sh -b -p $HOME/miniconda
5+
export PATH="$HOME/miniconda/bin:$PATH"
6+
conda config --set always_yes yes --set changeps1 no
7+
conda install conda-build anaconda-client
8+
conda update -q conda-build
9+
#conda info -a
910

10-
# Build conda packages (no wheels with conda on Linux)
11-
export ARTIFACTS_FOLDER=`readlink -f ./artifacts`
12-
cd dss_python
13-
conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
11+
# Build conda packages (no wheels with conda on Linux)
12+
export ARTIFACTS_FOLDER=`readlink -f ./artifacts`
13+
cd dss_python
14+
conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
1415

15-
# Upload artifacts to anaconda.org
16-
if [ -n "$ANACONDA_API_TOKEN" ]; then
17-
find ../artifacts -name "*.whl" -or -name "*.tar.bz2" | xargs -I {} anaconda upload --no-progress -l main -u pmeira {}
16+
# Upload artifacts to anaconda.org
17+
if [ -n "$ANACONDA_API_TOKEN" ]; then
18+
find ../artifacts -name "*.whl" -or -name "*.tar.bz2" | xargs -I {} anaconda upload --no-progress -l main -u pmeira {}
19+
fi
1820
fi

ci/build_osx.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ for PYVERSION in 2.7 3.4 3.5 3.6 3.7; do
5050
done
5151

5252
# Build conda packages
53-
conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
53+
if [ -n "$TRAVIS_TAG" ]; then # only run conda-build on tags, takes too long
54+
conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
55+
fi
5456

5557
# # Build wheels with conda
5658
# # (if we keep the output section always, the default package
@@ -62,6 +64,8 @@ conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
6264
# git checkout conda/meta.yaml
6365

6466
# Upload artifacts to anaconda.org
65-
if [ -n "$ANACONDA_API_TOKEN" ]; then
66-
find ../artifacts -name "*.whl" -or -name "*.tar.bz2" | xargs -I {} anaconda upload --no-progress -l main -u pmeira {}
67+
if [ -n "$TRAVIS_TAG" ]; then
68+
if [ -n "$ANACONDA_API_TOKEN" ]; then
69+
find ../artifacts -name "*.whl" -or -name "*.tar.bz2" | xargs -I {} anaconda upload --no-progress -l main -u pmeira {}
70+
fi
6771
fi

ci/build_windows.sh

Lines changed: 71 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,65 @@
11
set -e -x
22

33
WGET=wget
4+
ln -s /cygdrive/c /c
45

56
cd ..
67
export ARTIFACTS_FOLDER=`cygpath -a -w ./artifacts`
78

89
# Install Visual Studio Compiler for Python 2.7
910
#choco install -y vcpython27
11+
if [ ! -f "/c/projects/VCForPython27.msi" ]; then
12+
$WGET https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi -q -O /c/projects/VCForPython27.msi
13+
fi
1014
cd dss_python/ci
11-
$WGET https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi -q
1215
cmd "/c install_vcforpython27.bat"
13-
rm -rf VCForPython27.msi
16+
# rm -rf /c/projects/VCForPython27.msi
1417
cd ../..
1518

16-
1719
# Install the FreePascal compiler
18-
$WGET https://sourceforge.net/projects/dss-capi/files/FPC/FPC-win32-win64-3.0.4.7z/download -O FPC-win32-win64-3.0.4.7z -q
19-
7z x -oC:/ FPC-win32-win64-3.0.4.7z
20+
if [ ! -f "/c/projects/FPC-win32-win64-3.0.4.7z" ]; then
21+
$WGET https://sourceforge.net/projects/dss-capi/files/FPC/FPC-win32-win64-3.0.4.7z/download -q -O /c/projects/FPC-win32-win64-3.0.4.7z
22+
fi
23+
7z x -oC:/ c:/projects/FPC-win32-win64-3.0.4.7z
24+
2025
export PATH="$PATH:/c/FPC/3.0.4/bin/i386-win32"
2126
export PATH="$PATH:/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin"
2227

2328

2429
# Download SuiteSparse (once, otherwise the CMake script will download it multiple times)
25-
$WGET http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-5.3.0.tar.gz -O suitesparse.tar.gz -q
26-
tar zxf suitesparse.tar.gz
30+
if [ ! -f "/c/projects/SuiteSparse-5.3.0.tar.gz" ]; then
31+
$WGET http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-5.3.0.tar.gz -O /c/projects/SuiteSparse-5.3.0.tar.gz -q
32+
fi
33+
tar zxf /c/projects/SuiteSparse-5.3.0.tar.gz
2734
export SUITESPARSE_SRC=`cygpath -a -w ./SuiteSparse`
2835

2936
BUILD_WHEELS=1
3037
if [ "$BUILD_WHEELS" == "1" ]; then
3138
# Build KLUSolve
32-
mkdir dss_capi/klusolve/build_x86
33-
mkdir dss_capi/klusolve/build_x64
34-
35-
## x86
36-
cd dss_capi/klusolve/build_x86
37-
cmake .. -DUSE_SYSTEM_SUITESPARSE=OFF -G"Visual Studio 15 2017"
38-
cmake --build . --config Release
39+
if [ "$CONDA_SUBDIR" == "win-32" ]; then
40+
## x86
41+
mkdir dss_capi/klusolve/build_x86
42+
cd dss_capi/klusolve/build_x86
43+
cmake .. -DUSE_SYSTEM_SUITESPARSE=OFF -G"Visual Studio 15 2017"
44+
cmake --build . --config Release
45+
else
46+
## x64
47+
mkdir dss_capi/klusolve/build_x64
48+
cd dss_capi/klusolve/build_x64
49+
cmake .. -DUSE_SYSTEM_SUITESPARSE=OFF -G"Visual Studio 15 2017 Win64"
50+
cmake --build . --config Release
51+
fi
3952

40-
## x64
41-
cd ../build_x64
42-
cmake .. -DUSE_SYSTEM_SUITESPARSE=OFF -G"Visual Studio 15 2017 Win64"
43-
cmake --build . --config Release
4453

4554
# Build DSS C-API
4655
cd ../..
4756
bash ./make_metadata.sh
48-
cmd "/c build_win_x86.bat"
49-
cmd "/c build_win_x64.bat"
57+
if [ "$CONDA_SUBDIR" == "win-32" ]; then
58+
cmd "/c build_win_x86.bat"
59+
else
60+
cmd "/c build_win_x64.bat"
61+
fi
62+
5063
cd ..
5164

5265

@@ -57,7 +70,12 @@ if [ "$BUILD_WHEELS" == "1" ]; then
5770
cd dss_python
5871

5972
# Python 27 is kept last since we rebuild klusolve for it
60-
PYTHON_VERSIONS="35 36 37 27"
73+
if [ "$CONDA_SUBDIR" == "win-32" ]; then
74+
PYTHON_VERSIONS="35 36 37 27"
75+
else
76+
PYTHON_VERSIONS="35-x64 36-x64 37-x64 27-x64"
77+
fi
78+
6179
for A in $PYTHON_VERSIONS
6280
do
6381
if [ "$A" == "27" ]; then
@@ -67,22 +85,17 @@ if [ "$BUILD_WHEELS" == "1" ]; then
6785
cd "$OLD_DIR"
6886
fi
6987

70-
echo Building for Python $A x86...
88+
echo Building for Python $A $CONDA_SUBDIR...
7189
c:/Python${A}/scripts/pip install cffi wheel
7290
rm -rf .eggs build
7391
c:/Python${A}/python setup.py --quiet bdist_wheel --dist-dir="$ARTIFACTS_FOLDER"
74-
75-
echo Building for Python $A x64...
76-
c:/Python${A}-x64/scripts/pip install cffi wheel
77-
rm -rf .eggs build
78-
c:/Python${A}-x64/python setup.py --quiet bdist_wheel --dist-dir="$ARTIFACTS_FOLDER"
7992
done
8093

8194
# Add Miniconda to PATH and install conda-build
8295
# export PATH="/c/miniconda3-x64:/c/miniconda3-x64/scripts:$PATH"
8396
conda config --set always_yes yes
8497
conda install conda-build anaconda-client
85-
conda update -q conda-build
98+
# conda update -q conda-build
8699
else
87100
# Install Miniconda
88101
cd dss_python/ci
@@ -93,21 +106,15 @@ if [ "$BUILD_WHEELS" == "1" ]; then
93106
export PATH="/c/miniconda:/c/miniconda/scripts:$PATH"
94107
conda config --set always_yes yes
95108
conda install conda-build anaconda-client
96-
conda update -q conda-build
97-
#conda update -q conda
98-
#conda info -a
109+
# conda update -q conda-build
110+
# conda update -q conda
111+
# conda info -a
99112

100113
PYTHON_VERSIONS="2.7 3.5 3.6 3.7"
114+
101115
for A in $PYTHON_VERSIONS
102116
do
103-
echo Building for Python $A x86...
104-
export CONDA_FORCE_32BIT=1
105-
conda create -p ../py${A}_x86 python=$A cffi
106-
rm -rf .eggs build
107-
../py$A_x86/python setup.py --quiet bdist_wheel --dist-dir="$ARTIFACTS_FOLDER"
108-
109-
echo Building for Python $A x64...
110-
export CONDA_FORCE_32BIT=
117+
echo Building for Python $A $CONDA_SUBDIR...
111118
conda create -p ../py${A} python=$A cffi
112119
rm -rf .eggs build
113120
../py$A/python setup.py --quiet bdist_wheel --dist-dir="$ARTIFACTS_FOLDER"
@@ -129,30 +136,30 @@ else
129136
fi
130137
conda config --set always_yes yes
131138
conda install conda-build anaconda-client
132-
conda update -q conda-build
139+
# conda install -q conda-build=3.10.9
133140
fi # BUILD_WHEELS
134141

135-
# Build conda packages
136-
export CONDA_FORCE_32BIT=1
137-
conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
138-
export CONDA_FORCE_32BIT=
139-
conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
140-
141-
# # Build wheels with conda
142-
# # (if we keep the output section always, the default package
143-
# # is ignored, uses wrong names, etc.)
144-
# rm -rf conda_wheels
145-
# cp -R conda conda_wheels
146-
# cat conda/meta_wheels.yaml >> conda_wheels/meta.yaml
147-
# export CONDA_FORCE_32BIT=1
148-
# conda-build --output-folder ../artifacts conda_wheels
149-
# export CONDA_FORCE_32BIT=
150-
# conda-build --output-folder ../artifacts conda_wheels
151-
152-
# # undo the change, just in case
153-
# git checkout conda/meta.yaml
154-
155-
if [ -n "$ANACONDA_API_TOKEN" ]; then
156-
echo Upload artifacts to anaconda.org...
157-
find ../artifacts -name "*.whl" -or -name "*.tar.bz2" | xargs -I {} anaconda upload --no-progress -l main -u pmeira {}
158-
fi
142+
# # Build conda packages
143+
# export CONDA_SUBDIR=win-32
144+
# conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
145+
# export CONDA_SUBDIR=win-64
146+
# conda-build --quiet --no-test --output-folder "$ARTIFACTS_FOLDER" conda
147+
148+
# # # Build wheels with conda
149+
# # # (if we keep the output section always, the default package
150+
# # # is ignored, uses wrong names, etc.)
151+
# # rm -rf conda_wheels
152+
# # cp -R conda conda_wheels
153+
# # cat conda/meta_wheels.yaml >> conda_wheels/meta.yaml
154+
# # export CONDA_SUBDIR=win-32
155+
# # conda-build --output-folder ../artifacts conda_wheels
156+
# # export CONDA_SUBDIR=win-64
157+
# # conda-build --output-folder ../artifacts conda_wheels
158+
159+
# # # undo the change, just in case
160+
# # git checkout conda/meta.yaml
161+
162+
# if [ -n "$ANACONDA_API_TOKEN" ]; then
163+
# echo Upload artifacts to anaconda.org...
164+
# find ../artifacts -name "*.whl" -or -name "*.tar.bz2" | xargs -I {} anaconda upload --no-progress -l main -u pmeira {}
165+
# fi

ci/install_vcforpython27.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msiexec /i %cd%\VCForPython27.msi /quiet /qn /norestart ALLUSERS=1
1+
msiexec /i c:\projects\VCForPython27.msi /quiet /qn /norestart ALLUSERS=1

ci/upload_windows.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
if [ -n "$APPVEYOR_REPO_TAG_NAME" ]; then
2+
if [ -n "$ANACONDA_API_TOKEN" ]; then
3+
echo Upload artifacts to anaconda.org...
4+
find ../artifacts -name "*.whl" -or -name "*.tar.bz2" | xargs -I {} anaconda upload --no-progress -l main -u pmeira {}
5+
fi
6+
fi

conda/bld.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set BLD_PREV_DIR=%cd%
22
set BLD_PREV_PATH=%path%
3-
set ELECTRICDSS_SRC_VERSION=0.10.0
4-
set DSS_CAPI_VERSION=0.10.0
3+
set ELECTRICDSS_SRC_VERSION=0.10.1
4+
set DSS_CAPI_VERSION=0.10.1
55

66
REM Clone dependency repositories
77
if not exist ..\electricdss-src (

conda/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
BLD_PREV_DIR=`pwd`
22
BLD_PREV_PATH=$PATH
3-
ELECTRICDSS_SRC_VERSION=0.10.0
4-
DSS_CAPI_VERSION=0.10.0
3+
ELECTRICDSS_SRC_VERSION=0.10.1
4+
DSS_CAPI_VERSION=0.10.1
55

66
echo "Building in $BLD_PREV_DIR"
77

0 commit comments

Comments
 (0)