diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 8133abdc..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,19 +0,0 @@ -[bumpversion] -current_version = (0, 1, 0, 'final', 0) -commit = False -tag = False -parse = (?P\d+)\,\ (?P\d+)\,\ (?P\d+)\,\ \'(?P\S+)\'\,\ (?P\d+) -serialize = - {major}, {minor}, {patch}, '{release}', {build} - -[bumpversion:part:release] -optional_value = final -values = - alpha - candidate - final - -[bumpversion:part:build] - -[bumpversion:file:aat/_version.py] - diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71ae4c19..79201c0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,14 +29,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Install yarn - run: npm install -g yarn - - name: Install system dependencies run: | sudo apt-get install libboost-dev @@ -52,16 +44,11 @@ jobs: run: | python -m pip install -U cpplint numpy pip pyarrow pyEX setuptools tqdm twine wheel python -m pip install -e .[dev] - cd js; yarn - name: Lint Python run: | make lintpy - - name: Lint JS - run: | - make lintjs - - name: Lint C++ run: | make lintcpp diff --git a/Makefile b/Makefile index ccf22aa0..d1722205 100644 --- a/Makefile +++ b/Makefile @@ -26,9 +26,6 @@ build: buildext ## build the package debug: ## build debug build of the package DEBUG=1 $(PYTHON) setup.py build -js: ## build the js assets - cd js; yarn build - install: ## install the package $(PYTHON) -m pip install . @@ -41,9 +38,6 @@ testpycpp: ## Make unit tests # AAT_USE_CPP=1 $(PYTHON) -m pytest -vvv ./aat/tests --cov=aat --junitxml=python_junit.xml --cov-report=xml --cov-branch --capture=no AAT_USE_CPP=1 $(PYTHON) -m pytest -vs ./aat/tests -testjs: ## Make js tests - cd js; yarn test - testruns: testrunscsv testrunsiex ## Run a few examples as a live end-to-end test testrunscsv: @@ -57,18 +51,15 @@ testrunsiex: TESTING=1 $(PYTHON) -m aat.strategy.sample.iex.momentum TESTING=1 $(PYTHON) -m aat.strategy.sample.iex.golden_death -lint: lintpy lintjs lintcpp ## run all linters +lint: lintpy lintcpp ## run all linters lintpy: ## run python linter $(PYTHON) -m flake8 aat setup.py -lintjs: ## run js linter - cd js; yarn lint - lintcpp: ## run cpp linter cpplint --linelength=120 --recursive aat/cpp/{src,include} -fix: fixpy fixjs fixcpp ## run all fixers +fix: fixpy fixcpp ## run all fixers fixpy: ## run autopep8 fix $(PYTHON) -m black aat/ setup.py @@ -76,9 +67,6 @@ fixpy: ## run autopep8 fix fixcpp: ## run clang-format clang-format -i -style=file `find ./aat/cpp/{src,include} -name "*.*pp"` -fixjs: ## run clang-format - cd js; yarn fix - annotate: ## MyPy type annotation check $(PYTHON) -m mypy aat @@ -92,14 +80,13 @@ docs: ## Build the sphinx docs make -C docs html open ./docs/_build/html/index.html -dist: js ## create dists +dist: ## create dists rm -rf dist build python setup.py sdist bdist_wheel python -m twine check dist/* publish: dist ## dist to pypi and npm python -m twine upload dist/* --skip-existing - cd js; npm publish || echo "can't publish - might already exist" clean: ## clean the repository find . -name "__pycache__" | xargs rm -rf @@ -117,5 +104,5 @@ help: print-%: @echo '$*=$($*)' -.PHONY: run buildext build js install tests lint fix docs dist clean help fixcpp +.PHONY: run buildext build install tests lint fix docs dist clean help fixcpp diff --git a/aat/__init__.py b/aat/__init__.py index 18bcbbb1..94a0019e 100644 --- a/aat/__init__.py +++ b/aat/__init__.py @@ -14,3 +14,5 @@ ) from .engine import TradingEngine # noqa: F401 from .strategy import * # noqa: F401, F403 + +__version__ = "0.1.0" diff --git a/aat/_version.py b/aat/_version.py deleted file mode 100644 index 9e9fcd38..00000000 --- a/aat/_version.py +++ /dev/null @@ -1,21 +0,0 @@ -from collections import namedtuple - -VersionInfo = namedtuple( - "VersionInfo", ["major", "minor", "micro", "releaselevel", "serial"] -) - -# DO NOT EDIT THIS DIRECTLY! It is managed by bumpversion -version_info = VersionInfo(0, 1, 0, "final", 0) - -_specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""} - -__version__ = "{}.{}.{}{}".format( - version_info.major, - version_info.minor, - version_info.micro, - ( - "" - if version_info.releaselevel == "final" - else _specifier_[version_info.releaselevel] + "." + str(version_info.serial) - ), -) diff --git a/docker/manylinux2010/Dockerfile b/docker/manylinux2010/Dockerfile deleted file mode 100644 index 280bf6ce..00000000 --- a/docker/manylinux2010/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM quay.io/pypa/manylinux2010_x86_64 -RUN yum -y install sudo wget - -RUN rm -rf /opt/python/cp37-cp37m/bin/auditwheel -RUN cp -arf /opt/python/cp37-cp37m/* /usr/local/ -ENV PATH=/usr/local/bin:$PATH -RUN python3 -m pip install pybind11 codecov mock flake8 pytest pytest-cov - -# install node -RUN curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash - -RUN yum install -y nodejs - -RUN npm install --global yarn -RUN yarn --version diff --git a/docker/manylinux2014/Dockerfile b/docker/manylinux2014/Dockerfile deleted file mode 100644 index 8a77b520..00000000 --- a/docker/manylinux2014/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM quay.io/pypa/manylinux2014_x86_64 -RUN yum -y install sudo wget - -RUN rm -rf /opt/python/cp37-cp37m/bin/auditwheel -RUN cp -arf /opt/python/cp37-cp37m/* /usr/local/ -ENV PATH=/usr/local/bin:$PATH -RUN python3 -m pip install pybind11 codecov mock flake8 pytest pytest-cov - -# install node -RUN curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash - -RUN yum install -y nodejs - -RUN npm install --global yarn -RUN yarn --version diff --git a/docs/conf.py b/docs/conf.py index 639d6eef..c2e3f747 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,7 +23,8 @@ import subprocess import sphinx_rtd_theme from recommonmark.transform import AutoStructify -sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) # -- General configuration ------------------------------------------------ @@ -35,39 +36,40 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.coverage', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'recommonmark'] +extensions = [ + "sphinx.ext.coverage", + "sphinx.ext.viewcode", + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "recommonmark", +] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -source_suffix = ['.rst', '.md'] +source_suffix = [".rst", ".md"] # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = 'aat' -copyright = '2020, Tim Paine' -author = 'Tim Paine' +project = "aat" +copyright = "2020, Tim Paine" +author = "Tim Paine" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # -_version_py = os.path.join('..', 'aat', '_version.py') -version_ns = {} - -with open(_version_py, mode='r') as version_file: - exec(version_file.read(), version_ns) - # The short X.Y version. -version = '%i.%i' % version_ns['version_info'][:2] +version = "0.1.0" + # The full version, including alpha/beta/rc tags. -release = version_ns['__version__'] +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -79,10 +81,10 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False @@ -106,7 +108,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -114,9 +116,9 @@ # This is required for the alabaster theme # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars html_sidebars = { - '**': [ - 'relations.html', # needs 'show_related': True theme option to display - 'searchbox.html', + "**": [ + "relations.html", # needs 'show_related': True theme option to display + "searchbox.html", ] } @@ -124,7 +126,7 @@ # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. -htmlhelp_basename = 'aatdoc' +htmlhelp_basename = "aatdoc" # -- Options for LaTeX output --------------------------------------------- @@ -133,15 +135,12 @@ # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. # # 'preamble': '', - # Latex figure (float) alignment # # 'figure_align': 'htbp', @@ -151,8 +150,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'aat.tex', 'aat Documentation', - 'Tim Paine', 'manual'), + (master_doc, "aat.tex", "aat Documentation", "Tim Paine", "manual"), ] @@ -160,10 +158,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'aat', 'aat Documentation', - [author], 1) -] +man_pages = [(master_doc, "aat", "aat Documentation", [author], 1)] # -- Options for Texinfo output ------------------------------------------- @@ -172,20 +167,26 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'aat', 'aat Documentation', - author, 'aat', 'One line description of project.', - 'Miscellaneous'), + ( + master_doc, + "aat", + "aat Documentation", + author, + "aat", + "One line description of project.", + "Miscellaneous", + ), ] def run_copyreadme(_): - out = os.path.abspath(os.path.join(os.path.dirname(__file__), 'index.md')) - readme = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'README.md')) - api = os.path.abspath(os.path.join(os.path.dirname(__file__), 'api.md')) - with open(out, 'w') as fp1: - with open(readme, 'r') as fp2: + out = os.path.abspath(os.path.join(os.path.dirname(__file__), "index.md")) + readme = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "README.md")) + api = os.path.abspath(os.path.join(os.path.dirname(__file__), "api.md")) + with open(out, "w") as fp1: + with open(readme, "r") as fp2: for line in fp2: - if 'src=' in line: + if "src=" in line: # fp1.write(line.replace("docs/", "")) elif "](docs/" in line: @@ -195,30 +196,28 @@ def run_copyreadme(_): fp1.write(line) fp1.write("# API Documentation\n\n") - with open(api, 'r') as fp2: + with open(api, "r") as fp2: fp1.write(fp2.read()) def run_apidoc(_): - out_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'api')) - aat_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'aat')) - cmd_path = 'sphinx-apidoc' - if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv + out_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "api")) + aat_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "aat")) + cmd_path = "sphinx-apidoc" + if hasattr(sys, "real_prefix"): # Check to see if we are in a virtualenv # If we are, assemble the path manually - cmd_path = os.path.abspath(os.path.join(sys.prefix, 'bin', 'sphinx-apidoc')) - subprocess.check_call([cmd_path, - '-E', - '-M', - '-o', - out_dir, - aat_dir, - '--force']) + cmd_path = os.path.abspath(os.path.join(sys.prefix, "bin", "sphinx-apidoc")) + subprocess.check_call([cmd_path, "-E", "-M", "-o", out_dir, aat_dir, "--force"]) def setup(app): - app.add_config_value('recommonmark_config', { - 'auto_toc_tree_section': 'Contents', - }, True) + app.add_config_value( + "recommonmark_config", + { + "auto_toc_tree_section": "Contents", + }, + True, + ) app.add_transform(AutoStructify) - app.connect('builder-inited', run_copyreadme) - app.connect('builder-inited', run_apidoc) + app.connect("builder-inited", run_copyreadme) + app.connect("builder-inited", run_apidoc) diff --git a/js/.eslintrc.js b/js/.eslintrc.js deleted file mode 100644 index 36030689..00000000 --- a/js/.eslintrc.js +++ /dev/null @@ -1,232 +0,0 @@ -module.exports = { - env: { - browser: true, - es6: true, - }, - extends: [ - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - ], - parser: "@typescript-eslint/parser", - parserOptions: { - project: "tsconfig.json", - createDefaultProgram: true, - sourceType: "module", - }, - plugins: [ - "@typescript-eslint", - "@typescript-eslint/tslint", - ], - rules: { - "@typescript-eslint/array-type": [ - "error", - { - default: "array-simple", - }, - ], - "@typescript-eslint/ban-types": [ - "error", - { - types: { - Object: { - message: "Avoid using the `Object` type. Did you mean `object`?", - }, - Function: { - message: "Avoid using the `Function` type. Prefer a specific function type, like `() => void`.", - }, - Boolean: { - message: "Avoid using the `Boolean` type. Did you mean `boolean`?", - }, - Number: { - message: "Avoid using the `Number` type. Did you mean `number`?", - }, - String: { - message: "Avoid using the `String` type. Did you mean `string`?", - }, - Symbol: { - message: "Avoid using the `Symbol` type. Did you mean `symbol`?", - }, - }, - }, - ], - "@typescript-eslint/camelcase": "off", - "@typescript-eslint/consistent-type-definitions": "error", - "@typescript-eslint/dot-notation": "error", - "@typescript-eslint/explicit-member-accessibility": [ - "error", - { - accessibility: "explicit", - }, - ], - "@typescript-eslint/indent": [ - "error", - 2, - { - FunctionDeclaration: { - parameters: "first", - }, - FunctionExpression: { - parameters: "first", - }, - }, - ], - "@typescript-eslint/member-delimiter-style": [ - "error", - { - multiline: { - delimiter: "semi", - requireLast: true, - }, - singleline: { - delimiter: "semi", - requireLast: false, - }, - }, - ], - "@typescript-eslint/member-ordering": "error", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-unused-expressions": "error", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/prefer-for-of": "error", - "@typescript-eslint/prefer-function-type": "error", - "@typescript-eslint/quotes": [ - "error", - "double", - { - avoidEscape: true, - }, - ], - "@typescript-eslint/semi": [ - "error", - "always", - ], - "@typescript-eslint/triple-slash-reference": [ - "error", - { - path: "always", - types: "prefer-import", - lib: "always", - }, - ], - "@typescript-eslint/unified-signatures": "error", - "arrow-body-style": "error", - "arrow-parens": [ - "error", - "always", - ], - "brace-style": [ - "error", - "1tbs", - ], - "camelcase": "off", - "comma-dangle": [ - "error", - "always-multiline", - ], - "complexity": "off", - "constructor-super": "error", - "curly": "error", - "eol-last": "error", - "eqeqeq": [ - "error", - "smart", - ], - "guard-for-in": "error", - "id-blacklist": [ - "error", - "any", - "Number", - "number", - "String", - "string", - "Boolean", - "boolean", - "Undefined", - "undefined", - ], - "id-match": "error", - "max-classes-per-file": [ - "error", - 1, - ], - "max-len": [ - "error", - { - code: 200, - }, - ], - "new-parens": "error", - "no-bitwise": "error", - "no-caller": "error", - "no-cond-assign": "error", - "no-console": "error", - "no-debugger": "error", - "no-empty": "error", - "no-eval": "error", - "no-fallthrough": "off", - "no-invalid-this": "off", - "no-multiple-empty-lines": "error", - "no-new-wrappers": "error", - "no-shadow": [ - "error", - { - hoist: "all", - }, - ], - "no-throw-literal": "error", - "no-trailing-spaces": "error", - "no-undef-init": "error", - "no-underscore-dangle": "error", - "no-unsafe-finally": "error", - "no-unused-labels": "error", - "object-shorthand": "error", - "one-var": [ - "error", - "never", - ], - "prefer-arrow-callback": "error", - "quote-props": [ - "error", - "consistent-as-needed", - ], - "radix": "error", - "space-before-function-paren": [ - "error", - { - anonymous: "never", - asyncArrow: "always", - named: "never", - }, - ], - "spaced-comment": [ - "off", - "always", - { - markers: [ - "/", - ], - }, - ], - "use-isnan": "error", - "valid-typeof": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - rules: { - "import-spacing": true, - "object-literal-sort-keys": true, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type", - "check-typecast", - ], - }, - }, - ], - }, -}; diff --git a/js/babel.config.js b/js/babel.config.js deleted file mode 100644 index caea791d..00000000 --- a/js/babel.config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - presets: [ - [ - '@babel/preset-env', - { - targets: { - node: 'current' - } - } - ] - ] -}; \ No newline at end of file diff --git a/js/jest.config.js b/js/jest.config.js deleted file mode 100644 index a8ae7f1a..00000000 --- a/js/jest.config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - verbose: true, - transform: { - "^.+\\.(ts|tsx)$": "ts-jest", - "^.+\\.js$": "babel-jest", - ".+\\.(css|styl|less|sass|scss)$": "jest-transform-css" - }, - cache: false, - testPathIgnorePatterns: [ - "tests/js" - ], - transformIgnorePatterns: [ - `node_modules/(?!@finos|lit-html)` - ], - moduleNameMapper:{ - "\\.(css|less)$": "/tests/js/styleMock.js", - "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/tests/js/fileMock.js" - }, - preset: 'ts-jest', - setupFiles: ['/tests/js/beforeEachSpec.js'] -}; diff --git a/js/package.json b/js/package.json deleted file mode 100644 index cc99a849..00000000 --- a/js/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "private": true, - "name": "aat", - "version": "0.1.0", - "dependencies": { - "@finos/perspective": "^0.4.6", - "@finos/perspective-viewer": "^0.4.6", - "@finos/perspective-viewer-d3fc": "^0.4.6", - "@finos/perspective-viewer-datagrid": "^0.4.6", - "@finos/perspective-workspace": "^0.4.6", - "@lumino/commands": "^1.5.0", - "@lumino/dragdrop": "^1.3.0", - "@lumino/messaging": "^1.2.2", - "@lumino/widgets": "^1.6.0", - "es6-promise": "^4.0.5", - "requests-helper": "^0.1.3", - "tkp_utils": "^0.1.10" - }, - "devDependencies": { - "@babel/preset-env": "^7.7.1", - "@finos/perspective-webpack-plugin": "^0.4.6", - "@types/jest": "^23.3.9", - "@types/ws": "^7.2.3", - "@typescript-eslint/eslint-plugin": "^3.0.0", - "@typescript-eslint/eslint-plugin-tslint": "^3.0.0", - "@typescript-eslint/parser": "^3.0.0", - "babel-jest": "^24.9.0", - "babel-loader": "^8.0.6", - "cpx": "^1.5.0", - "css-loader": "^0.26.1", - "eslint": "^7.1.0", - "eslint-plugin-import": "^2.20.2", - "eslint-plugin-jsdoc": "^25.4.2", - "eslint-plugin-prefer-arrow": "^1.2.1", - "eslint-plugin-unicorn": "^20.0.0", - "file-loader": "^0.11.1", - "jest": "^24.9.0", - "jest-transform-css": "^2.0.0", - "less": "^3.10.3", - "less-loader": "^5.0.0", - "rimraf": "^2.5.2", - "style-loader": "^0.13.1", - "ts-jest": "^23.10.4", - "ts-loader": "^5.3.3", - "tslint": "^5.14.0", - "typescript": "^3.7.2", - "webpack": "^4.29.0", - "webpack-cli": "^3.2.1" - }, - "scripts": { - "build": "tsc && webpack && yarn copyassets", - "copyassets": "cpx \"node_modules/@finos/perspective/dist/umd/*wasm*\" ../aat/ui/assets/static/js/", - "clean": "rimraf build", - "fix": "./node_modules/.bin/eslint -c .eslintrc.js --ext .ts --fix src/ tests/", - "lint": "./node_modules/.bin/eslint -c .eslintrc.js --ext .ts src/ tests/", - "test": "NODE_ENV=test jest -i --coverage --no-cache --collectCoverageFrom=str/**/*.{ts}" - }, - "typings": "build/index", - "main": "build/index" -} diff --git a/js/src/style/index.less b/js/src/style/index.less deleted file mode 100644 index 2384808b..00000000 --- a/js/src/style/index.less +++ /dev/null @@ -1,12 +0,0 @@ -body { - display: flex; - flex-direction: column; - overflow: visible; -} - -body > div.workspace { - flex: 1; - height: 100%; - width: 100%; -} - diff --git a/js/src/ts/index.ts b/js/src/ts/index.ts deleted file mode 100644 index abd1aeee..00000000 --- a/js/src/ts/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -import perspective from "@finos/perspective"; -// import {PerspectiveViewerWidget, PerspectiveWorkspace} from "@finos/perspective-workspace"; -import {DockPanel, Widget} from "@lumino/widgets"; - -import "@finos/perspective-viewer"; -import "@finos/perspective-viewer-datagrid"; -import "@finos/perspective-viewer-d3fc"; -import "@finos/perspective-viewer-hypergrid"; -import "@finos/perspective-viewer/themes/material-dense.dark.css"; -import "!!style-loader!css-loader!less-loader!../src/style/index.less"; - -export -const main = async () => { - const tradesViewer = document.createElement("perspective-viewer"); - await tradesViewer.restore({ - plugin: "datagrid", - sort: [["timestamp", "asc"]], - }); - - const ordersViewer = document.createElement("perspective-viewer"); - await ordersViewer.restore({ - "column-pivots": ["side"], - "plugin": "datagrid", - "sort": [["price", "desc"]], - }); - - // connect to perspective - const websocket = perspective.websocket("ws://localhost:8080/api/v1/ws"); - - const tradesTable = websocket.open_table("trades"); - const ordersTable = websocket.open_table("orders"); - - // perspective workspace - // const workspace = new PerspectiveWorkspace(); - // workspace.addClass("workspace"); - // workspace.title.label = "AAT"; - const workspace = new DockPanel(); - workspace.addClass("workspace"); - - // const tradesWidget = new PerspectiveViewerWidget("Trades"); - // const ordersWidget = new PerspectiveViewerWidget("Orders"); - - // Add tables to workspace - const tradesWidget = new Widget({node: tradesViewer}); - const ordersWidget = new Widget({node: ordersViewer}); - workspace.addWidget(tradesWidget, {}); - workspace.addWidget(ordersWidget, {mode: "split-bottom", ref: tradesWidget}); - - // Attach parts to dom - Widget.attach(workspace, document.body); - - // Load perspective tables - tradesViewer.load(tradesTable); - ordersViewer.load(ordersTable); - - // (window as any).workspace = workspace; -}; - -// eslint-disable-next-line @typescript-eslint/no-misused-promises -document.addEventListener("WebComponentsReady", main); diff --git a/js/tests/js/beforeEachSpec.js b/js/tests/js/beforeEachSpec.js deleted file mode 100644 index b4b004fa..00000000 --- a/js/tests/js/beforeEachSpec.js +++ /dev/null @@ -1,6 +0,0 @@ -// 'Implement' innerText in JSDOM: https://github.com/jsdom/jsdom/issues/1245 -Object.defineProperty(global.Element.prototype, 'innerText', { - get() { - return this.textContent; - }, -}); \ No newline at end of file diff --git a/js/tests/js/fileMock.js b/js/tests/js/fileMock.js deleted file mode 100644 index 84c1da6f..00000000 --- a/js/tests/js/fileMock.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = 'test-file-stub'; \ No newline at end of file diff --git a/js/tests/js/styleMock.js b/js/tests/js/styleMock.js deleted file mode 100644 index f053ebf7..00000000 --- a/js/tests/js/styleMock.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {}; diff --git a/js/tests/ts/export.test.ts b/js/tests/ts/export.test.ts deleted file mode 100644 index e7528ec0..00000000 --- a/js/tests/ts/export.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable @typescript-eslint/no-empty-function */ -// import "isomorphic-fetch"; - -// first -Object.defineProperty(window, "MutationObserver", { value: class { - public constructor(callback: any) {} - public disconnect() {} - public observe(element: any, initObject: any) {} -}}); - -import {main} from "../../src/ts/index"; - -// import * as puppeteer from"puppeteer"; -// import * as path from "path"; -describe("Checks browser interactions", () => { - test("Check extension", () => { - - }); -}); - - -describe("Checks exports", () => { - test("Check import", () => { - // eslint-disable-next-line no-console - console.log(main); - }); -}); - diff --git a/js/tsconfig.json b/js/tsconfig.json deleted file mode 100644 index 7a39d049..00000000 --- a/js/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "noImplicitAny": true, - "noEmitOnError": true, - "noUnusedLocals": true, - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "target": "es2016", - "outDir": "./build", - "lib": ["es2016", "es2015", "dom"], - "types": [ - "jest", - "@finos/perspective-viewer", - ] - }, - "include": ["src/ts/*"] -} \ No newline at end of file diff --git a/js/webpack.config.js b/js/webpack.config.js deleted file mode 100644 index f03dece2..00000000 --- a/js/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require("path"); -const PerspectivePlugin = require("@finos/perspective-webpack-plugin"); - -const webpack = require("webpack"); - -module.exports = { - entry: './build/index.js', - mode: 'production', - output: { - path: __dirname + '/../aat/ui/assets/static/js/', - filename: 'bundle.js', - publicPath: './static/js/' - }, - plugins: [new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /(en|es|fr)$/), - new PerspectivePlugin()], - module: { - rules: [ - {test: /\.css$/, use: [{loader: 'style-loader', }, {loader: 'css-loader', }, ], }, - {test: /\.ts?$/, loader: "ts-loader"}, - {test: /\.js?$/, loader: "babel-loader"} - ] - } -}; diff --git a/setup.cfg b/setup.cfg index 02e18742..de2013d6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,7 +8,6 @@ max-line-length=250 per-file-ignores= aat/core/__init__.py:F401, F403 - [mypy] python_version = 3.7 disallow_untyped_calls = True @@ -20,3 +19,20 @@ warn_unused_configs = True [mypy-aat.tests.*] ignore_errors = True + +[bumpversion] +current_version = 0.1.0 +commit = True +tag = False + +[bumpversion:file:aat/__init__.py] +search = __version__ = "{current_version}" +replace = __version__ = "{new_version}" + +[bumpversion:file:setup.py] +search = version="{current_version}" +replace = version="{new_version}" + +[bumpversion:file:docs/conf.py] +search = version = "{current_version}" +replace = version = "{new_version}" diff --git a/setup.py b/setup.py index 456ac408..363214ed 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ from setuptools import setup, find_packages, Extension from codecs import open -import io import os import os.path import os @@ -27,16 +26,6 @@ pass # no numpy -def get_version(file, name="__version__"): - path = os.path.realpath(file) - version_ns = {} - with io.open(path, encoding="utf8") as f: - exec(f.read(), {}, version_ns) - return version_ns[name] - - -version = get_version(pjoin(here, name, "_version.py")) - with open(os.path.join(here, "README.md"), encoding="utf-8") as f: long_description = f.read().replace("\r\n", "\n") @@ -109,7 +98,7 @@ def get_version(file, name="__version__"): setup( name=name, - version=version, + version="0.1.0", description="Algorithmic trading library", long_description=long_description, long_description_content_type="text/markdown",