Skip to content

Commit

Permalink
Merge pull request #512 from abergeron/better_conda
Browse files Browse the repository at this point in the history
Better conda
  • Loading branch information
nouiz authored Sep 1, 2017
2 parents 1ddac4b + 25d623f commit 8f21ba2
Show file tree
Hide file tree
Showing 13 changed files with 2,406 additions and 71 deletions.
60 changes: 31 additions & 29 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
version: '0.7.0.{build}'
version: '1.0.{build}' # This number doesn't matter

pull_requests:
do_not_increment_build_number: true

image: Visual Studio 2015

init:
- git config --global core.autocrlf input
- cmd: cmake --version
- cmd: msbuild /version

platform:
- x64

image: Visual Studio 2015

clone_folder: C:\projects\libgpuarray

configuration:
- Release
- Debug

environment:
matrix:
- PYTHON: "C:\\Python27"
VS_PATH: "C:\\Users\\appveyor\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0"
- PYTHON: "C:\\Python35"
VS_PATH: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC"
- CONDA_LOC: "C:\\Miniconda-x64"
- CONDA_LOC: "C:\\Miniconda35-x64"

install:
- python -m pip install mako cython

build_script:
- echo "Python:" "%PYTHON%"
- echo "Config:" "%CONFIGURATION%"
- echo "VS path:" "%VS_PATH%"
- cd "%VS_PATH%"
- vcvarsall x64
- set
- cd C:\projects\libgpuarray
- md %CONFIGURATION%
- cd %CONFIGURATION%
- cmake .. -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "NMake Makefiles"
- cmake --build . --config %CONFIGURATION%

build: script
# This breaks conda-build because of git
- cmd: rmdir C:\cygwin /s /q
- cmd: call %CONDA_LOC%\Scripts\activate.bat
- cmd: set PYTHONUNBUFFERED=1
- cmd: conda install -n root --yes conda conda-env conda-build anaconda-client
# We borrow a trick from conda-forge to fix the VS2008 compiler
- cmd: conda config --append channels conda-forge
- cmd: conda install --yes vs2008_express_vc_python_patch
- cmd: call setup_x64

build: off

test_script:
- cmd: for /f "tokens=*" %%i in ('python -c "import versioneer; print(versioneer.get_version())"') do set GPUARRAY_VERSION=%%i
- cmd: conda build conda
- cmd: mkdir pkgs
- cmd: xcopy "%CONDA_LOC%"\conda-bld\win-64\pygpu* pkgs\ /Y
- cmd: xcopy "%CONDA_LOC%"\conda-bld\win-64\libgpuarray* pkgs\ /Y

artifacts:
- path: pkgs/*
name: "Conda Packages"

#deploy:
# on:
# appveyor_repo_tag: true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pygpu/_version.py export-subst
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include pygpu/_version.py
8 changes: 5 additions & 3 deletions conda/libgpuarray/bld.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
cmake -G"NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
cmake -G "%CMAKE_GENERATOR%" ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
-DCMAKE_C_FLAGS="-I%LIBRARY_PREFIX%\include" ^
"%SRC_DIR%"
if errorlevel 1 exit 1
cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target install
if errorlevel 1 exit 1
cmake --build . --config Release --target install
if errorlevel 1 exit 1
11 changes: 3 additions & 8 deletions conda/libgpuarray/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
{% set version = "0.7.0" %}

package:
name: libgpuarray
version: {{ version }}
version: {{ environ.get('GPUARRAY_VERSION') }}

source:
fn: libgpuarray-{{ version }}.tar.gz
url: https://github.com/Theano/libgpuarray/archive/v{{ version }}.tar.gz
path: ../../

build:
number: 0
skip: true # [win and py35]
features:
- vc9 # [win and py27]
- vc10 # [win and py34]
Expand All @@ -19,11 +15,10 @@ build:
requirements:
build:
- m2-git [win]
- m2-filesystem [win]
- git [not win]
- cmake
- mako
- python
- python # version doesn't matter here
run:
- vs2008_runtime [win and py27]
- vs2010_runtime [win and py34]
Expand Down
9 changes: 4 additions & 5 deletions conda/pygpu/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{% set version = "0.7.0" %}
{% set version = environ.get('GPUARRAY_VERSION') %}

package:
name: pygpu
version: {{ version }}

source:
fn: libgpuarray-{{ version }}.tar.gz
url: https://github.com/Theano/libgpuarray/archive/v{{ version }}.tar.gz
path: ../../

build:
number: 0
Expand All @@ -19,14 +18,14 @@ requirements:
- git [not win]
- python
- cython >=0.25
- numpy x.x
- numpy 1.11
- mako
- setuptools
- libgpuarray =={{ version }}

run:
- python
- numpy x.x
- {{ pin_compatible('numpy', '1.11') }}
- mako
- six
- libgpuarray =={{ version }}
Expand Down
7 changes: 4 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
import versioneer

# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -56,10 +57,10 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.7'
# The full version, including alpha/beta/rc tags.
release = '0.7.0'
release = versioneer.get_version()
# The short X.Y version.
version = '.'.join(release.split('.')[:2])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 4 additions & 2 deletions pygpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ def get_include():
concatenate, hstack, vstack, dstack)
from ._array import ndgpuarray

from .version import fullversion as __version__

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

def test():
from . import tests
from .tests import main
if hasattr(main, "NoseTester"):
main.NoseTester(package=tests).test()

Loading

0 comments on commit 8f21ba2

Please sign in to comment.