protocol/python-packages/cmd_pkgs_in_dep_order.py
F. Eugene Aumson aa5af04447
Python contract demo, with lots of refactoring (#1485)
* Refine Order for Web3 compat. & add conversions

Changed some of the fields in the Order class so that it can be passed
to our contracts via Web3.

Added conversion utilities so that an Order can be easily converted to
and from a JSON-compatible dict (specifically by encoding/decoding the
`bytes` fields), to facilitate validation against the JSON schema.

Also modified JSON order schema to accept integers in addition to
stringified integers.

* Fixes for json_schemas

Has-types indicator file, py.typed, was not being included in package.

Schemas were not being properly gathered into package installation.

* Add test/demo of Exchange.getOrderInfo()

* web3 bug workaround

* Fix problem packaging contract artifacts

* Move contract addresses to their own package

* Move contract artifacts to their own package

* Add scripts to install, test & lint all components

* prettierignore files in local python dev env

* Correct missing coverage analysis for sra_client

* CI cache lint: don't save, re-use from test-python

* tag hacks as hacks

* correct merge mistake

* remove local strip_0x() in favor of eth_utils

* remove json schemas from old order_utils location

* correct merge mistake

* doctest json schemas via command-line, not code
2019-01-09 09:58:29 -05:00

26 lines
624 B
Python
Executable File

#!/usr/bin/env python
"""Run a command in every package, in order of increasing dependency."""
import os
import subprocess
import sys
PACKAGE_DEPENDENCY_LIST = [
# Order matters! Packages must be handled in dependency order (most
# independent first) in order for them to resolve properly.
"contract_addresses",
"contract_artifacts",
"json_schemas",
"sra_client",
"order_utils",
"contract_demo"
]
for package in PACKAGE_DEPENDENCY_LIST:
print(f"Running command `{sys.argv[1:]}` in package {package}")
os.chdir(package)
subprocess.check_call(sys.argv[1:])
os.chdir("..")