Skip to content

Commit

Permalink
update repo with build wheel instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
minggnim committed Jun 11, 2022
1 parent 0a12097 commit 3aa5ec6
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 10 deletions.
35 changes: 30 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3aa5ec6

Please sign in to comment.