Skip to content

Commit

Permalink
Merge pull request #720 from patricksnape/simplify_conda_build
Browse files Browse the repository at this point in the history
Simplify the conda build
  • Loading branch information
Patrick Snape committed Aug 5, 2016
2 parents 68a7cbb + 9efdfc5 commit 4d2a5b6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 23 deletions.
5 changes: 0 additions & 5 deletions conda/bld.bat

This file was deleted.

5 changes: 0 additions & 5 deletions conda/build.sh

This file was deleted.

7 changes: 7 additions & 0 deletions conda/meta.yaml
Expand Up @@ -2,6 +2,13 @@ package:
name: menpo
version: {{ environ['CONDACI_VERSION'] }}

source:
path: ../

build:
number: 0
script: python setup.py install --single-version-externally-managed --record=record.txt

requirements:
build:
- python
Expand Down
43 changes: 30 additions & 13 deletions setup.py
@@ -1,27 +1,45 @@
import os
import platform
import sys
import pkg_resources
from setuptools import setup, find_packages
import versioneer
import glob
from Cython.Build import cythonize
import numpy as np


SYS_PLATFORM = platform.system().lower()
IS_LINUX = 'linux' in SYS_PLATFORM
IS_OSX = 'darwin' == SYS_PLATFORM
IS_WIN = 'windows' == SYS_PLATFORM


# ---- C/C++ EXTENSIONS ---- #
cython_modules = ['menpo/shape/mesh/normals.pyx',
'menpo/transform/piecewiseaffine/fastpwa.pyx',
'menpo/feature/windowiterator.pyx',
'menpo/feature/gradient.pyx',
'menpo/external/skimage/_warps_cy.pyx',
'menpo/image/patches.pyx']
cython_modules = [
'menpo/external/skimage/_warps_cy.pyx',
'menpo/transform/piecewiseaffine/fastpwa.pyx',
'menpo/feature/windowiterator.pyx',
'menpo/feature/gradient.pyx',
'menpo/image/patches.pyx',
'menpo/shape/mesh/normals.pyx'
]

cython_exts = cythonize(cython_modules, quiet=True)
include_dirs = [np.get_include()]
# Perform a small amount of gymnastics to improve the compilation output on
# each platform (including finding numpy without importing it)
numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')
for ext in cython_exts:
if numpy_incl not in ext.include_dirs:
ext.include_dirs.append(numpy_incl)
if IS_LINUX or IS_OSX:
ext.extra_compile_args.append('-Wno-unused-function')


# Please see conda/meta.yaml for other binary dependencies
install_requires = ['numpy>=1.10,<2.0',
'scipy>=0.16,<1.0',
'matplotlib>=1.4,<2.0',
'pillow>=3.0,<4.0',
'Cython>=0.23']
'cython>=0.23']

if sys.version_info.major == 2:
install_requires.append('pathlib==1.0')
Expand All @@ -30,9 +48,8 @@
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='A Python toolkit for handling annotated data',
author='James Booth',
author_email='james.booth08@imperial.ac.uk',
include_dirs=include_dirs,
author='The Menpo Team',
author_email='hello@menpo.org',
ext_modules=cython_exts,
packages=find_packages(),
install_requires=install_requires,
Expand Down

0 comments on commit 4d2a5b6

Please sign in to comment.