Skip to content

Commit

Permalink
Translation of commit vnpy/vnpy@846ea95
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Hurko committed Sep 24, 2019
0 parents commit e1306c5
Show file tree
Hide file tree
Showing 1,839 changed files with 504,595 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
version: 2
jobs:
flake8:
docker:
- image: circleci/python:3.7
steps:
- checkout
- restore_cache:
keys:
- flake8-dependencies
- run:
name: "create venv for caching"
command: |
python3 -m venv venv
- run:
name: "install flake8"
command: |
. venv/bin/activate
pip install flake8
- save_cache:
paths:
- ./venv
key: flake8-dependencies
- run:
name: "run flake8"
command: |
. venv/bin/activate
flake8
build_ctp_gcc8:
<<: &build_spec
docker:
- image: registry.cn-shanghai.aliyuncs.com/vnpy-ci/gcc-8-python-3.7:1.0
- image: circleci/postgres:latest
environment:
POSTGRES_DB: &db_name "vnpy"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: &db_password "1234"
- image: circleci/mysql:latest
environment:
MYSQL_DATABASE: *db_name
MYSQL_ROOT_PASSWORD: *db_password
- image: circleci/mongo:latest
environment:
<<: &build_environment
VNPY_TEST_POSTGRESQL_PASSWORD: *db_password
VNPY_TEST_MYSQL_PASSWORD: *db_password
VNPY_BUILD_CTP: "1"
VNPY_BUILD_OES: "0"
# best suit for circle-ci
VNPY_BUILD_PARALLEL: "2"
steps:
- checkout
- run:
name: "create venv for caching"
command: |
python3 -m venv venv
- restore_cache:
keys:
- v2-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v2-dependencies-

- run:
name: "showing environments"
command: |
. venv/bin/activate
source ci/env.sh
echo $PWD
python -V
pip list
gcc --version
free
cat /proc/cpuinfo|grep -P "(processor|cpu MHz|model name)"
set
- run:
name: "install some special pip packages"
command: |
. venv/bin/activate
source ci/env.sh
python -m pip --version
python -m pip install --upgrade pip wheel setuptools
python -m pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
bash ci/gitlab_pre_install.sh
- run:
name: "install vnpy and its dependents"
command: |
. venv/bin/activate
source ci/env.sh
bash ./install.sh
- save_cache:
paths:
- ./venv
key: v2-dependencies-{{ checksum "requirements.txt" }}

- run:
name: "test"
command: |
. venv/bin/activate
source ci/env.sh
set
cd tests
python test_all.py
build_oes_gcc8:
<<: *build_spec
environment:
<<: *build_environment
VNPY_BUILD_CTP: "0"
VNPY_BUILD_OES: "1"
python_only:
<<: *build_spec
environment:
<<: *build_environment
VNPY_BUILD_CTP: "0"
VNPY_BUILD_OES: "0"

workflows:
version: 2
build_ctp_gcc8:
jobs:
- build_ctp_gcc8
build_oes_gcc8:
jobs:
- build_oes_gcc8
flake8:
jobs:
- flake8
python_only:
jobs:
- python_only
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
exclude = venv,build,__pycache__,__init__.py,ib,talib,uic
ignore =
E501 line too long, fixed by black
W503 line break before binary operator
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Python
*.pyc
*.egg-info/

# Jupyter
.ipynb_checkpoints

# IDE
.vscode
.idea
*.wpr
*.wpu
.vs
x64

# Temp
build
dist
*.local

# vn.py
.vntrader

# Visual Studio intermediate files
*.exp
*.iobj
*.ipdb
*.pdb

# Documents
_build
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015-present, Xiaoyou Chen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include vnpy *.ico *.ini *.dll *.so *.pyd *.h *.hpp *.cpp *.a
Loading

0 comments on commit e1306c5

Please sign in to comment.