From 3aa5ec65400ed0b56bd563bb35cd3638b08eb149 Mon Sep 17 00:00:00 2001 From: minggnim <38852608+minggnim@users.noreply.github.com> Date: Sat, 11 Jun 2022 17:34:56 +0100 Subject: [PATCH] update repo with build wheel instructions --- Makefile | 35 ++++++++++++++++++++++++++++++----- README.md | 30 ++++++++++++++++++++++++++++++ setup.py | 10 +++++----- 3 files changed, 65 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 7717a7fce..e2e6d78ee 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,33 @@ clean: perf: python3 tools/perf_talib.py -test: build - LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH} pytest - -sdist: - python3 setup.py sdist --formats=gztar,zip +download: + curl -L -O http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz + +run-docker: + docker run -it -v $(pwd):/io quay.io/pypa/manylinux2014_x86_64 + +install-ta-lib: + tar -xzf ta-lib-0.4.0-src.tar.gz + cd ta-lib/ && ./configure && make && make install && cd .. + +manylinux-wheel: + for PYBIN in $(wildcard /opt/python/*/bin); \ + do \ + $$PYBIN/pip install -r requirements.txt; \ + $$PYBIN/pip wheel ./ -w wheelhouse/; \ + rm -rf build; \ + done + +repair-manylinux-wheel: + for whl in $(wildcard wheelhouse/ta_lib_bin*.whl); \ + do \ + auditwheel repair $$whl -w wheelhouse/; \ + done + +install-test: + rm -rf ta-lib + for PYBIN in $(wildcard /opt/python/*/bin); \ + do \ + $$PYBIN/pip install ta-lib-bin --no-index -f wheelhouse; \ + done \ No newline at end of file diff --git a/README.md b/README.md index ef11572a3..62711a96b 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,36 @@ In addition, this project also supports the use of the [Polars](https://www.pola.rs) and [Pandas](https://pandas.pydata.org) libraries. +This fork provides the binary builds for Linux and the instructions on +how to build binary wheels, so that the dependency requirement of having +TA-Lib installed on the Linux platforms is no longer necessary. + +## Installation pre-build binary + +Install pre-build binary from PyPI +``` +$ pip install ta-lib-bin +``` + +## Build Wheels using [manylinux](https://github.com/pypa/manylinux) + +Install manylinux Docker image +``` +docker run -it -v $(pwd):/io quay.io/pypa/manylinux2014_x86_64 +``` + +Build manylinux Wheel +``` +make install-ta-lib +make manylinux-wheel +make repair-manylinux-wheel +``` + +Test +``` +make install-test +``` + ## Installation You can install from PyPI: diff --git a/setup.py b/setup.py index e3a850c04..326c4ccbb 100644 --- a/setup.py +++ b/setup.py @@ -144,15 +144,15 @@ def build_extensions(self): long_description = f.read() setup( - name='TA-Lib', + name='ta-lib-bin', version='0.4.25', description='Python wrapper for TA-Lib', long_description=long_description, long_description_content_type='text/markdown', - author='John Benediktsson', - author_email='mrjbq7@gmail.com', - url='http://github.com/mrjbq7/ta-lib', - download_url='https://github.com/mrjbq7/ta-lib/releases', + author='Ming Gao', + author_email='ming_gao@outlook.com', + url='https://github.com/minggnim/ta-lib', + download_url='https://github.com/minggnim/ta-lib/releases', license='BSD', classifiers=[ "License :: OSI Approved :: BSD License",