Python publish for v3 (#2383)
* Remove pre-release suffixes from version numbers * For wrapper test, pull latest ganache image first * For wrapper test, unpin ganache, use beta snapshot * In docs, advise using beta ganache snapshot Because we haven't yet published the non-beta snapshot * Unpin package interdependencies * unpin tests from beta 0xorg/ganache-cli version * use beta ganache snapshot * Set release date in CHANGELOGs * In testing deployment, stop testing pre-releases * Include rmtree("build") in all clean commands * Fix clean not cleaning what it thought it was * In monorepo script, install pkgs 1st then dev deps * Stop pinning ganache snapshot version * In test setup, wait longer for mesh to start up * Fix broken hyperlinks in docs * fix missing \n that was breaking doc rendering * In monorepo script comment, fix typo, and clarify
This commit is contained in:
parent
8685cf9036
commit
4f17a251d3
@ -193,10 +193,7 @@ jobs:
|
||||
working_directory: ~/repo
|
||||
docker:
|
||||
- image: nikolaik/python-nodejs:python3.7-nodejs8
|
||||
- image: 0xorg/ganache-cli:4.4.0-beta.1
|
||||
environment:
|
||||
VERSION: latest
|
||||
SNAPSHOT_NAME: 0x_ganache_snapshot-v3-beta
|
||||
- image: 0xorg/ganache-cli
|
||||
- image: 0xorg/mesh:0xV3
|
||||
environment:
|
||||
ETHEREUM_RPC_URL: 'http://localhost:8545'
|
||||
@ -219,7 +216,7 @@ jobs:
|
||||
TAKER_FEE_UNIT_AMOUNT: 0
|
||||
MESH_ENDPOINT: 'ws://localhost:60557'
|
||||
command: |
|
||||
sh -c "waitForMesh () { sleep 5; }; waitForMesh && node_modules/.bin/forever ts/lib/index.js"
|
||||
sh -c "waitForMesh () { sleep 30; }; waitForMesh && node_modules/.bin/forever ts/lib/index.js"
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
## 3.0.0 - TBD
|
||||
## 3.0.0 - 2019-12-03
|
||||
|
||||
- Addresses are now indexed by chain ID rather than by network ID.
|
||||
|
||||
|
@ -87,6 +87,7 @@ class CleanCommandExtension(clean):
|
||||
def run(self):
|
||||
"""Run the regular clean, followed by our custom commands."""
|
||||
super().run()
|
||||
rmtree("build", ignore_errors=True)
|
||||
rmtree("dist", ignore_errors=True)
|
||||
rmtree(".mypy_cache", ignore_errors=True)
|
||||
rmtree(".tox", ignore_errors=True)
|
||||
@ -151,7 +152,7 @@ with open("README.md", "r") as file_handle:
|
||||
|
||||
setup(
|
||||
name="0x-contract-addresses",
|
||||
version="3.0.0.dev3",
|
||||
version="3.0.0",
|
||||
description="Addresses at which the 0x smart contracts have been deployed",
|
||||
long_description=README_MD,
|
||||
long_description_content_type="text/markdown",
|
||||
|
@ -14,5 +14,5 @@ commands =
|
||||
[testenv:run_tests_against_deployment]
|
||||
setenv = PY_IGNORE_IMPORTMISMATCH = 1
|
||||
commands=
|
||||
pip install --pre 0x-contract-addresses[dev]
|
||||
pip install 0x-contract-addresses[dev]
|
||||
pytest --doctest-modules src
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
## 3.0.0 - TBD
|
||||
## 3.0.0 - 2019-12-03
|
||||
|
||||
- Updated with artifacts for version 3 of the protocol.
|
||||
|
||||
|
@ -88,6 +88,7 @@ class CleanCommandExtension(clean):
|
||||
def run(self):
|
||||
"""Run the regular clean, followed by our custom commands."""
|
||||
super().run()
|
||||
rmtree("build", ignore_errors=True)
|
||||
rmtree("dist", ignore_errors=True)
|
||||
rmtree(".mypy_cache", ignore_errors=True)
|
||||
rmtree(".tox", ignore_errors=True)
|
||||
@ -152,7 +153,7 @@ with open("README.md", "r") as file_handle:
|
||||
|
||||
setup(
|
||||
name="0x-contract-artifacts",
|
||||
version="3.0.0.dev2",
|
||||
version="3.0.0",
|
||||
description="0x smart contract compilation artifacts",
|
||||
long_description=README_MD,
|
||||
long_description_content_type="text/markdown",
|
||||
|
@ -14,5 +14,5 @@ commands =
|
||||
[testenv:run_tests_against_deployment]
|
||||
setenv = PY_IGNORE_IMPORTMISMATCH = 1
|
||||
commands=
|
||||
pip install --pre 0x-contract-artifacts[dev]
|
||||
pip install 0x-contract-artifacts[dev]
|
||||
pytest --doctest-modules src
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
## 2.0.0 - TBD
|
||||
## 2.0.0 - 2019-12-03
|
||||
|
||||
- Updated for version 3 of the protocol.
|
||||
- Allow wrappers to be instantiated with EITHER a Web3.py `BaseProvider` OR an already-instantiated `Web3` client object.
|
||||
|
@ -123,6 +123,7 @@ class CleanCommandExtension(clean):
|
||||
def run(self):
|
||||
"""Run the regular clean, followed by our custom commands."""
|
||||
super().run()
|
||||
rmtree("build", ignore_errors=True)
|
||||
rmtree("dist", ignore_errors=True)
|
||||
rmtree(".mypy_cache", ignore_errors=True)
|
||||
rmtree(".tox", ignore_errors=True)
|
||||
@ -183,10 +184,10 @@ class GanacheCommand(distutils.command.build_py.build_py):
|
||||
|
||||
def run(self):
|
||||
"""Run ganache."""
|
||||
cmd_line = (
|
||||
"docker run -d -p 8545:8545 0xorg/ganache-cli:2.2.2"
|
||||
).split()
|
||||
subprocess.call(cmd_line) # nosec
|
||||
subprocess.call(("docker pull 0xorg/ganache-cli").split()) # nosec
|
||||
subprocess.call( # nosec
|
||||
("docker run -d -p 8545:8545 0xorg/ganache-cli").split()
|
||||
)
|
||||
|
||||
|
||||
with open("README.md", "r") as file_handle:
|
||||
@ -195,7 +196,7 @@ with open("README.md", "r") as file_handle:
|
||||
|
||||
setup(
|
||||
name="0x-contract-wrappers",
|
||||
version="2.0.0.dev10",
|
||||
version="2.0.0",
|
||||
description="Python wrappers for 0x smart contracts",
|
||||
long_description=README_MD,
|
||||
long_description_content_type="text/markdown",
|
||||
@ -216,10 +217,10 @@ setup(
|
||||
"ganache": GanacheCommand,
|
||||
},
|
||||
install_requires=[
|
||||
"0x-contract-addresses==3.0.0.dev3",
|
||||
"0x-contract-artifacts==3.0.0.dev2",
|
||||
"0x-json-schemas==2.1.0.dev2",
|
||||
"0x-order-utils==4.0.0.dev8",
|
||||
"0x-contract-addresses",
|
||||
"0x-contract-artifacts",
|
||||
"0x-json-schemas",
|
||||
"0x-order-utils",
|
||||
"web3",
|
||||
"attrs",
|
||||
"eth_utils",
|
||||
|
@ -203,23 +203,23 @@ zero_ex.contract_wrappers.exchange: Generated Tuples
|
||||
|
||||
.. autoclass:: zero_ex.contract_wrappers.exchange.LibOrderOrder
|
||||
|
||||
This is the generated class representing `the Order struct <https://0x.org/docs/contracts#structs-Order>`_.
|
||||
This is the generated class representing `the Order struct <https://github.com/0xProject/0x-protocol-specification/blob/master/v3/v3-specification.md#order>`_.
|
||||
|
||||
.. autoclass:: zero_ex.contract_wrappers.exchange.LibFillResultsFillResults
|
||||
|
||||
This is the generated class representing `the FillResults struct <https://0x.org/docs/contracts#structs-FillResults>`_.
|
||||
This is the generated class representing `the FillResults struct <https://github.com/0xProject/0x-protocol-specification/blob/master/v3/v3-specification.md#fillresults>`_.
|
||||
|
||||
.. autoclass:: zero_ex.contract_wrappers.exchange.LibFillResultsMatchedFillResults
|
||||
|
||||
This is the generated class representing `the MatchedFillResults struct <https://0x.org/docs/contracts#structs-MatchedFillResults>`_.
|
||||
This is the generated class representing `the MatchedFillResults struct <https://github.com/0xProject/0x-protocol-specification/blob/master/v3/v3-specification.md#matchedfillresults>`_.
|
||||
|
||||
.. autoclass:: zero_ex.contract_wrappers.exchange.LibOrderOrderInfo
|
||||
|
||||
This is the generated class representing `the OrderInfo struct <https://0x.org/docs/contracts#structs-OrderInfo>`_.
|
||||
This is the generated class representing `the OrderInfo struct <https://github.com/0xProject/0x-protocol-specification/blob/master/v3/v3-specification.md#orderinfo>`_.
|
||||
|
||||
.. autoclass:: zero_ex.contract_wrappers.exchange.LibZeroExTransactionZeroExTransaction
|
||||
|
||||
This is the generated class representing `the ZeroExTransaction struct <https://0x.org/docs/contracts#structs-ZeroExTransaction>`_.
|
||||
This is the generated class representing `the ZeroExTransaction struct <https://github.com/0xProject/0x-protocol-specification/blob/master/v3/v3-specification.md#zeroextransaction>`_.
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
@ -12,8 +12,8 @@ Install the 0x-contract-wrappers with pip::
|
||||
|
||||
We need a Web3 provider to allow us to talk to the blockchain. You can
|
||||
read `more about providers in the Web3.py documentation
|
||||
<https://web3py.readthedocs.io/en/stable/providers.htm>`_. The examples below
|
||||
assume there's a local instance of Ganache listening on port 8545:
|
||||
<https://web3py.readthedocs.io/en/stable/>`_. The examples below assume
|
||||
there's a local instance of Ganache listening on port 8545:
|
||||
|
||||
>>> from web3 import HTTPProvider
|
||||
>>> ganache = HTTPProvider("http://localhost:8545")
|
||||
@ -21,7 +21,7 @@ assume there's a local instance of Ganache listening on port 8545:
|
||||
To replicate these examples, one can use the `0xorg/ganache-cli`:code: docker
|
||||
image, which comes with the 0x contracts pre-deployed. To start it::
|
||||
|
||||
docker run docker run -d -p 8545:8545 0xorg/ganache-cli
|
||||
docker run -d -p 8545:8545 0xorg/ganache-cli
|
||||
|
||||
Accounts
|
||||
--------
|
||||
|
@ -22,5 +22,5 @@ commands =
|
||||
[testenv:run_tests_against_deployment]
|
||||
setenv = PY_IGNORE_IMPORTMISMATCH = 1
|
||||
commands =
|
||||
pip install --pre 0x-contract-wrappers[dev]
|
||||
pip install 0x-contract-wrappers[dev]
|
||||
pytest --doctest-modules src test
|
||||
|
@ -5,7 +5,20 @@
|
||||
from os import path
|
||||
import subprocess
|
||||
|
||||
# install all packages
|
||||
# Install all packages, WITHOUT dev dependencies first, because some packages
|
||||
# have dev-only dependencies on other local pacakges, to support tests and
|
||||
# examples, and if we don't do this then those dev-only cross-dependencies will
|
||||
# trigger premature dependency satisfaction, via PyPI rather than the local
|
||||
# filesystem, completely messing up our "install."
|
||||
subprocess.check_call(
|
||||
(
|
||||
path.join(".", "cmd_pkgs_in_dep_order.py") + " pip install -e ."
|
||||
).split()
|
||||
)
|
||||
|
||||
# Now that the dev-only cross-dependencies will be considered already
|
||||
# satisfied, due to the previous installation of all the pacakges in the
|
||||
# local filestystem, go ahead and install the (rest of the) dev dependencies.
|
||||
subprocess.check_call(
|
||||
(
|
||||
path.join(".", "cmd_pkgs_in_dep_order.py") + " pip install -e .[dev]"
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
## 1.2.0 - TBD
|
||||
## 1.2.0 - 2019-12-03
|
||||
|
||||
- Removed dev dependency on package `0x-contract-wrappers`
|
||||
- Migrated examples to using new version of `0x-contract-addresses`.
|
||||
|
@ -90,11 +90,12 @@ class CleanCommandExtension(clean):
|
||||
def run(self):
|
||||
"""Run the regular clean, followed by our custom commands."""
|
||||
super().run()
|
||||
rmtree("build", ignore_errors=True)
|
||||
rmtree("dist", ignore_errors=True)
|
||||
rmtree(".mypy_cache", ignore_errors=True)
|
||||
rmtree(".tox", ignore_errors=True)
|
||||
rmtree(".pytest_cache", ignore_errors=True)
|
||||
rmtree("src/*.egg-info", ignore_errors=True)
|
||||
rmtree("src/0x_json_schemas.egg-info", ignore_errors=True)
|
||||
|
||||
|
||||
class TestPublishCommand(distutils.command.build_py.build_py):
|
||||
@ -143,7 +144,7 @@ with open("README.md", "r") as file_handle:
|
||||
|
||||
setup(
|
||||
name="0x-json-schemas",
|
||||
version="2.1.0.dev2",
|
||||
version="2.1.0",
|
||||
description="JSON schemas for 0x applications",
|
||||
long_description=README_MD,
|
||||
long_description_content_type="text/markdown",
|
||||
@ -165,7 +166,7 @@ setup(
|
||||
install_requires=["jsonschema", "mypy_extensions", "stringcase"],
|
||||
extras_require={
|
||||
"dev": [
|
||||
"0x-contract-addresses==3.0.0.dev3",
|
||||
"0x-contract-addresses",
|
||||
"bandit",
|
||||
"black",
|
||||
"coverage",
|
||||
|
@ -22,5 +22,5 @@ commands =
|
||||
[testenv:run_tests_against_deployment]
|
||||
setenv = PY_IGNORE_IMPORTMISMATCH = 1
|
||||
commands =
|
||||
pip install --pre 0x-json-schemas[dev]
|
||||
pip install 0x-json-schemas[dev]
|
||||
pytest --doctest-modules src test
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.0 - TBD
|
||||
## 1.0.0 - 2019-12-03
|
||||
|
||||
- Initial release.
|
||||
|
@ -70,6 +70,7 @@ class CleanCommandExtension(clean):
|
||||
def run(self):
|
||||
"""Run the regular clean, followed by our custom commands."""
|
||||
super().run()
|
||||
rmtree("build", ignore_errors=True)
|
||||
rmtree("dist", ignore_errors=True)
|
||||
rmtree(".mypy_cache", ignore_errors=True)
|
||||
rmtree(".tox", ignore_errors=True)
|
||||
@ -136,7 +137,7 @@ with open("README.md", "r") as file_handle:
|
||||
|
||||
setup(
|
||||
name="0x-middlewares",
|
||||
version="1.0.0.dev0",
|
||||
version="1.0.0",
|
||||
description="Web3 middlewares for 0x applications",
|
||||
long_description=README_MD,
|
||||
long_description_content_type="text/markdown",
|
||||
|
@ -22,5 +22,5 @@ commands =
|
||||
[testenv:run_tests_against_deployment]
|
||||
setenv = PY_IGNORE_IMPORTMISMATCH = 1
|
||||
commands =
|
||||
pip install --pre 0x-middlewares[dev]
|
||||
pip install 0x-middlewares[dev]
|
||||
pytest --doctest-modules test
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
## 4.0.0 - TBD
|
||||
## 4.0.0 - 2019-12-03
|
||||
|
||||
- Upgraded to protocol version 3.
|
||||
- `is_valid_signature()` now returns just a boolean. (Formerly, it returned a tuple consisting of the boolean and a reason string.)
|
||||
|
@ -156,7 +156,7 @@ with open("README.md", "r") as file_handle:
|
||||
|
||||
setup(
|
||||
name="0x-order-utils",
|
||||
version="4.0.0.dev8",
|
||||
version="4.0.0",
|
||||
description="Order utilities for 0x applications",
|
||||
long_description=README_MD,
|
||||
long_description_content_type="text/markdown",
|
||||
@ -176,9 +176,9 @@ setup(
|
||||
"ganache": GanacheCommand,
|
||||
},
|
||||
install_requires=[
|
||||
"0x-contract-addresses==3.0.0.dev3",
|
||||
"0x-contract-artifacts==3.0.0.dev2",
|
||||
"0x-json-schemas==2.1.0.dev2",
|
||||
"0x-contract-addresses",
|
||||
"0x-contract-artifacts",
|
||||
"0x-json-schemas",
|
||||
"deprecated",
|
||||
"web3",
|
||||
"eth-abi",
|
||||
|
@ -1,4 +1,4 @@
|
||||
"""Order utilities for 0x applications.
|
||||
r"""Order utilities for 0x applications.
|
||||
|
||||
Setup
|
||||
-----
|
||||
@ -11,8 +11,9 @@ Some methods require the caller to pass in a `Web3.BaseProvider`:code: object.
|
||||
For local testing one may construct such a provider pointing at an instance of
|
||||
`ganache-cli <https://www.npmjs.com/package/ganache-cli>`_ which has the 0x
|
||||
contracts deployed on it. For convenience, a docker container is provided for
|
||||
just this purpose. To start it:
|
||||
`docker run -d -p 8545:8545 0xorg/ganache-cli:2.2.2`:code:.
|
||||
just this purpose. To start it::
|
||||
|
||||
docker run -d -p 8545:8545 0xorg/ganache-cli
|
||||
|
||||
"""
|
||||
|
||||
|
@ -22,5 +22,5 @@ commands =
|
||||
[testenv:run_tests_against_deployment]
|
||||
setenv = PY_IGNORE_IMPORTMISMATCH = 1
|
||||
commands =
|
||||
pip install --pre 0x-order-utils[dev]
|
||||
pip install 0x-order-utils[dev]
|
||||
pytest --doctest-modules src test
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Changelog
|
||||
|
||||
## 4.0.0 - TBD
|
||||
## 4.0.0 - 2019-12-03
|
||||
|
||||
- Migrated from v2 to v3 of the 0x protocol.
|
||||
|
||||
|
@ -19,7 +19,7 @@ from setuptools import setup, find_packages # noqa: H301
|
||||
from setuptools.command.test import test as TestCommand
|
||||
|
||||
NAME = "0x-sra-client"
|
||||
VERSION = "4.0.0.dev0"
|
||||
VERSION = "4.0.0"
|
||||
# To install the library, run the following
|
||||
#
|
||||
# python setup.py install
|
||||
@ -43,7 +43,7 @@ class CleanCommandExtension(clean):
|
||||
rmtree(".mypy_cache", ignore_errors=True)
|
||||
rmtree(".tox", ignore_errors=True)
|
||||
rmtree(".pytest_cache", ignore_errors=True)
|
||||
rmtree("0x_sra_client.egg-info", ignore_errors=True)
|
||||
rmtree("src/0x_sra_client.egg-info", ignore_errors=True)
|
||||
rmtree("build", ignore_errors=True)
|
||||
rmtree("dist", ignore_errors=True)
|
||||
subprocess.check_call( # nosec
|
||||
@ -213,10 +213,10 @@ setup(
|
||||
},
|
||||
extras_require={
|
||||
"dev": [
|
||||
"0x-contract-artifacts==3.0.0.dev2",
|
||||
"0x-contract-addresses==3.0.0.dev3",
|
||||
"0x-contract-wrappers==2.0.0.dev10",
|
||||
"0x-order-utils==4.0.0.dev8",
|
||||
"0x-contract-artifacts",
|
||||
"0x-contract-addresses",
|
||||
"0x-contract-wrappers",
|
||||
"0x-order-utils",
|
||||
"web3",
|
||||
"bandit",
|
||||
"black",
|
||||
|
@ -343,6 +343,7 @@ book. Now let's have the taker fill it:
|
||||
(Due to `an Issue with the Launch Kit Backend
|
||||
<https://github.com/0xProject/0x-launch-kit-backend/issues/73>`_, we need to
|
||||
checksum the address in the order before filling it.)
|
||||
|
||||
>>> order['makerAddress'] = Web3.toChecksumAddress(order['makerAddress'])
|
||||
|
||||
Finally, filling an order requires paying a protocol fee, which can be sent as
|
||||
|
@ -2,12 +2,9 @@
|
||||
version: '3'
|
||||
services:
|
||||
ganache:
|
||||
image: "0xorg/ganache-cli:4.4.0-beta.1"
|
||||
image: "0xorg/ganache-cli"
|
||||
ports:
|
||||
- "8545:8545"
|
||||
environment:
|
||||
- VERSION=latest
|
||||
- SNAPSHOT_NAME=0x_ganache_snapshot-v3-beta
|
||||
mesh:
|
||||
image: 0xorg/mesh:0xV3
|
||||
depends_on:
|
||||
@ -43,4 +40,4 @@ services:
|
||||
- TAKER_FEE_UNIT_AMOUNT=0
|
||||
- MESH_ENDPOINT=ws://localhost:60557
|
||||
command: |
|
||||
sh -c "waitForMesh () { sleep 3; }; waitForMesh && sleep 5 && node_modules/.bin/forever ts/lib/index.js"
|
||||
sh -c "waitForMesh () { sleep 30; }; waitForMesh && node_modules/.bin/forever ts/lib/index.js"
|
||||
|
@ -21,5 +21,4 @@ commands =
|
||||
setenv = PY_IGNORE_IMPORTMISMATCH = 1
|
||||
commands =
|
||||
pip install 0x-sra-client[dev]
|
||||
pip install --pre 0x-sra-client
|
||||
pytest --doctest-modules src test
|
||||
|
Loading…
x
Reference in New Issue
Block a user