Skip to content

Commit

Permalink
Merge pull request #24 from r9y9/windows-ci
Browse files Browse the repository at this point in the history
Start windows CI
  • Loading branch information
r9y9 committed Sep 29, 2015
2 parents 04293af + cc2d10a commit 2f5ea04
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.
53 changes: 53 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
environment:
matrix:
- PYTHON_VERSION: "2.7"
PYTHON_ARCH: "32"
MINICONDA: C:\Miniconda

- PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"
MINICONDA: C:\Miniconda-x64

- PYTHON_VERSION: "3.4"
PYTHON_ARCH: "32"
MINICONDA: C:\Miniconda3

# Disable this for now
# ref: http://stackoverflow.com/questions/4676728
# - PYTHON_VERSION: "3.4"
# PYTHON_ARCH: "64"
# MINICONDA: C:\Miniconda3-x64

branches:
only:
- master
- /release-.*/

skip_commits:
message: /\[av skip\]/

notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false

init:
- "ECHO %PYTHON_VERSION% %PYTHON_ARCH% %MINICONDA%"

install:
- "SET PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda config --add channels pypi
- conda info -a
- "conda create -q -n test-environment python=%PYTHON_VERSION% numpy scipy cython nose coverage six"
- activate test-environment

build_script:
- ls /c/projects/pysptk/lib/SPTK/
- git submodule update --init --recursive
- pip install -e .

test_script:
- nosetests --with-coverage --cover-package=pysptk -v -w tests/
2 changes: 1 addition & 1 deletion pysptk/sptk.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cdef enum Boolean:
FA = 0
TR = 1

cdef extern from "../lib/SPTK/include/SPTK.h":
cdef extern from "SPTK.h":

# Library routines
double _agexp "agexp"(double r, double x, double y)
Expand Down
28 changes: 18 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,35 @@
else:
ext = '.c'
cmdclass = {}
if not os.path.exists("pysptk/sptk" + ext):
if not os.path.exists(join("pysptk", "sptk" + ext)):
raise RuntimeError("Cython is required to generate C codes.")

# SPTK sources
src_top = "lib/SPTK"
src_top = join("lib", "SPTK")
src_bin_top = join(src_top, "bin")
swipe_src = [
join(src_top, 'bin/pitch/swipe/swipe.c'),
join(src_top, 'bin/pitch/swipe/vector.c'),
join(src_bin_top, "pitch", "swipe", "swipe.c"),
join(src_bin_top, "pitch", "swipe", "vector.c"),
]
hts_engine_src = glob(join(src_top, 'bin/vc/hts_engine_API/*.c'))
sptklib_src = glob(join(src_top, 'lib/*.c'))
sptk_src = glob(join(src_top, 'bin/*/_*.c'))
sptklib_src = glob(join(src_top, "lib", "*.c"))
sptk_src = glob(join(src_bin_top, "*", "_*.c"))

# collect all sources
sptk_all_src = sptk_src + sptklib_src + swipe_src + hts_engine_src
sptk_all_src = sptk_src + sptklib_src + swipe_src

# Filter ignore list
ignore_bin_list = [join(src_bin_top, "wavjoin"), join(src_bin_top, "wavsplit"),
join(src_bin_top, "vc")]
for ignore in ignore_bin_list:
sptk_all_src = list(
filter(lambda s: not s.startswith(ignore), sptk_all_src))

# define core cython module
ext_modules = [Extension(
name="pysptk.sptk",
sources=["pysptk/sptk" + ext] + sptk_all_src,
include_dirs=[np.get_include(), join(os.getcwd(), 'lib/SPTK/include')],
sources=[join("pysptk", "sptk" + ext)] + sptk_all_src,
include_dirs=[np.get_include(), join(
os.getcwd(), "lib", "SPTK", "include")],
language="c",
)]

Expand Down

0 comments on commit 2f5ea04

Please sign in to comment.