Skip to content

Commit 062a760

Browse files
authored
Merge pull request #1 from signals-dev/apidoc
Apidoc
2 parents 766b2fa + a6551eb commit 062a760

File tree

223 files changed

+5901
-18137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+5901
-18137
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- MTV version:
2+
- Python version:
3+
- Node version:
4+
- Operating System:
5+
6+
### Description
7+
8+
Describe what you were trying to get done.
9+
Tell us what happened, what went wrong, and what you expected to happen.
10+
11+
### What I Did
12+
13+
```
14+
Paste the command(s) you ran and the output.
15+
If there was a crash, please include the traceback here.
16+
```

.github/workflows/server.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Server CI
5+
6+
on:
7+
push:
8+
branches: [master, master-dev]
9+
pull_request:
10+
branches: [master, master-dev]
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest]
18+
python-version: [3.6]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install Package
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install .[dev]
30+
- name: Lint with flake8
31+
run: |
32+
make lint
33+
- name: Test with py.test (Flask)
34+
run: |
35+
make test-server

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ tempCodeRunnerFile.ts
44
tempCodeRunnerFile.py
55
mtv.tar*
66
.vscode/
7-
7+
orion-stock/
8+
stock-data/
89

910
# Byte-compiled / optimized / DLL files
1011
__pycache__/
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@ module.exports = {
33
trailingComma: 'all',
44
singleQuote: true,
55
printWidth: 120,
6-
tabWidth: 2,
6+
tabWidth: 4,
77
overrides: [
88
{
9-
files: ['*.scss', '*.css'],
10-
options: {
11-
tabWidth: 4,
12-
},
13-
},
14-
{
15-
files: '*.html',
9+
files: ['*.yml'],
1610
options: {
1711
tabWidth: 2,
18-
singleQuote: false,
1912
},
2013
},
2114
],

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
- mongodb
1818

1919
# Command to install dependencies
20-
install:
20+
install:
2121
- pip install -U tox-travis
2222
- nvm install ${NODE}
2323
- node --version
@@ -28,7 +28,7 @@ before_script:
2828
- cd client && npm install
2929

3030
# Command to run tests
31-
script:
31+
script:
3232
- cd $TRAVIS_BUILD_DIR
3333
- tox # test back-end
3434
- npm -C client run test:karma # test front-end
@@ -37,7 +37,6 @@ after_script:
3737
- npm -C client run test:karma:coverage # test front-end coverage
3838
- npm install -g lcov-result-merger@~1.2.0
3939
- lcov-result-merger 'client/coverage/**/lcov.info' | client/node_modules/coveralls/bin/coveralls.js
40-
4140
# deploy:
4241
# # Automatically build and deploy documentation to GitHub Pages
4342
# - provider: pages

.vscode/launch.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

Makefile

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,47 @@ help:
3434
# ----------------------- session: install ----------------------- #
3535

3636
.PHONY: install
37-
install: clean-build clean-pyc clean-client ## install the packages for running mtv
38-
pip install -e .
39-
$(MAKE) init-db && $(MAKE) load-db-mtv
40-
cd client && npm install --production && npm run build
37+
install: clean-build clean-pyc ## install the packages for running mtv
38+
pip install .
39+
$(MAKE) init-db && $(MAKE) load-db
40+
41+
.PHONY: install-test
42+
install-test: clean-build clean-pyc ## install the package and test dependencies
43+
pip install .[test]
44+
$(MAKE) init-db && $(MAKE) load-db-test
4145

4246
.PHONY: install-develop
43-
install-develop: clean-build clean-pyc clean-client ## install the package in editable mode and dependencies for development
47+
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
4448
pip install -e .[dev]
45-
$(MAKE) init-db && $(MAKE) load-db-mtv
46-
cd client && npm install && npm run build
49+
$(MAKE) init-db && $(MAKE) load-db && $(MAKE) load-db-test
4750

4851
.PHONY: init-db
4952
init-db: clean-db
5053
mkdir -p db-instance
54+
# this folder is for saving the downloaded demo mongodb data
5155
mkdir -p db-instance/data
56+
# this folder is for saving the log files
5257
mkdir -p db-instance/log
58+
# this folder is for saving the newly dumped mongodb data
5359
mkdir -p db-instance/dump
5460

55-
.PHONY: load-db-mtv
56-
load-db-mtv: init-db
57-
rm -f -r db-instance/data/mtv/
61+
.PHONY: load-db
62+
load-db: init-db
5863
curl -o mtv.tar.bz2 "https://d3-ai-mtv.s3.us-east-2.amazonaws.com/mtv.tar.bz2"
5964
tar -xf mtv.tar.bz2 -C ./db-instance/data/ && rm mtv.tar.bz2
6065
mongo mtv --eval "db.dropDatabase()"
6166
mongorestore --db mtv ./db-instance/data/mtv/
6267

68+
.PHONY: load-db-test
69+
load-db-test: init-db
70+
curl -o mtv-test.tar.bz2 "https://d3-ai-mtv.s3.us-east-2.amazonaws.com/mtv-test.tar.bz2"
71+
tar -xf mtv-test.tar.bz2 -C ./db-instance/data/ && rm mtv-test.tar.bz2
72+
mongo mtv-test --eval "db.dropDatabase()"
73+
mongorestore --db mtv-test ./db-instance/data/mtv-test/
74+
6375
# ------------------ session: docker installation ------------------- #
6476
.PHONY: docker-db-up
65-
docker-db-up: init-db ## download data and load them into mongodb
77+
docker-db-up: init-db ## download data and load them into mongodb
6678
curl -o mtv.tar.bz2 "https://d3-ai-mtv.s3.us-east-2.amazonaws.com/mtv.tar.bz2"
6779
tar -xf mtv.tar.bz2 -C ./db-instance/data/ && rm mtv.tar.bz2
6880
docker-compose -f docker-compose-db.yml up
@@ -84,7 +96,7 @@ docker-down: ## remove containers, volumes, and networks
8496
docker-compose down -v
8597

8698
.PHONY: docker-clean
87-
docker-clean: ## remove containers, volumes, networks, and images
99+
docker-clean: ## remove containers, volumes, networks, and images
88100
docker-compose down -v --rmi all
89101

90102
# ----------------------- session: test ----------------------- #
@@ -100,10 +112,6 @@ test-server: ## run tests on server
100112
test-server-flask: ## run tests on server
101113
py.test ./tests/test_flask.py
102114

103-
.PHONY: test-client
104-
test-client: ## run tests on client
105-
npm -C client run test:karma
106-
107115
.PHONY: test-coverage
108116
test-coverage: ## check code coverage quickly with the default Python
109117
coverage run --source mtv -m pytest
@@ -148,9 +156,13 @@ view-docs: docs ## view docs in browser
148156
serve-docs: view-docs ## compile the docs watching for changes
149157
watchmedo shell-command -W -R -D -p '*.rst;*.md' -c '$(MAKE) -C docs html' .
150158

151-
.PHONY: api-docs
152-
api-docs: ## generate server API docs
153-
apidoc -i mtv\\resources\\ -o apidoc\\
159+
.PHONY: apidoc
160+
apidoc: ## generate server API docs
161+
apidoc -i mtv/resources -o apidoc/
162+
163+
.PHONY: view-apidoc
164+
view-apidoc: ## view server API docs
165+
$(BROWSER) apidoc/index.html
154166

155167
# -------------------- session: release ---------------------- #
156168

0 commit comments

Comments
 (0)