Skip to content

Commit f404cf1

Browse files
author
Shlomi Kushchi
authored
Merge pull request #350 from alpacahq/fix_tests_inside_circleci
Loosen package versions to support python >= 3.6
2 parents de0fc4f + 7e9c5c1 commit f404cf1

File tree

3 files changed

+85
-5
lines changed

3 files changed

+85
-5
lines changed

.circleci/config.yml

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
path: test-reports_py2.7.13
3636
destination: test-reports2.7.13
3737

38-
build-python36:
38+
build-test-python36:
3939
docker:
4040
- image: python:3.6.4
4141
working_directory: ~/repo
@@ -58,6 +58,7 @@ jobs:
5858
- run:
5959
name: run tests
6060
command: |
61+
pip install pandas==1.1.5 numpy==1.19.4
6162
python setup.py install
6263
pip install flake8 && flake8 alpaca_trade_api tests
6364
python setup.py test
@@ -71,9 +72,78 @@ jobs:
7172
path: test-reports3.6.4
7273
destination: test-reports3.6.4
7374

75+
build-test-python37:
76+
docker:
77+
- image: python:3.7
78+
working_directory: ~/repo
79+
steps:
80+
- run: echo "hello python 3.7"
81+
- checkout
82+
83+
# Download and cache dependencies
84+
- restore_cache:
85+
keys:
86+
- v1-dependencies-{{ checksum "setup.py" }}
87+
# fallback to using the latest cache if no exact match is found
88+
- v1-dependencies-
89+
90+
# run tests!
91+
# this example uses Django's built-in test-runner
92+
# other common Python testing frameworks include pytest and nose
93+
# https://pytest.org
94+
# https://nose.readthedocs.io
95+
- run:
96+
name: run tests
97+
command: |
98+
python setup.py install
99+
pip install flake8 && flake8 alpaca_trade_api tests
100+
python setup.py test
101+
102+
- save_cache:
103+
paths:
104+
- ./eggs
105+
key: v1-dependencies-{{ checksum "setup.py" }}
106+
107+
- store_artifacts:
108+
path: test-reports3.7
109+
destination: test-reports3.7
110+
111+
build-python38:
112+
docker:
113+
- image: python:3.8
114+
working_directory: ~/repo
115+
steps:
116+
- checkout
117+
- run:
118+
name: make sure install works
119+
command: |
120+
python setup.py install
121+
- run:
122+
name: view installed packages
123+
command: |
124+
pip freeze
125+
126+
build-python39:
127+
docker:
128+
- image: python:3.9
129+
working_directory: ~/repo
130+
steps:
131+
- checkout
132+
- run:
133+
name: make sure install works
134+
command: |
135+
python setup.py install
136+
- run:
137+
name: view installed packages
138+
command: |
139+
pip freeze
140+
74141
workflows:
75142
version: 2
76143
build:
77144
jobs:
78145
# - build-python27
79-
- build-python36
146+
- build-test-python36
147+
- build-test-python37
148+
- build-python38
149+
- build-python39

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ Note this module supports only python version 3.6 and above, due to
1818
the async/await and websockets module dependency.
1919

2020
## Install
21+
We support python 3.x. If you want to work with python < 3.7 please note that these package dropped support for python <3.7 for the following versions:
22+
```
23+
pandas >= 1.2.0
24+
numpy >= 1.20.0
25+
scipy >= 1.6.0
26+
```
27+
The solution - manually install these package before installing alpaca-trade-api. e.g:
28+
```
29+
pip install pandas==1.1.5 numpy==1.19.4 scipy==1.5.4
30+
```
2131

2232
```bash
2333
$ pip3 install alpaca-trade-api

requirements/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
pandas<1.2.0 # this package requires python 3.7 for higher versions
2-
numpy<1.20.0 # this package requires python 3.7 for higher versions
1+
pandas
2+
numpy
33
requests>2,<3
4-
urllib3>1.24,<1.26
4+
urllib3>1.24,<2
55
websocket-client>=0.56.0,<1
66
websockets>=8.0,<9

0 commit comments

Comments
 (0)