diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0f10607f8..338049105 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,16 +2,16 @@ name: Tests on: push: - branches: [ master ] + branches: [ 0.5 ] pull_request: - branches: [ master ] + branches: [ 0.5 ] jobs: build: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG b/CHANGELOG index ebf70ee55..9b217e46a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,21 @@ - [FIX]: Make sure this wrapper works with TA-Lib 0.6.1 and newer releases. +0.5.5 +===== + +- [FIX]: Fix for numpy 2.3.0, which removed the npy_1_7_deprecated_api + +0.5.4 +===== + +- [FIX]: Fix lib name on windows. + +0.5.3 +===== + +- [BUG]: Make this release only support TA-Lib 0.4.0. + 0.5.2 ===== @@ -20,6 +35,21 @@ - [NEW]: Upgrade to Numpy 2.0 +0.4.38 +====== + +- [FIX]: Fix lib name on windows. + +0.4.37 +====== + +- [FIX]: Make sure to pin numpy<2 in the setup.py. + +0.4.36 +====== + +- [BUG]: Make this release only support TA-Lib 0.4.0 + 0.4.35 ====== diff --git a/pyproject.toml b/pyproject.toml index 7a3bf8472..16d5a2611 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ta-lib" -version = "0.6.0" +version = "0.5.5" dynamic = ["authors", "classifiers", "description", "license", "readme"] dependencies = [ "setuptools", diff --git a/setup.py b/setup.py index 7b4a9df7b..265825f2a 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,8 @@ platform_supported = False +lib_talib_name = 'ta_lib' # the name as of TA-Lib 0.4.0 + if any(s in sys.platform for s in ['darwin', 'linux', 'bsd', 'sunos']): platform_supported = True include_dirs = [ @@ -62,8 +64,6 @@ except ImportError: has_cython = False -lib_talib_name = 'ta-lib' # the name as of TA-Lib 0.6.1 - for path in library_dirs: try: files = os.listdir(path) @@ -91,7 +91,6 @@ def __setitem__(self, key, value): super(LazyBuildExtCommandClass, self).__setitem__(key, value) def __getitem__(self, key): - global include_dirs if key != 'build_ext': return super(LazyBuildExtCommandClass, self).__getitem__(key) @@ -143,7 +142,7 @@ def build_extensions(self): setup( name='TA-Lib', - version='0.6.0', + version='0.5.5', description='Python wrapper for TA-Lib', long_description=long_description, long_description_content_type='text/markdown', diff --git a/talib/__init__.py b/talib/__init__.py index 56d9c7d39..32ac60179 100644 --- a/talib/__init__.py +++ b/talib/__init__.py @@ -132,7 +132,7 @@ def wrapper(*args, **kwds): setattr(stream, func_name, wrapped_func) globals()[stream_func_name] = wrapped_func -__version__ = '0.6.0' +__version__ = '0.5.5' # In order to use this python library, talib (i.e. this __file__) will be # imported at some point, either explicitly or indirectly via talib.func diff --git a/talib/_func.pxi b/talib/_func.pxi index 5d60d7dd3..aebfabce3 100644 --- a/talib/_func.pxi +++ b/talib/_func.pxi @@ -22,7 +22,7 @@ cdef np.ndarray check_array(np.ndarray real): raise Exception("input array type is not double") if real.ndim != 1: raise Exception("input array has wrong dimensions") - if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + if not (PyArray_FLAGS(real) & np.NPY_ARRAY_C_CONTIGUOUS): real = PyArray_GETCONTIGUOUS(real) return real @@ -122,7 +122,7 @@ cdef np.ndarray make_double_array(np.npy_intp length, int lookback): cdef: np.ndarray outreal double* outreal_data - outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_ARRAY_DEFAULT) outreal_data = outreal.data for i from 0 <= i < min(lookback, length): outreal_data[i] = NaN @@ -132,7 +132,7 @@ cdef np.ndarray make_int_array(np.npy_intp length, int lookback): cdef: np.ndarray outinteger int* outinteger_data - outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_ARRAY_DEFAULT) outinteger_data = outinteger.data for i from 0 <= i < min(lookback, length): outinteger_data[i] = 0 diff --git a/talib/_ta_lib.c b/talib/_ta_lib.c index e45816832..e80810f21 100644 --- a/talib/_ta_lib.c +++ b/talib/_ta_lib.c @@ -12451,7 +12451,7 @@ static PyArrayObject *__pyx_f_5talib_7_ta_lib_check_array(PyArrayObject *__pyx_v } - __pyx_t_1 = (!((PyArray_FLAGS(__pyx_v_real) & NPY_C_CONTIGUOUS) != 0)); + __pyx_t_1 = (!((PyArray_FLAGS(__pyx_v_real) & NPY_ARRAY_C_CONTIGUOUS) != 0)); if (__pyx_t_1) { __pyx_t_2 = ((PyObject *)PyArray_GETCONTIGUOUS(__pyx_v_real)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 26, __pyx_L1_error) @@ -12844,7 +12844,7 @@ static PyArrayObject *__pyx_f_5talib_7_ta_lib_make_double_array(npy_intp __pyx_v int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_double_array", 1); - __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_DEFAULT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 125, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_length), NPY_DOUBLE, NPY_ARRAY_DEFAULT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_outreal = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; @@ -12900,7 +12900,7 @@ static PyArrayObject *__pyx_f_5talib_7_ta_lib_make_int_array(npy_intp __pyx_v_le int __pyx_clineno = 0; __Pyx_RefNannySetupContext("make_int_array", 1); - __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_DEFAULT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 135, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_length), NPY_INT32, NPY_ARRAY_DEFAULT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_outinteger = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; diff --git a/tools/generate_func.py b/tools/generate_func.py index 5a625ef08..ae36afc8e 100644 --- a/tools/generate_func.py +++ b/tools/generate_func.py @@ -73,7 +73,7 @@ raise Exception("input array type is not double") if real.ndim != 1: raise Exception("input array has wrong dimensions") - if not (PyArray_FLAGS(real) & np.NPY_C_CONTIGUOUS): + if not (PyArray_FLAGS(real) & np.NPY_ARRAY_C_CONTIGUOUS): real = PyArray_GETCONTIGUOUS(real) return real @@ -173,7 +173,7 @@ cdef: np.ndarray outreal double* outreal_data - outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_DEFAULT) + outreal = PyArray_EMPTY(1, &length, np.NPY_DOUBLE, np.NPY_ARRAY_DEFAULT) outreal_data = outreal.data for i from 0 <= i < min(lookback, length): outreal_data[i] = NaN @@ -183,7 +183,7 @@ cdef: np.ndarray outinteger int* outinteger_data - outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_DEFAULT) + outinteger = PyArray_EMPTY(1, &length, np.NPY_INT32, np.NPY_ARRAY_DEFAULT) outinteger_data = outinteger.data for i from 0 <= i < min(lookback, length): outinteger_data[i] = 0