Skip to content

Commit

Permalink
ENH: Binstar build files
Browse files Browse the repository at this point in the history
Files requires to build and automatically upload binary files to binstar
which will allow recent version to be installed by binary-only users of
conda.
  • Loading branch information
bashtage committed Sep 19, 2014
1 parent ea554cc commit 29084fa
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.rst
Expand Up @@ -51,6 +51,14 @@ Binaries and source distributions are available from PyPi

http://pypi.python.org/pypi/statsmodels/

Binaries can be installed in Anaconda

conda install statsmodels

Development snapshots are also avaiable in Anaconda

conda install -c https://conda.binstar.org/statsmodels statsmodels


Installation from sources
=========================
Expand Down
27 changes: 27 additions & 0 deletions tools/binstar/README.md
@@ -0,0 +1,27 @@
Binstar
=======

[Binstar](http://binstar.org) is Continuum's solution for binary package distribution. This directory contains the files required for building a binstar package:

* `meta.yaml` - Information about the package and dependencies
* `bld.bat` - Windows batch file called in the build process
* `build.sh` - Linux/OSX batch file called in the build process

Two other helper files are included to automate building across Python 2.7, 3.3 and 3.4.

* `binstar_windows.bat`
* `binstar_linux.sh`

Running either file from statsmodels/binstar will build all three versions and upload them, assuming the account has been authenticated using

```
binstar login
```

Installing from binstar
-----------------------
The most recent snapshot can be installed using

```
conda install -c https://conda.binstar.org/statsmodels statsmodels
```
20 changes: 20 additions & 0 deletions tools/binstar/binstar_linux.sh
@@ -0,0 +1,20 @@
#!/bin/bash

cd ../..
# Python 2.7
export CONDA_PY=27
binstar remove statsmodels/statsmodels/0.6.0_dev/linux-64/statsmodels-0.6.0_dev-np18py27_0.tar.bz2 -f
binstar remove statsmodels/statsmodels/0.6.0_dev/linux-64/statsmodels-0.6.0_dev-np19py27_0.tar.bz2 -f
conda build ./tools/binstar

# Python 3.3
export CONDA_PY=33
binstar remove statsmodels/statsmodels/0.6.0_dev/linux-64/statsmodels-0.6.0_dev-np18py33_0.tar.bz2 -f
binstar remove statsmodels/statsmodels/0.6.0_dev/linux-64/statsmodels-0.6.0_dev-np19py33_0.tar.bz2 -f
conda build ./tools/binstar

# Python 3.4
export CONDA_PY=34
binstar remove statsmodels/statsmodels/0.6.0_dev/linux-64/statsmodels-0.6.0_dev-np18py34_0.tar.bz2 -f
binstar remove statsmodels/statsmodels/0.6.0_dev/linux-64/statsmodels-0.6.0_dev-np19py34_0.tar.bz2 -f
conda build ./tools/binstar
99 changes: 99 additions & 0 deletions tools/binstar/binstar_windows.bat
@@ -0,0 +1,99 @@
REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
REM Batch file to build binstar binaries from statsmodel head for Python 2.7,
REM 3.3 and 3.4
REM
REM Assumes that
REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
REM Python 2.7
REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

REM Get current directory
SET CURRENT_WORKING_DIR=%~dp0

REM Set python version
set CONDA_PY=27

REM Clean up
robocopy C:\Anaconda\conda-bld\work\ c:\temp\conda-work-trash * /MOVE /S
del c:\temp\conda-work-trash\*.*? /s
rmdir C:\Anaconda\conda-bld\work\.git /S /Q
REM Trick to force a delay
call PING 1.1.1.1 -n 1 -w 30000 >NUL

REM Setup compiler
set PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;%PATH%
set INCLUDE=C:\Program Files\Microsoft SDKs\Windows\v7.0\Include;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include;%INCLUDE%
set LIB=C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib\x64;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\amd64
set DISTUTILS_USE_SDK=1
CALL "C:\temp\setenv" /x64 /release

REM Remove existing version
binstar remove statsmodels/statsmodels/0.6.0_dev/win-64\statsmodels-0.6.0_dev-np18py27_0.tar.bz2 --force
binstar remove statsmodels/statsmodels/0.6.0_dev/win-64\statsmodels-0.6.0_dev-np19py27_0.tar.bz2 --force

REM Build binstar
cd ..\..
conda build .\tools\binstar


REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
REM Python 3.3
REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

REM Set python version
set CONDA_PY=33

REM Clean up
cd %CURRENT_WORKING_DIR%
REM Clean up
call PING 1.1.1.1 -n 1 -w 5000 >NUL
robocopy C:\Anaconda\conda-bld\work\ c:\temp\conda-work-trash * /MOVE /S
del c:\temp\conda-work-trash\*.*? /s
rmdir C:\Anaconda\conda-bld\work\.git /S /Q
REM Trick to force a delay
call PING 1.1.1.1 -n 1 -w 30000 >NUL

REM Setup compiler
set PATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;%PATH%
cd C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
set DISTUTILS_USE_SDK=1
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\setenv" /x64 /release

REM Remove existing version
binstar remove statsmodels/statsmodels/0.6.0_dev/win-64\statsmodels-0.6.0_dev-np18py33_0.tar.bz2 --force
binstar remove statsmodels/statsmodels/0.6.0_dev/win-64\statsmodels-0.6.0_dev-np19py33_0.tar.bz2 --force

REM Build binstar
cd %CURRENT_WORKING_DIR%
cd ..\..
conda build .\tools\binstar



REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
REM Python 3.4
REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

REM Set python version
set CONDA_PY=34

REM Clean up
cd %CURRENT_WORKING_DIR%
REM Clean up
call PING 1.1.1.1 -n 1 -w 5000 >NUL
robocopy C:\Anaconda\conda-bld\work\ c:\temp\conda-work-trash * /MOVE /S
del c:\temp\conda-work-trash\*.*? /s
rmdir C:\Anaconda\conda-bld\work\.git /S /Q
REM Trick to force a delay
call PING 1.1.1.1 -n 1 -w 30000 >NUL

REM Remove existing version
binstar remove statsmodels/statsmodels/0.6.0_dev/win-64\statsmodels-0.6.0_dev-np18py34_0.tar.bz2 --force
binstar remove statsmodels/statsmodels/0.6.0_dev/win-64\statsmodels-0.6.0_dev-np19py34_0.tar.bz2 --force

REM Build binstar
cd %CURRENT_WORKING_DIR%
cd ..\..
conda build .\tools\binstar
1 change: 1 addition & 0 deletions tools/binstar/bld.bat
@@ -0,0 +1 @@
python setup.py install
3 changes: 3 additions & 0 deletions tools/binstar/build.sh
@@ -0,0 +1,3 @@
#!/bin/bash

${PYTHON} setup.py install || exit 1;
35 changes: 35 additions & 0 deletions tools/binstar/meta.yaml
@@ -0,0 +1,35 @@
package:
name: statsmodels
version: "0.6.0_dev"

source:
git_url: https://github.com/statsmodels/statsmodels.git

build:
number: 0

requirements:
build:
- python
- distribute
- cython 0.20*
- numpy
- scipy
- pandas
- patsy

run:
- python
- numpy
- numpy
- scipy
- pandas
- patsy

test:
imports:
- statsmodels

about:
home: http://statsmodels.sourceforge.net/
license : BSD License

0 comments on commit 29084fa

Please sign in to comment.