diff --git a/python-packages/contract_wrappers/setup.py b/python-packages/contract_wrappers/setup.py index 0462ead4fb..4aa41535e5 100755 --- a/python-packages/contract_wrappers/setup.py +++ b/python-packages/contract_wrappers/setup.py @@ -225,8 +225,7 @@ setup( "pydocstyle", "pylint", "pytest", - "sphinx==2.4.4", # pinned because of https://github.com/sphinx-doc/sphinx/issues/7429 - "sphinx-autodoc-typehints", + "sphinx", "tox", "twine", ] diff --git a/python-packages/contract_wrappers/src/conf.py b/python-packages/contract_wrappers/src/conf.py index 38c0695294..f353138f52 100644 --- a/python-packages/contract_wrappers/src/conf.py +++ b/python-packages/contract_wrappers/src/conf.py @@ -23,7 +23,6 @@ extensions = [ "sphinx.ext.intersphinx", "sphinx.ext.coverage", "sphinx.ext.viewcode", - "sphinx_autodoc_typehints", ] templates_path = ["doc_templates"] @@ -54,3 +53,39 @@ htmlhelp_basename = "contract_wrapperspydoc" # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {"https://docs.python.org/": None} + + +def annotate_gend_tuple_docstring( # pylint: disable=too-many-arguments + app, # pylint: disable=unused-argument + what, # pylint: disable=unused-argument + name, # pylint: disable=unused-argument + obj, # pylint: disable=unused-argument + options, # pylint: disable=unused-argument + lines, +): + """Annotate docstrings of generated tuples.""" + docstring_extensions = { + "LibOrderOrder": [ + "This is the generated class representing `the Order struct `_." + ], + "LibFillResultsFillResults": [ + "This is the generated class representing `the FillResults struct `_." + ], + "LibFillResultsMatchedFillResults": [ + "This is the generated class representing `the MatchedFillResults struct `_." + ], + "LibOrderOrderInfo": [ + "This is the generated class representing `the OrderInfo struct `_." + ], + "LibZeroExTransactionZeroExTransaction": [ + "This is the generated class representing `the ZeroExTransaction struct `_." + ], + } + unqualified_name = name.split(".")[-1] + if unqualified_name in docstring_extensions: + lines.extend(docstring_extensions[unqualified_name]) + + +def setup(app): + """Install callbacks.""" + app.connect("autodoc-process-docstring", annotate_gend_tuple_docstring) diff --git a/python-packages/contract_wrappers/src/index.rst b/python-packages/contract_wrappers/src/index.rst index fada419b90..ef482bccd4 100644 --- a/python-packages/contract_wrappers/src/index.rst +++ b/python-packages/contract_wrappers/src/index.rst @@ -198,29 +198,6 @@ zero_ex.contract_wrappers.exchange.types .. autoclass:: zero_ex.contract_wrappers.exchange.types.ZeroExTransaction -zero_ex.contract_wrappers.exchange: Generated Tuples -==================================================== - -.. autoclass:: zero_ex.contract_wrappers.exchange.LibOrderOrder - - This is the generated class representing `the Order struct `_. - -.. autoclass:: zero_ex.contract_wrappers.exchange.LibFillResultsFillResults - - This is the generated class representing `the FillResults struct `_. - -.. autoclass:: zero_ex.contract_wrappers.exchange.LibFillResultsMatchedFillResults - - This is the generated class representing `the MatchedFillResults struct `_. - -.. autoclass:: zero_ex.contract_wrappers.exchange.LibOrderOrderInfo - - This is the generated class representing `the OrderInfo struct `_. - -.. autoclass:: zero_ex.contract_wrappers.exchange.LibZeroExTransactionZeroExTransaction - - This is the generated class representing `the ZeroExTransaction struct `_. - Indices and tables ================== diff --git a/python-packages/json_schemas/setup.py b/python-packages/json_schemas/setup.py index edf013a1bc..2174f5389c 100755 --- a/python-packages/json_schemas/setup.py +++ b/python-packages/json_schemas/setup.py @@ -179,7 +179,6 @@ setup( "pylint", "pytest", "sphinx", - "sphinx-autodoc-typehints", "tox", "twine", ] diff --git a/python-packages/json_schemas/src/conf.py b/python-packages/json_schemas/src/conf.py index e8dbddacc4..1ae1493e36 100644 --- a/python-packages/json_schemas/src/conf.py +++ b/python-packages/json_schemas/src/conf.py @@ -22,7 +22,6 @@ extensions = [ "sphinx.ext.intersphinx", "sphinx.ext.coverage", "sphinx.ext.viewcode", - "sphinx_autodoc_typehints", ] templates_path = ["doc_templates"] diff --git a/python-packages/middlewares/setup.py b/python-packages/middlewares/setup.py index 1bcd916117..374dc153bf 100755 --- a/python-packages/middlewares/setup.py +++ b/python-packages/middlewares/setup.py @@ -180,7 +180,6 @@ setup( "pylint", "pytest", "sphinx", - "sphinx-autodoc-typehints", "tox", "twine", ] diff --git a/python-packages/middlewares/src/conf.py b/python-packages/middlewares/src/conf.py index 4bb5a2f9f1..880a6afbc8 100644 --- a/python-packages/middlewares/src/conf.py +++ b/python-packages/middlewares/src/conf.py @@ -22,7 +22,6 @@ extensions = [ "sphinx.ext.intersphinx", "sphinx.ext.coverage", "sphinx.ext.viewcode", - "sphinx_autodoc_typehints", ] templates_path = ["doc_templates"] diff --git a/python-packages/order_utils/setup.py b/python-packages/order_utils/setup.py index 8a899270ca..16b9162328 100755 --- a/python-packages/order_utils/setup.py +++ b/python-packages/order_utils/setup.py @@ -200,7 +200,6 @@ setup( "pylint", "pytest", "sphinx", - "sphinx-autodoc-typehints", "tox", "twine", ] diff --git a/python-packages/order_utils/src/conf.py b/python-packages/order_utils/src/conf.py index d8f56b29e6..6b6776d014 100644 --- a/python-packages/order_utils/src/conf.py +++ b/python-packages/order_utils/src/conf.py @@ -22,7 +22,6 @@ extensions = [ "sphinx.ext.intersphinx", "sphinx.ext.coverage", "sphinx.ext.viewcode", - "sphinx_autodoc_typehints", ] templates_path = ["doc_templates"] diff --git a/python-packages/order_utils/src/index.rst b/python-packages/order_utils/src/index.rst index 1308f18c62..f2df2e3a93 100644 --- a/python-packages/order_utils/src/index.rst +++ b/python-packages/order_utils/src/index.rst @@ -16,16 +16,6 @@ zero_ex.order_utils.asset_data_utils .. automodule:: zero_ex.order_utils.asset_data_utils :members: -.. autoclass:: zero_ex.order_utils.asset_data_utils.ERC20AssetData - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: zero_ex.order_utils.asset_data_utils.ERC721AssetData - :members: - :undoc-members: - :show-inheritance: - Indices and tables ================== diff --git a/python-packages/sra_client/setup.py b/python-packages/sra_client/setup.py index 445b382365..36b63eb074 100755 --- a/python-packages/sra_client/setup.py +++ b/python-packages/sra_client/setup.py @@ -227,7 +227,6 @@ setup( "pylint", "pytest", "sphinx", - "sphinx-autodoc-typehints", ] }, command_options={ diff --git a/python-packages/sra_client/src/conf.py b/python-packages/sra_client/src/conf.py index 3b6477c5de..deedfcf996 100644 --- a/python-packages/sra_client/src/conf.py +++ b/python-packages/sra_client/src/conf.py @@ -22,7 +22,6 @@ extensions = [ "sphinx.ext.intersphinx", "sphinx.ext.coverage", "sphinx.ext.viewcode", - "sphinx_autodoc_typehints", ] templates_path = ["doc_templates"]