Skip to content

Commit

Permalink
update references
Browse files Browse the repository at this point in the history
  • Loading branch information
frosty00 committed Feb 20, 2021
1 parent d4bb967 commit 3179b2b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ These files containing derived exchange classes are transpiled from JS into Pyth

- `js/[_a-z].js``python/ccxt/async/[_a-z].py`
- `python/ccxt/async[_a-z].py``python/ccxt/[_a-z].py` (Python 3 asyncio → Python 2 sync transpilation stage)
- `python/test/test_async.py``python/test/test_sync.py` (the sync test is generated from the async test)
- `python/ccxt/test/test_async.py``python/ccxt/test/test_sync.py` (the sync test is generated from the async test)

These Python base classes and files are not transpiled:

Expand Down
6 changes: 3 additions & 3 deletions build/git-ignore-generated-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ let files = [

'dist/ccxt.browser.js',

'python/test/test_decimal_to_precision.py',
'python/ccxt/test/test_decimal_to_precision.py',
'php/test/decimal_to_precision.php',

'python/test/test_exchange_datetime_functions.py',
'python/ccxt/test/test_exchange_datetime_functions.py',
'php/test/test_exchange_datetime_functions.php',

'python/test/test_sync.py',
'python/ccxt/test/test_sync.py',

'wiki/Exchange-Markets-By-Country.md',
'wiki/Exchange-Markets.md',
Expand Down
18 changes: 9 additions & 9 deletions build/transpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,8 @@ class Transpiler {

transpilePythonAsyncToSync () {

const async = './python/test/test_async.py'
const sync = './python/test/test_sync.py'
const async = './python/ccxt/test/test_async.py'
const sync = './python/ccxt/test/test_sync.py'
log.magenta ('Transpiling ' + async .yellow + ' → ' + sync.yellow)
const fileContents = fs.readFileSync (async, 'utf8')
let lines = fileContents.split ("\n")
Expand Down Expand Up @@ -1211,7 +1211,7 @@ class Transpiler {

transpileDateTimeTests () {
const jsFile = './js/test/base/functions/test.datetime.js'
const pyFile = './python/test/test_exchange_datetime_functions.py'
const pyFile = './python/ccxt/test/test_exchange_datetime_functions.py'
const phpFile = './php/test/test_exchange_datetime_functions.php'

log.magenta ('Transpiling from', jsFile.yellow)
Expand Down Expand Up @@ -1252,7 +1252,7 @@ class Transpiler {
transpilePrecisionTests () {

const jsFile = './js/test/base/functions/test.number.js'
const pyFile = './python/test/test_decimal_to_precision.py'
const pyFile = './python/ccxt/test/test_decimal_to_precision.py'
const phpFile = './php/test/decimal_to_precision.php'

log.magenta ('Transpiling from', jsFile.yellow)
Expand Down Expand Up @@ -1337,7 +1337,7 @@ class Transpiler {

transpileCryptoTests () {
const jsFile = './js/test/base/functions/test.crypto.js'
const pyFile = './python/test/test_crypto.py'
const pyFile = './python/ccxt/test/test_crypto.py'
const phpFile = './php/test/test_crypto.php'

log.magenta ('Transpiling from', jsFile.yellow)
Expand Down Expand Up @@ -1406,22 +1406,22 @@ class Transpiler {
const tests = [
{
'jsFile': './js/test/Exchange/test.trade.js',
'pyFile': './python/test/test_trade.py',
'pyFile': './python/ccxt/test/test_trade.py',
'phpFile': './php/test/test_trade.php',
},
{
'jsFile': './js/test/Exchange/test.order.js',
'pyFile': './python/test/test_order.py',
'pyFile': './python/ccxt/test/test_order.py',
'phpFile': './php/test/test_order.php',
},
{
'jsFile': './js/test/Exchange/test.transaction.js',
'pyFile': './python/test/test_transaction.py',
'pyFile': './python/ccxt/test/test_transaction.py',
'phpFile': './php/test/test_transaction.php',
},
{
'jsFile': './js/test/Exchange/test.ohlcv.js',
'pyFile': './python/test/test_ohlcv.py',
'pyFile': './python/ccxt/test/test_ohlcv.py',
'phpFile': './php/test/test_ohlcv.php',
},
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"fast-test": "node run-tests --js",
"test-base": "npm run test-js-base && npm run test-python-base && npm run test-php-base",
"test-js-base": "mocha js/test/base/test.base.js --reporter ololog/reporter",
"test-python-base": "python python/test/test_decimal_to_precision.py",
"test-python-base": "python python/ccxt/test/test_decimal_to_precision.py",
"test-php-base": "php -f php/test/decimal_to_precision.php && php -f php/test/test_crypto.php",
"export-exchanges": "node build/export-exchanges",
"git-ignore-generated-files": "node build/git-ignore-generated-files",
Expand Down
2 changes: 0 additions & 2 deletions python/ccxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@
from ccxt.zaif import zaif # noqa: F401
from ccxt.zb import zb # noqa: F401

import test # noqa: F401

exchanges = [
'aax',
'acx',
Expand Down
2 changes: 1 addition & 1 deletion python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"fast-test": "node run-tests --js",
"test-base": "npm run test-js-base && npm run test-python-base && npm run test-php-base",
"test-js-base": "mocha js/test/base/test.base.js --reporter ololog/reporter",
"test-python-base": "python python/test/test_decimal_to_precision.py",
"test-python-base": "python python/ccxt/test/test_decimal_to_precision.py",
"test-php-base": "php -f php/test/decimal_to_precision.php && php -f php/test/test_crypto.php",
"export-exchanges": "node build/export-exchanges",
"git-ignore-generated-files": "node build/git-ignore-generated-files",
Expand Down
4 changes: 2 additions & 2 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ const testExchange = async (exchange) => {
, allTests = [

{ language: 'JavaScript', key: '--js', exec: ['node', 'js/test/test.js', ...args] },
{ language: 'Python 3', key: '--python', exec: ['python3', 'python/test/test_sync.py', ...args] },
{ language: 'Python 3 Async', key: '--python-async', exec: ['python3', 'python/test/test_async.py', ...args] },
{ language: 'Python 3', key: '--python', exec: ['python3', 'python/ccxt/test/test_sync.py', ...args] },
{ language: 'Python 3 Async', key: '--python-async', exec: ['python3', 'python/ccxt/test/test_async.py', ...args] },
{ language: 'PHP', key: '--php', exec: ['php', '-f', 'php/test/test_sync.php', ...args] },
{ language: 'PHP Async', key: '--php-async', exec: ['php', '-f', 'php/test/test_async.php', ...args] },
]
Expand Down
2 changes: 1 addition & 1 deletion wiki/Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ function decimalToPrecision ($x, $roundingMode = ROUND, $numPrecisionDigits = nu
For examples of how to use the `decimalToPrecision` to format strings and floats, please, see the following files:

- JavaScript: https://github.com/ccxt/ccxt/blob/master/js/test/base/functions/test.number.js
- Python: https://github.com/ccxt/ccxt/blob/master/python/test/test_decimal_to_precision.py
- Python: https://github.com/ccxt/ccxt/blob/master/python/ccxt/test/test_decimal_to_precision.py
- PHP: https://github.com/ccxt/ccxt/blob/master/php/test/decimal_to_precision.php

**Python WARNING! The `decimal_to_precision` method is susceptible to `getcontext().prec!`**
Expand Down

0 comments on commit 3179b2b

Please sign in to comment.