Changes in / [2615dd9:0561c54]


Ignore:
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r2615dd9 r0561c54  
    3939python/*.wav
    4040
     41pip-delete-this-directory.txt
     42
    4143aubio-*.tar.bz2
    4244aubio-*.zip
     45dist/*.tar.gz
    4346
    4447# test sounds
  • MANIFEST.in

    r2615dd9 r0561c54  
    11include AUTHORS COPYING README.md VERSION ChangeLog
    22include python/README.md
     3include this_version.py
    34include Makefile wscript */wscript_build
    45include waf waflib/* waflib/*/*
  • README.md

    r2615dd9 r0561c54  
    11aubio library
    22=============
     3[![Travis build status](https://travis-ci.org/aubio/aubio.svg?branch=master)](https://travis-ci.org/aubio/aubio "Travis build status")
     4[![Appveyor build status](https://ci.appveyor.com/api/projects/status/f3lhy3a57rkgn5yi?svg=true)](https://ci.appveyor.com/project/aubio/aubio/branch/master "Appveyor build status")
     5[![Landscape code health](https://landscape.io/github/aubio/aubio/master/landscape.svg?style=flat)](https://landscape.io/github/aubio/aubio/master "Landscape code health")
     6[![Documentation Status](https://readthedocs.org/projects/aubio/badge/?version=latest)](http://aubio.readthedocs.io/en/latest/?badge=latest "Documentation status")
     7[![Commits since last release](https://img.shields.io/github/commits-since/aubio/aubio/0.4.4.svg?maxAge=2592000)](https://github.com/aubio/aubio "Commits since last release")
    38
    49aubio is a library to label music and sounds. It listens to audio signals and
  • doc/conf.py

    r2615dd9 r0561c54  
    1313
    1414import sys, os
     15
     16# get version using this_version.py
     17sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
     18from this_version import get_aubio_version
    1519
    1620# If extensions (or modules to document with autodoc) are in another directory,
     
    4953#
    5054# The short X.Y version.
    51 version = '0.4'
     55
     56version = get_aubio_version()[:3]
    5257# The full version, including alpha/beta/rc tags.
    53 release = '0.4.5~alpha'
     58release = get_aubio_version()
    5459
    5560# The language for content autogenerated by Sphinx. Refer to documentation
  • python/lib/moresetuptools.py

    r2615dd9 r0561c54  
    55from .gen_external import generate_external, header, output_path
    66
    7 def get_aubio_version():
    8     # read from VERSION
    9     this_file_dir = os.path.dirname(os.path.abspath(__file__))
    10     version_file = os.path.join(this_file_dir, '..', '..', 'VERSION')
    11 
    12     if not os.path.isfile(version_file):
    13         raise SystemError("VERSION file not found.")
    14 
    15     for l in open(version_file).readlines():
    16         #exec (l.strip())
    17         if l.startswith('AUBIO_MAJOR_VERSION'):
    18             AUBIO_MAJOR_VERSION = int(l.split('=')[1])
    19         if l.startswith('AUBIO_MINOR_VERSION'):
    20             AUBIO_MINOR_VERSION = int(l.split('=')[1])
    21         if l.startswith('AUBIO_PATCH_VERSION'):
    22             AUBIO_PATCH_VERSION = int(l.split('=')[1])
    23         if l.startswith('AUBIO_VERSION_STATUS'):
    24             AUBIO_VERSION_STATUS = l.split('=')[1].strip()[1:-1]
    25 
    26     if AUBIO_MAJOR_VERSION is None or AUBIO_MINOR_VERSION is None \
    27             or AUBIO_PATCH_VERSION is None:
    28         raise SystemError("Failed parsing VERSION file.")
    29 
    30     verstr = '.'.join(map(str, [AUBIO_MAJOR_VERSION,
    31                                      AUBIO_MINOR_VERSION,
    32                                      AUBIO_PATCH_VERSION]))
    33 
    34     if AUBIO_VERSION_STATUS is not None:
    35         verstr += AUBIO_VERSION_STATUS
    36     return verstr
    37 
    38 def get_aubio_pyversion():
    39     # convert to version for python according to pep 440
    40     # see https://www.python.org/dev/peps/pep-0440/
    41     verstr = get_aubio_version()
    42     if '~alpha' in verstr:
    43         verstr = verstr.split('~')[0] + 'a1'
    44     # TODO: add rc, .dev, and .post suffixes, add numbering
    45     return verstr
     7from this_version import get_aubio_version
    468
    479# inspired from https://gist.github.com/abergmeier/9488990
     
    9456    ext.libraries += ['aubio']
    9557
    96 def add_local_aubio_sources(ext, usedouble = False):
     58def add_local_aubio_sources(ext):
    9759    """ build aubio inside python module instead of linking against libaubio """
    9860    print("Info: libaubio was not installed or built locally with waf, adding src/")
     
    10264
    10365def add_local_macros(ext, usedouble = False):
     66    if usedouble:
     67        ext.define_macros += [('HAVE_AUBIO_DOUBLE', 1)]
    10468    # define macros (waf puts them in build/src/config.h)
    10569    for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H',
     
    194158    def build_extension(self, extension):
    195159        if self.enable_double or 'HAVE_AUBIO_DOUBLE' in os.environ:
    196             extension.define_macros += [('HAVE_AUBIO_DOUBLE', 1)]
    197160            enable_double = True
    198161        else:
     
    205168            if os.path.isfile(os.path.join('src', 'aubio.h')):
    206169                add_local_aubio_header(extension)
    207             add_local_macros(extension)
     170            add_local_macros(extension, usedouble=enable_double)
    208171            # look for a local waf build
    209172            if os.path.isfile(os.path.join('build','src', 'fvec.c.1.o')):
     
    213176                add_external_deps(extension, usedouble=enable_double)
    214177                # add libaubio sources and look for optional deps with pkg-config
    215                 add_local_aubio_sources(extension, usedouble=enable_double)
     178                add_local_aubio_sources(extension)
    216179        # generate files python/gen/*.c, python/gen/aubio-generated.h
     180        extension.include_dirs += [ output_path ]
    217181        extension.sources += generate_external(header, output_path, overwrite = False,
    218182                usedouble=enable_double)
  • python/tests/test_sink.py

    r2615dd9 r0561c54  
    118118
    119119    def test_read_with(self):
    120         sink_path =get_tmp_sink_path()
     120        samplerate = 44100
     121        sink_path = get_tmp_sink_path()
    121122        vec = fvec(128)
    122123        with sink(sink_path, samplerate) as g:
    123             for i in range(10):
     124            for _ in range(10):
    124125                g(vec, 128)
    125126
  • python/tests/test_source.py

    r2615dd9 r0561c54  
    66from aubio import source
    77from .utils import list_all_sounds
    8 import numpy as np
    98
    109import warnings
  • setup.py

    r2615dd9 r0561c54  
    33import sys, os.path, glob
    44from setuptools import setup, Extension
    5 from python.lib.moresetuptools import *
     5from python.lib.moresetuptools import build_ext, CleanGenerated
    66# function to generate gen/*.{c,h}
    7 from python.lib.gen_external import generate_external, header, output_path
     7from this_version import get_aubio_version, get_aubio_pyversion
    88
    99__version__ = get_aubio_pyversion()
     10__aubio_version__ = get_aubio_version()
    1011
    1112include_dirs = []
    1213library_dirs = []
    13 define_macros = [('AUBIO_VERSION', '%s' % __version__)]
     14define_macros = [('AUBIO_VERSION', '%s' % __aubio_version__)]
    1415extra_link_args = []
    1516
    1617include_dirs += [ 'python/ext' ]
    17 include_dirs += [ output_path ] # aubio-generated.h
    1818try:
    1919    import numpy
  • wscript

    r2615dd9 r0561c54  
    1515APPNAME = 'aubio'
    1616
    17 # source VERSION
    18 for l in open('VERSION').readlines(): exec (l.strip())
    19 
    20 VERSION = '.'.join ([str(x) for x in [
    21     AUBIO_MAJOR_VERSION,
    22     AUBIO_MINOR_VERSION,
    23     AUBIO_PATCH_VERSION
    24     ]]) + AUBIO_VERSION_STATUS
    25 
    26 LIB_VERSION = '.'.join ([str(x) for x in [
    27     LIBAUBIO_LT_CUR,
    28     LIBAUBIO_LT_REV,
    29     LIBAUBIO_LT_AGE]])
     17from this_version import *
     18
     19VERSION = get_aubio_version()
     20LIB_VERSION = get_libaubio_version()
    3021
    3122top = '.'
     
    260251        # one of fftwf or fftw3f
    261252        if (ctx.options.enable_fftw3f != False):
    262             ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    263                     args = '--cflags --libs',
     253            ctx.check_cfg(package = 'fftw3f',
     254                    args = '--cflags --libs fftw3f >= 3.0.0',
    264255                    mandatory = ctx.options.enable_fftw3f)
    265256            if (ctx.options.enable_double == True):
     
    270261            # enable_double
    271262            if (ctx.options.enable_double == True):
    272                 ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
    273                         args = '--cflags --libs', mandatory =
    274                         ctx.options.enable_fftw3)
     263                ctx.check_cfg(package = 'fftw3',
     264                        args = '--cflags --libs fftw3 >= 3.0.0.',
     265                        mandatory = ctx.options.enable_fftw3)
    275266            else:
    276                 ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    277                         args = '--cflags --libs',
     267                ctx.check_cfg(package = 'fftw3f',
     268                        args = '--cflags --libs fftw3f >= 3.0.0',
    278269                        mandatory = ctx.options.enable_fftw3)
    279270        ctx.define('HAVE_FFTW3', 1)
     
    291282    # check for libsndfile
    292283    if (ctx.options.enable_sndfile != False):
    293         ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
    294                 args = '--cflags --libs',
     284        ctx.check_cfg(package = 'sndfile',
     285                args = '--cflags --libs sndfile >= 1.0.4',
    295286                mandatory = ctx.options.enable_sndfile)
    296287
     
    304295                    color = 'YELLOW')
    305296    if (ctx.options.enable_samplerate != False):
    306         ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
    307                 args = '--cflags --libs',
     297        ctx.check_cfg(package = 'samplerate',
     298                args = '--cflags --libs samplerate >= 0.0.15',
    308299                mandatory = ctx.options.enable_samplerate)
    309300
     
    316307    # check for libav
    317308    if (ctx.options.enable_avcodec != False):
    318         ctx.check_cfg(package = 'libavcodec', atleast_version = '54.35.0',
    319                 args = '--cflags --libs', uselib_store = 'AVCODEC',
     309        ctx.check_cfg(package = 'libavcodec',
     310                args = '--cflags --libs libavcodec >= 54.35.0',
     311                uselib_store = 'AVCODEC',
    320312                mandatory = ctx.options.enable_avcodec)
    321         ctx.check_cfg(package = 'libavformat', atleast_version = '52.3.0',
    322                 args = '--cflags --libs', uselib_store = 'AVFORMAT',
     313        ctx.check_cfg(package = 'libavformat',
     314                args = '--cflags --libs libavformat >= 52.3.0',
     315                uselib_store = 'AVFORMAT',
    323316                mandatory = ctx.options.enable_avcodec)
    324         ctx.check_cfg(package = 'libavutil', atleast_version = '52.3.0',
    325                 args = '--cflags --libs', uselib_store = 'AVUTIL',
     317        ctx.check_cfg(package = 'libavutil',
     318                args = '--cflags --libs libavutil >= 52.3.0',
     319                uselib_store = 'AVUTIL',
    326320                mandatory = ctx.options.enable_avcodec)
    327         ctx.check_cfg(package = 'libswresample', atleast_version = '2.3.0',
    328                 args = '--cflags --libs', uselib_store = 'SWRESAMPLE',
     321        ctx.check_cfg(package = 'libswresample',
     322                args = '--cflags --libs libswresample >= 2.3.0',
     323                uselib_store = 'SWRESAMPLE',
    329324                mandatory = False)
    330325        if 'HAVE_SWRESAMPLE' not in ctx.env:
    331             ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
    332                     args = '--cflags --libs', uselib_store = 'AVRESAMPLE',
     326            ctx.check_cfg(package = 'libavresample',
     327                    args = '--cflags --libs libavresample >= 1.0.1',
     328                    uselib_store = 'AVRESAMPLE',
    333329                    mandatory = False)
    334330
Note: See TracChangeset for help on using the changeset viewer.