Skip to content

Commit aa8db03

Browse files
committed
Working on release workflow.
1 parent a85fe02 commit aa8db03

File tree

4 files changed

+30
-21
lines changed

4 files changed

+30
-21
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
on:
22
workflow_dispatch:
33
push:
4-
tags:
5-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
4+
5+
# tags:
6+
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
67

78
name: Creating release
89

910
env:
10-
CIBW_TEST_EXTRAS: test
11+
CIBW_BEFORE_TEST: "pip install -r requirements_test.txt"
1112
CIBW_TEST_COMMAND: "pytest {project}/tests"
1213
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"
13-
CIBW_ARCHS_MACOS: "x86_64 universal2"
14-
CIBW_BEFORE_BUILD_LINUX: "yum install -y gcc && curl -sL http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && tar -zxvf ta-lib-0.4.0-src.tar.gz && rm ta-lib-0.4.0-src.tar.gz && cd ta-lib && ./configure && make && make install"
14+
CIBW_ARCHS_MACOS: "x86_64 arm64"
15+
CIBW_BEFORE_BUILD: "pip install -r requirements_dev.txt"
16+
# Polars is needed for the test suite, and Polars currently is only building binary packages for py3.6.
17+
# So, we have to install rust before every build.
18+
CIBW_BEFORE_BUILD_LINUX: |
19+
curl -L -s https://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz -o ta.tar.gz && \
20+
tar -zxvf ta.tar.gz && \
21+
rm ta.tar.gz && \
22+
cd ta-lib && \
23+
./configure && \
24+
make && \
25+
make install
1526
CIBW_BEFORE_BUILD_MACOS: "brew install ta-lib"
16-
CIBW_BEFORE_BUILD_WINDOWS: "curl -sL http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-msvc.zip -o $HOME/ta-lib.zip --create-dirs && 7z x $HOME/ta-lib.zip -o/c/ta-lib && mv /c/ta-lib/ta-lib/* /c/ta-lib/ && rm -rf /c/ta-lib/ta-lib && cd /c/ta-lib/c/make/cdr/win32/msvc && nmake"
17-
27+
CIBW_BEFORE_BUILD_WINDOWS: |
28+
curl -L -s https://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-msvc.zip -o ta.zip && 7z x ta.zip -o/c/ta-lib && mv /c/ta-lib/ta-lib/* /c/ta-lib/ && rm -rf /c/ta-lib/ta-lib && cd /c/ta-lib/c/make/cdr/win32/msvc && nmake
1829
1930
jobs:
2031
# Build & test simple source release before wasting hours building and
@@ -32,18 +43,15 @@ jobs:
3243

3344
- name: Installing python build dependencies
3445
run: |
35-
python -m pip install --upgrade pip
36-
python -m pip install --upgrade setuptools
46+
python -m pip install --upgrade pip wheel
47+
python -m pip install -r requirements.txt
48+
python -m pip install -r requirements_test.txt
49+
pip install flake8 pytest
3750
3851
- name: Building source distribution
3952
run: |
40-
pip install -e ".[release]"
4153
python setup.py sdist
4254
43-
- name: Ensuring documentation builds
44-
run: |
45-
cd docs && make clean && make html
46-
4755
- uses: actions/upload-artifact@v2
4856
with:
4957
path: dist/*.tar.gz
@@ -53,12 +61,10 @@ jobs:
5361
name: "[${{ strategy.job-index }}/${{ strategy.job-total }}] py${{ matrix.py }} on ${{ matrix.os }}"
5462
runs-on: ${{ matrix.os }}
5563
strategy:
56-
fail-fast: true
64+
fail-fast: false
5765
matrix:
5866
os: [ubuntu-20.04, windows-2019, macos-10.15]
59-
# cp - CPython
60-
# pp - PyPy
61-
py: [cp37", "cp38", "cp39", "cp310", "pp37"]
67+
py: ["cp37", "cp38", "cp39", "cp310"]
6268

6369
steps:
6470
- uses: actions/checkout@v2

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python -m pip install --upgrade pip wheel
3838
python -m pip install -r requirements.txt
3939
python -m pip install -r requirements_test.txt
40-
pip install flake8 pytest
40+
pip install flake8 pytest polars
4141
env:
4242
DEPS_PATH: ${{ github.workspace }}/dependencies
4343
TA_INCLUDE_PATH: ${{ github.workspace }}/dependencies/include

requirements_test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
-r requirements.txt
22
pandas
33
pytest
4-
polars

tests/test_polars.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import numpy as np
2+
import pytest
23
from numpy.testing import assert_array_equal
3-
import polars as pl
44

55
import talib
66
from talib import abstract
77

8+
9+
pl = pytest.importorskip('polars')
10+
11+
812
def test_MOM():
913
values = pl.Series([90.0,88.0,89.0])
1014
result = talib.MOM(values, timeperiod=1)

0 commit comments

Comments
 (0)