From f20e8a92f9cf3638b7015b8b7bfbd21b9c3d097b Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 15:52:28 +0300 Subject: [PATCH 01/30] initial commit --- .github/workflows/build-docs.yml | 32 +++ docs/Makefile | 20 ++ docs/conf.py | 33 +++ docs/index.rst | 20 ++ docs/make.bat | 35 +++ docs/modules.rst | 7 + docs/multiversx_sdk.core.adapters.rst | 21 ++ docs/multiversx_sdk.core.proto.rst | 37 +++ docs/multiversx_sdk.core.rst | 258 ++++++++++++++++++ ...ltiversx_sdk.core.transaction_builders.rst | 125 +++++++++ ...ultiversx_sdk.core.transaction_parsers.rst | 53 ++++ ...iversx_sdk.core.transactions_factories.rst | 133 +++++++++ ..._sdk.core.transactions_outcome_parsers.rst | 45 +++ docs/multiversx_sdk.network_providers.rst | 213 +++++++++++++++ docs/multiversx_sdk.rst | 20 ++ docs/multiversx_sdk.wallet.crypto.rst | 53 ++++ docs/multiversx_sdk.wallet.libraries.rst | 37 +++ docs/multiversx_sdk.wallet.rst | 174 ++++++++++++ multiversx_sdk/core/account.py | 21 +- multiversx_sdk/core/address.py | 59 +++- pyproject.toml | 5 +- requirements-dev.txt | 2 + 22 files changed, 1388 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/build-docs.yml create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 docs/modules.rst create mode 100644 docs/multiversx_sdk.core.adapters.rst create mode 100644 docs/multiversx_sdk.core.proto.rst create mode 100644 docs/multiversx_sdk.core.rst create mode 100644 docs/multiversx_sdk.core.transaction_builders.rst create mode 100644 docs/multiversx_sdk.core.transaction_parsers.rst create mode 100644 docs/multiversx_sdk.core.transactions_factories.rst create mode 100644 docs/multiversx_sdk.core.transactions_outcome_parsers.rst create mode 100644 docs/multiversx_sdk.network_providers.rst create mode 100644 docs/multiversx_sdk.rst create mode 100644 docs/multiversx_sdk.wallet.crypto.rst create mode 100644 docs/multiversx_sdk.wallet.libraries.rst create mode 100644 docs/multiversx_sdk.wallet.rst diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 00000000..783d0d62 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,32 @@ +name: Build-sphinx-docs + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v3 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + - name: Build documentation + run: | + cd docs/ + make html + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/html/ diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d4bb2cbb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..9d259e1e --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,33 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +import os +import sys + +sys.path.insert(0, os.path.abspath("..")) + +project = 'multiversx-sdk' +copyright = '2024, MultiversX' +author = 'MultiversX' +release = '0.9.0' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ["sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx.ext.autodoc"] + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '*_test.py', 'constants.py'] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'sphinx_rtd_theme' +html_static_path = ['_static'] +autoclass_content = 'both' diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..8a395e1d --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,20 @@ +.. multiversx-sdk documentation master file, created by + sphinx-quickstart on Tue Apr 2 15:36:13 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to multiversx-sdk's documentation! +========================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + modules + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..32bb2452 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/modules.rst b/docs/modules.rst new file mode 100644 index 00000000..158a017c --- /dev/null +++ b/docs/modules.rst @@ -0,0 +1,7 @@ +multiversx_sdk +============== + +.. toctree:: + :maxdepth: 4 + + multiversx_sdk diff --git a/docs/multiversx_sdk.core.adapters.rst b/docs/multiversx_sdk.core.adapters.rst new file mode 100644 index 00000000..3ca21881 --- /dev/null +++ b/docs/multiversx_sdk.core.adapters.rst @@ -0,0 +1,21 @@ +multiversx\_sdk.core.adapters package +===================================== + +Submodules +---------- + +multiversx\_sdk.core.adapters.query\_runner\_adapter module +----------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.adapters.query_runner_adapter + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.core.adapters + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.core.proto.rst b/docs/multiversx_sdk.core.proto.rst new file mode 100644 index 00000000..617e2e70 --- /dev/null +++ b/docs/multiversx_sdk.core.proto.rst @@ -0,0 +1,37 @@ +multiversx\_sdk.core.proto package +================================== + +Submodules +---------- + +multiversx\_sdk.core.proto.transaction\_pb2 module +-------------------------------------------------- + +.. automodule:: multiversx_sdk.core.proto.transaction_pb2 + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.proto.transaction\_serializer module +--------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.proto.transaction_serializer + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.proto.transaction\_serializer\_test module +--------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.proto.transaction_serializer_test + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.core.proto + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.core.rst b/docs/multiversx_sdk.core.rst new file mode 100644 index 00000000..0ba1b570 --- /dev/null +++ b/docs/multiversx_sdk.core.rst @@ -0,0 +1,258 @@ +multiversx\_sdk.core package +============================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + multiversx_sdk.core.adapters + multiversx_sdk.core.proto + multiversx_sdk.core.transaction_builders + multiversx_sdk.core.transaction_parsers + multiversx_sdk.core.transactions_factories + multiversx_sdk.core.transactions_outcome_parsers + +Submodules +---------- + +multiversx\_sdk.core.account module +----------------------------------- + +.. automodule:: multiversx_sdk.core.account + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.account\_test module +----------------------------------------- + +.. automodule:: multiversx_sdk.core.account_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.address module +----------------------------------- + +.. automodule:: multiversx_sdk.core.address + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.address\_test module +----------------------------------------- + +.. automodule:: multiversx_sdk.core.address_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.bech32 module +---------------------------------- + +.. automodule:: multiversx_sdk.core.bech32 + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.code\_metadata module +------------------------------------------ + +.. automodule:: multiversx_sdk.core.code_metadata + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.code\_metadata\_test module +------------------------------------------------ + +.. automodule:: multiversx_sdk.core.code_metadata_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.codec module +--------------------------------- + +.. automodule:: multiversx_sdk.core.codec + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.codec\_test module +--------------------------------------- + +.. automodule:: multiversx_sdk.core.codec_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.constants module +------------------------------------- + +.. automodule:: multiversx_sdk.core.constants + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.contract\_query module +------------------------------------------- + +.. automodule:: multiversx_sdk.core.contract_query + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.contract\_query\_builder module +---------------------------------------------------- + +.. automodule:: multiversx_sdk.core.contract_query_builder + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.contract\_query\_builder\_test module +---------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.contract_query_builder_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.errors module +---------------------------------- + +.. automodule:: multiversx_sdk.core.errors + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.interfaces module +-------------------------------------- + +.. automodule:: multiversx_sdk.core.interfaces + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.message module +----------------------------------- + +.. automodule:: multiversx_sdk.core.message + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.message\_test module +----------------------------------------- + +.. automodule:: multiversx_sdk.core.message_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.serializer module +-------------------------------------- + +.. automodule:: multiversx_sdk.core.serializer + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.smart\_contract\_queries\_controller module +---------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.smart_contract_queries_controller + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.smart\_contract\_queries\_controller\_test module +---------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.smart_contract_queries_controller_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.smart\_contract\_query module +-------------------------------------------------- + +.. automodule:: multiversx_sdk.core.smart_contract_query + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.token\_payment module +------------------------------------------ + +.. automodule:: multiversx_sdk.core.token_payment + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.token\_payment\_test module +------------------------------------------------ + +.. automodule:: multiversx_sdk.core.token_payment_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.tokens module +---------------------------------- + +.. automodule:: multiversx_sdk.core.tokens + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.tokens\_test module +---------------------------------------- + +.. automodule:: multiversx_sdk.core.tokens_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction module +--------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_payload module +------------------------------------------------ + +.. automodule:: multiversx_sdk.core.transaction_payload + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_test module +--------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.typecheck module +------------------------------------- + +.. automodule:: multiversx_sdk.core.typecheck + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.core + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.core.transaction_builders.rst b/docs/multiversx_sdk.core.transaction_builders.rst new file mode 100644 index 00000000..c12c9962 --- /dev/null +++ b/docs/multiversx_sdk.core.transaction_builders.rst @@ -0,0 +1,125 @@ +multiversx\_sdk.core.transaction\_builders package +================================================== + +Submodules +---------- + +multiversx\_sdk.core.transaction\_builders.contract\_builders module +-------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.contract_builders + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.contract\_builders\_test module +-------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.contract_builders_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.default\_configuration module +------------------------------------------------------------------------ + +.. automodule:: multiversx_sdk.core.transaction_builders.default_configuration + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.default\_configuration\_test module +------------------------------------------------------------------------------ + +.. automodule:: multiversx_sdk.core.transaction_builders.default_configuration_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.esdt\_builders module +---------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.esdt_builders + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.esdt\_builders\_test module +---------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.esdt_builders_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.other\_builders module +----------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.other_builders + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.relayed\_v1\_builder module +---------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.relayed_v1_builder + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.relayed\_v1\_builder\_test module +---------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.relayed_v1_builder_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.relayed\_v2\_builder module +---------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.relayed_v2_builder + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.relayed\_v2\_builder\_test module +---------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.relayed_v2_builder_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.transaction\_builder module +---------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.transaction_builder + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.transfers\_builders module +--------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.transfers_builders + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_builders.transfers\_builders\_test module +--------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_builders.transfers_builders_test + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.core.transaction_builders + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.core.transaction_parsers.rst b/docs/multiversx_sdk.core.transaction_parsers.rst new file mode 100644 index 00000000..990e8614 --- /dev/null +++ b/docs/multiversx_sdk.core.transaction_parsers.rst @@ -0,0 +1,53 @@ +multiversx\_sdk.core.transaction\_parsers package +================================================= + +Submodules +---------- + +multiversx\_sdk.core.transaction\_parsers.interfaces module +----------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_parsers.interfaces + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_parsers.token\_operations\_outcome\_parser module +----------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_parsers.token_operations_outcome_parser + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_parsers.token\_operations\_outcome\_parser\_test module +----------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_parsers.token_operations_outcome_parser_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_parsers.token\_operations\_outcome\_parser\_types module +------------------------------------------------------------------------------------------ + +.. automodule:: multiversx_sdk.core.transaction_parsers.token_operations_outcome_parser_types + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transaction\_parsers.transaction\_on\_network\_wrapper module +---------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transaction_parsers.transaction_on_network_wrapper + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.core.transaction_parsers + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.core.transactions_factories.rst b/docs/multiversx_sdk.core.transactions_factories.rst new file mode 100644 index 00000000..77d64aae --- /dev/null +++ b/docs/multiversx_sdk.core.transactions_factories.rst @@ -0,0 +1,133 @@ +multiversx\_sdk.core.transactions\_factories package +==================================================== + +Submodules +---------- + +multiversx\_sdk.core.transactions\_factories.account\_transactions\_factory module +---------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.account_transactions_factory + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.account\_transactions\_factory\_test module +---------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.account_transactions_factory_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.delegation\_transactions\_factory module +------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.delegation_transactions_factory + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.delegation\_transactions\_factory\_test module +------------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.delegation_transactions_factory_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.relayed\_transactions\_factory module +---------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.relayed_transactions_factory + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.relayed\_transactions\_factory\_test module +---------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.relayed_transactions_factory_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.smart\_contract\_transaction\_factory\_test module +----------------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.smart_contract_transaction_factory_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.smart\_contract\_transactions\_factory module +------------------------------------------------------------------------------------------ + +.. automodule:: multiversx_sdk.core.transactions_factories.smart_contract_transactions_factory + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.token\_management\_transactions\_factory module +-------------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.token_management_transactions_factory + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.token\_management\_transactions\_factory\_test module +-------------------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.token_management_transactions_factory_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.token\_transfers\_data\_builder module +----------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.token_transfers_data_builder + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.transaction\_builder module +------------------------------------------------------------------------ + +.. automodule:: multiversx_sdk.core.transactions_factories.transaction_builder + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.transactions\_factory\_config module +--------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.transactions_factory_config + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.transfer\_transactions\_factory module +----------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.transfer_transactions_factory + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_factories.transfer\_transactions\_factory\_test module +----------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_factories.transfer_transactions_factory_test + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.core.transactions_factories + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.core.transactions_outcome_parsers.rst b/docs/multiversx_sdk.core.transactions_outcome_parsers.rst new file mode 100644 index 00000000..fafaf713 --- /dev/null +++ b/docs/multiversx_sdk.core.transactions_outcome_parsers.rst @@ -0,0 +1,45 @@ +multiversx\_sdk.core.transactions\_outcome\_parsers package +=========================================================== + +Submodules +---------- + +multiversx\_sdk.core.transactions\_outcome\_parsers.resources module +-------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_outcome_parsers.resources + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_outcome\_parsers.token\_management\_transactions\_outcome\_parser module +----------------------------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_outcome_parsers.token_management_transactions_outcome_parser + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_outcome\_parsers.token\_management\_transactions\_outcome\_parser\_test module +----------------------------------------------------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.core.transactions_outcome_parsers.token_management_transactions_outcome_parser_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.core.transactions\_outcome\_parsers.token\_management\_transactions\_outcome\_parser\_types module +------------------------------------------------------------------------------------------------------------------ + +.. automodule:: multiversx_sdk.core.transactions_outcome_parsers.token_management_transactions_outcome_parser_types + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.core.transactions_outcome_parsers + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.network_providers.rst b/docs/multiversx_sdk.network_providers.rst new file mode 100644 index 00000000..fe282244 --- /dev/null +++ b/docs/multiversx_sdk.network_providers.rst @@ -0,0 +1,213 @@ +multiversx\_sdk.network\_providers package +========================================== + +Submodules +---------- + +multiversx\_sdk.network\_providers.accounts module +-------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.accounts + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.api\_network\_provider module +---------------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.api_network_provider + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.api\_network\_provider\_test module +---------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.api_network_provider_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.config module +------------------------------------------------ + +.. automodule:: multiversx_sdk.network_providers.config + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.constants module +--------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.constants + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.contract\_query\_requests module +------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.contract_query_requests + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.contract\_query\_response module +------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.contract_query_response + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.contract\_results module +----------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.contract_results + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.errors module +------------------------------------------------ + +.. automodule:: multiversx_sdk.network_providers.errors + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.interface module +--------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.interface + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.network\_config module +--------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.network_config + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.network\_general\_statistics module +---------------------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.network_general_statistics + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.network\_stake module +-------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.network_stake + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.network\_status module +--------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.network_status + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.proxy\_network\_provider module +------------------------------------------------------------------ + +.. automodule:: multiversx_sdk.network_providers.proxy_network_provider + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.proxy\_network\_provider\_test module +------------------------------------------------------------------------ + +.. automodule:: multiversx_sdk.network_providers.proxy_network_provider_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.resources module +--------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.resources + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.token\_definitions module +------------------------------------------------------------ + +.. automodule:: multiversx_sdk.network_providers.token_definitions + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.tokens module +------------------------------------------------ + +.. automodule:: multiversx_sdk.network_providers.tokens + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.transaction\_events module +------------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.transaction_events + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.transaction\_logs module +----------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.transaction_logs + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.transaction\_receipt module +-------------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.transaction_receipt + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.transaction\_status module +------------------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.transaction_status + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.transactions module +------------------------------------------------------ + +.. automodule:: multiversx_sdk.network_providers.transactions + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.network\_providers.utils module +----------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.network_providers + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.rst b/docs/multiversx_sdk.rst new file mode 100644 index 00000000..2a1d9894 --- /dev/null +++ b/docs/multiversx_sdk.rst @@ -0,0 +1,20 @@ +multiversx\_sdk package +======================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + multiversx_sdk.core + multiversx_sdk.network_providers + multiversx_sdk.wallet + +Module contents +--------------- + +.. automodule:: multiversx_sdk + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.wallet.crypto.rst b/docs/multiversx_sdk.wallet.crypto.rst new file mode 100644 index 00000000..1fe091f4 --- /dev/null +++ b/docs/multiversx_sdk.wallet.crypto.rst @@ -0,0 +1,53 @@ +multiversx\_sdk.wallet.crypto package +===================================== + +Submodules +---------- + +multiversx\_sdk.wallet.crypto.constants module +---------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.crypto.constants + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.crypto.decryptor module +---------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.crypto.decryptor + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.crypto.encrypted\_data module +---------------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.crypto.encrypted_data + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.crypto.encryptor module +---------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.crypto.encryptor + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.crypto.randomness module +----------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.crypto.randomness + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.wallet.crypto + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.wallet.libraries.rst b/docs/multiversx_sdk.wallet.libraries.rst new file mode 100644 index 00000000..3f092179 --- /dev/null +++ b/docs/multiversx_sdk.wallet.libraries.rst @@ -0,0 +1,37 @@ +multiversx\_sdk.wallet.libraries package +======================================== + +Submodules +---------- + +multiversx\_sdk.wallet.libraries.bls\_facade module +--------------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.libraries.bls_facade + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.libraries.bls\_facade\_test module +--------------------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.libraries.bls_facade_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.libraries.libbls module +---------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.libraries.libbls + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.wallet.libraries + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/multiversx_sdk.wallet.rst b/docs/multiversx_sdk.wallet.rst new file mode 100644 index 00000000..493355c7 --- /dev/null +++ b/docs/multiversx_sdk.wallet.rst @@ -0,0 +1,174 @@ +multiversx\_sdk.wallet package +============================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + multiversx_sdk.wallet.crypto + multiversx_sdk.wallet.libraries + +Submodules +---------- + +multiversx\_sdk.wallet.constants module +--------------------------------------- + +.. automodule:: multiversx_sdk.wallet.constants + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.core module +---------------------------------- + +.. automodule:: multiversx_sdk.wallet.core + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.errors module +------------------------------------ + +.. automodule:: multiversx_sdk.wallet.errors + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.interfaces module +---------------------------------------- + +.. automodule:: multiversx_sdk.wallet.interfaces + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.mnemonic module +-------------------------------------- + +.. automodule:: multiversx_sdk.wallet.mnemonic + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.mnemonic\_test module +-------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.mnemonic_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.pem\_entry module +---------------------------------------- + +.. automodule:: multiversx_sdk.wallet.pem_entry + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.pem\_entry\_test module +---------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.pem_entry_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.user\_keys module +---------------------------------------- + +.. automodule:: multiversx_sdk.wallet.user_keys + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.user\_pem module +--------------------------------------- + +.. automodule:: multiversx_sdk.wallet.user_pem + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.user\_signer module +------------------------------------------ + +.. automodule:: multiversx_sdk.wallet.user_signer + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.user\_test module +---------------------------------------- + +.. automodule:: multiversx_sdk.wallet.user_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.user\_verifer module +------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.user_verifer + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.user\_wallet module +------------------------------------------ + +.. automodule:: multiversx_sdk.wallet.user_wallet + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.validator\_keys module +--------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.validator_keys + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.validator\_pem module +-------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.validator_pem + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.validator\_signer module +----------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.validator_signer + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.validator\_test module +--------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.validator_test + :members: + :undoc-members: + :show-inheritance: + +multiversx\_sdk.wallet.validator\_verifier module +------------------------------------------------- + +.. automodule:: multiversx_sdk.wallet.validator_verifier + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: multiversx_sdk.wallet + :members: + :undoc-members: + :show-inheritance: diff --git a/multiversx_sdk/core/account.py b/multiversx_sdk/core/account.py index 631c0e32..b0bb5faf 100644 --- a/multiversx_sdk/core/account.py +++ b/multiversx_sdk/core/account.py @@ -1,19 +1,22 @@ +class AccountNonceHolder(): + """An abstraction representing an account's nonce on the Network.""" -from multiversx_sdk.core.interfaces import INonce - + def __init__(self, initial_nonce: int = 0): + """Creates an acount nonce holder object from an initial nonce. -class AccountNonceHolder(): - """ - An abstraction representing an account (user or Smart Contract) on the Network. - """ + Args: + initial_nonce (int): the current nonce of the account""" + self.nonce = initial_nonce - def __init__(self, initial_nonce: INonce = 0): - self.nonce: INonce = initial_nonce + def get_nonce_then_increment(self) -> int: + """Returns the current nonce then increments it - def get_nonce_then_increment(self) -> INonce: + Returns: + int: the current nonce""" nonce = self.nonce self.increment_nonce() return nonce def increment_nonce(self): + """Increments the current nonce""" self.nonce += 1 diff --git a/multiversx_sdk/core/address.py b/multiversx_sdk/core/address.py index 48647eb1..4dfe8518 100644 --- a/multiversx_sdk/core/address.py +++ b/multiversx_sdk/core/address.py @@ -24,7 +24,14 @@ def get_hrp(self) -> str: class Address: + """An Address, as an immutable object.""" + def __init__(self, pubkey: bytes, hrp: str) -> None: + """Creates an address object, given a sequence of bytes and the human readable part(hrp). + + Args: + pubkey (bytes): the sequence of bytes\n + hrp (str): the human readable part""" if len(pubkey) != PUBKEY_LENGTH: raise ErrBadPubkeyLength(len(pubkey), PUBKEY_LENGTH) @@ -33,6 +40,10 @@ def __init__(self, pubkey: bytes, hrp: str) -> None: @classmethod def new_from_bech32(cls, value: str) -> 'Address': + """Creates an address object from the bech32 representation of an address. + + Args: + value (str): the bech32 address representation""" hrp, pubkey = _decode_bech32(value) return cls(pubkey, hrp) @@ -43,6 +54,11 @@ def from_bech32(cls, value: str) -> 'Address': @classmethod def new_from_hex(cls, value: str, hrp: str) -> 'Address': + """Creates an address object from the hexed sequence of bytes and the human readable part(hrp). + + Args: + value (str): the sequence of bytes as a hex string\n + hrp (str): the human readable part""" pubkey = bytes.fromhex(value) return cls(pubkey, hrp) @@ -52,6 +68,7 @@ def from_hex(cls, value: str, hrp: str) -> 'Address': return Address.new_from_hex(value, hrp) def to_hex(self) -> str: + """Returns the hex representation of the address (pubkey)""" return self.pubkey.hex() def hex(self) -> str: @@ -59,6 +76,7 @@ def hex(self) -> str: return self.to_hex() def to_bech32(self) -> str: + """Returns the bech32 representation of the address""" converted = bech32.convertbits(self.pubkey, 8, 5) assert converted is not None encoded = bech32.bech32_encode(self.hrp, converted) @@ -69,26 +87,37 @@ def bech32(self) -> str: return self.to_bech32() def get_public_key(self) -> bytes: + """Returns the pubkey as bytes""" return self.pubkey def get_hrp(self) -> str: + """Returns the human-readable-part of the bech32 address""" return self.hrp - def is_smart_contract(self): + def is_smart_contract(self) -> bool: + """Returns whether the address is a smart contract address""" return self.to_hex().startswith(SC_HEX_PUBKEY_PREFIX) # this will be removed in v1.0.0; it's here for compatibility reasons with the deprecated transaction builders # the transaction builders will also be removed in v1.0.0 def serialize(self) -> bytes: + """This method is deprecated and will soon be removed. Also displays a deprecation warning when used.""" logger.warning("The `serialize()` method is deprecated and will soon be removed") return self.get_public_key() class AddressFactory: + """A factory used to create address objects.""" + def __init__(self, hrp: str = DEFAULT_HRP) -> None: + """All the addresses created with the factory have the same human readable part + + Args: + hrp (str): the human readable part of the address (default: erd)""" self.hrp = hrp def create_from_bech32(self, value: str) -> Address: + """Creates an address object from the bech32 representation of an address""" hrp, pubkey = _decode_bech32(value) if hrp != self.hrp: raise ErrBadAddress(value) @@ -96,20 +125,35 @@ def create_from_bech32(self, value: str) -> Address: return Address(pubkey, hrp) def create_from_public_key(self, pubkey: bytes) -> Address: + """Creates an address object from the sequence of bytes""" return Address(pubkey, self.hrp) def create_from_hex(self, value: str) -> Address: + """Creates an address object from the hexed sequence of bytes""" return Address.new_from_hex(value, self.hrp) class AddressComputer: + """A class for computing contract addresses and getting shard numbers.""" + def __init__(self, number_of_shards: int = 3) -> None: + """Initializes the AddressComputer with the number of shards. + + Args: + number_of_shards (int): The number of shards in the network (default: 3).""" self.number_of_shards = number_of_shards def compute_contract_address(self, deployer: IAddress, deployment_nonce: int) -> Address: - """ - 8 bytes of zero + 2 bytes for VM type + 20 bytes of hash(owner) + 2 bytes of shard(owner) - """ + """Computes the contract address based on the deployer's address and deployment nonce. + + Args: + deployer (IAddress): The address of the deployer\n + deployment_nonce (int): The nonce of the deployment + + Returns: + Address: The computed contract address as below: + + 8 bytes of zero + 2 bytes for VM type + 20 bytes of hash(owner) + 2 bytes of shard(owner)""" deployer_pubkey = deployer.get_public_key() nonce_bytes = deployment_nonce.to_bytes(8, byteorder="little") bytes_to_hash = deployer_pubkey + nonce_bytes @@ -118,6 +162,13 @@ def compute_contract_address(self, deployer: IAddress, deployment_nonce: int) -> return Address(contract_pubkey, deployer.get_hrp()) def get_shard_of_address(self, address: IAddress) -> int: + """Returns the shard number of a given address. + + Args: + address (IAddress): The address for which to determine the shard. + + Returns: + int: The shard number.""" return get_shard_of_pubkey(address.get_public_key(), self.number_of_shards) diff --git a/pyproject.toml b/pyproject.toml index f4c0e8de..003a13a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ allow-direct-references = true [project] name = "multiversx-sdk" -version = "0.1.0" +version = "0.9.0" authors = [ { name="MultiversX" }, ] @@ -36,5 +36,6 @@ exclude = [ ".github", "./examples", ".vscode", - "./multiversx_sdk/testutils/" + "./multiversx_sdk/testutils/", + "./docs" ] diff --git a/requirements-dev.txt b/requirements-dev.txt index 7f0fd9bf..494509ba 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,5 @@ flake8 autopep8 pre-commit ipykernel +sphinx +sphinx-rtd-theme From fa1c5e533ea12c5e39e45f49b5d3672643e0f294 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 16:14:36 +0300 Subject: [PATCH 02/30] Remove ignored files --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 11a51a3b..f25ab1d7 100644 --- a/.gitignore +++ b/.gitignore @@ -139,3 +139,7 @@ typings/** !libbls.dll examples/output + +./docs/_build +./docs/_static +./docs/_templates \ No newline at end of file From 624f63ea4cd272d995f272f2d3af11bd88730cdc Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 16:35:14 +0300 Subject: [PATCH 03/30] add workflow to publish docs --- .github/workflows/build-docs.yml | 18 +++++++++++++----- docs/index.rst | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 783d0d62..c6255562 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -4,7 +4,10 @@ name: Build-sphinx-docs on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: main + pull_request: + branches: + - main workflow_dispatch: jobs: @@ -26,7 +29,12 @@ jobs: cd docs/ make html - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./_build/html/ + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git checkout gh-pages || git checkout --orphan gh-pages + git rm -rf . + mv ./_build/html + git add . + git commit -m "Deploy documentation from GitHub Actions" + git push origin gh-pages diff --git a/docs/index.rst b/docs/index.rst index 8a395e1d..c3ad4aa3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ .. multiversx-sdk documentation master file, created by - sphinx-quickstart on Tue Apr 2 15:36:13 2024. + sphinx-quickstart on Tue Apr 2 16:32:28 2024. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. From 5464a4a351738042b3daae28cdba1aa41af3ea0d Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:02:19 +0300 Subject: [PATCH 04/30] fix gh action --- .github/workflows/build-docs.yml | 5 +++-- .gitignore | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index c6255562..b28f63c1 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -23,6 +23,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install -r requirements.txt pip install -r requirements-dev.txt - name: Build documentation run: | @@ -32,9 +33,9 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - git checkout gh-pages || git checkout --orphan gh-pages + git checkout gh-pages git rm -rf . - mv ./_build/html + mv ./_build/html ./ git add . git commit -m "Deploy documentation from GitHub Actions" git push origin gh-pages diff --git a/.gitignore b/.gitignore index f25ab1d7..348cbe5e 100644 --- a/.gitignore +++ b/.gitignore @@ -140,6 +140,4 @@ typings/** examples/output -./docs/_build -./docs/_static -./docs/_templates \ No newline at end of file +./docs/_build/* From f80d011a2d3e4e096c88750ea66604ef7900074e Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:06:02 +0300 Subject: [PATCH 05/30] fix workflow --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index b28f63c1..771fa1f9 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -33,7 +33,7 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - git checkout gh-pages + git checkout gh-pages || git checkout --orphan gh-pages git rm -rf . mv ./_build/html ./ git add . From f0007f22fd71bbe4489fdffd91f4eb95ea364f16 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:10:24 +0300 Subject: [PATCH 06/30] debug workflow --- .github/workflows/build-docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 771fa1f9..c0b8475d 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -34,7 +34,10 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" git checkout gh-pages || git checkout --orphan gh-pages + ls git rm -rf . + ls + $ echo "$PWD" mv ./_build/html ./ git add . git commit -m "Deploy documentation from GitHub Actions" From ff2805800d1fed51d36aaa748fb57c9ad351728b Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:13:30 +0300 Subject: [PATCH 07/30] debug second try --- .github/workflows/build-docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index c0b8475d..1eeddd13 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -37,7 +37,8 @@ jobs: ls git rm -rf . ls - $ echo "$PWD" + echo "$PWD" + echo ${{ github.workspace }} mv ./_build/html ./ git add . git commit -m "Deploy documentation from GitHub Actions" From d1a501dbdcd7a005bdbe249315b4e7d60fc037a1 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:17:49 +0300 Subject: [PATCH 08/30] modify workflow --- .github/workflows/build-docs.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 1eeddd13..5056da49 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -34,12 +34,10 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" git checkout gh-pages || git checkout --orphan gh-pages - ls - git rm -rf . - ls - echo "$PWD" - echo ${{ github.workspace }} - mv ./_build/html ./ + git pull origin gh-pages || true + rm -rf * + mv $GITHUB_WORKSPACE/docs/_build/html/* ./ + touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" git push origin gh-pages From 729421f6a78549b9c330de96f76e31ad57b399f9 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:23:30 +0300 Subject: [PATCH 09/30] debugging --- .github/workflows/build-docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 5056da49..6b3314cf 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -29,6 +29,9 @@ jobs: run: | cd docs/ make html + cd docs/_build/html + ls -l + tree - name: Deploy to GitHub Pages run: | git config --global user.email "actions@github.com" From 1bf93971d3c2ed3143dd3b7e94617b02aed6278e Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:26:35 +0300 Subject: [PATCH 10/30] debugging --- .github/workflows/build-docs.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 6b3314cf..11acc12a 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -29,9 +29,8 @@ jobs: run: | cd docs/ make html - cd docs/_build/html - ls -l - tree + ls -l docs/_build + ls -l docs/_build/html - name: Deploy to GitHub Pages run: | git config --global user.email "actions@github.com" From 001626cf7c6b1c12ccace161e36a0fa44e628f91 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:30:13 +0300 Subject: [PATCH 11/30] try to fix workflow --- .github/workflows/build-docs.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 11acc12a..ebeca4bd 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -29,8 +29,6 @@ jobs: run: | cd docs/ make html - ls -l docs/_build - ls -l docs/_build/html - name: Deploy to GitHub Pages run: | git config --global user.email "actions@github.com" @@ -38,7 +36,7 @@ jobs: git checkout gh-pages || git checkout --orphan gh-pages git pull origin gh-pages || true rm -rf * - mv $GITHUB_WORKSPACE/docs/_build/html/* ./ + mv ./_build/html/* ./ touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" From bdad27120dd240cd6ab9cf29b036eb778e452088 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:35:16 +0300 Subject: [PATCH 12/30] debugging --- .github/workflows/build-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index ebeca4bd..04b6154d 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -29,6 +29,7 @@ jobs: run: | cd docs/ make html + ls -l /_build/html - name: Deploy to GitHub Pages run: | git config --global user.email "actions@github.com" From f3b20efa6f67638af77431711e8260e684b64cc8 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Tue, 2 Apr 2024 17:38:53 +0300 Subject: [PATCH 13/30] try new fix --- .github/workflows/build-docs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 04b6154d..0ec81e8c 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -29,7 +29,6 @@ jobs: run: | cd docs/ make html - ls -l /_build/html - name: Deploy to GitHub Pages run: | git config --global user.email "actions@github.com" @@ -37,7 +36,7 @@ jobs: git checkout gh-pages || git checkout --orphan gh-pages git pull origin gh-pages || true rm -rf * - mv ./_build/html/* ./ + mv -f ../docs/_build/html/* . touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" From 5ec8fa4a2fdc00888b413ba4fa2339daa0414995 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 09:48:32 +0300 Subject: [PATCH 14/30] try workflow fix --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 0ec81e8c..e2f4ff12 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -36,7 +36,7 @@ jobs: git checkout gh-pages || git checkout --orphan gh-pages git pull origin gh-pages || true rm -rf * - mv -f ../docs/_build/html/* . + mv -f ./docs/_build/html/* . touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" From 15fb46ab6bbcb8ad06cf9865c89814a9a8c1e266 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 10:17:36 +0300 Subject: [PATCH 15/30] try something else --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index e2f4ff12..c32e0fec 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -36,7 +36,7 @@ jobs: git checkout gh-pages || git checkout --orphan gh-pages git pull origin gh-pages || true rm -rf * - mv -f ./docs/_build/html/* . + mv -f ../${{ github.workspace }}/docs/_build/html/* . touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" From ef083ae5ed587b1eaf8d53d39e9877a10822d58c Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 10:46:28 +0300 Subject: [PATCH 16/30] try fix --- .github/workflows/build-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index c32e0fec..3716e9da 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -36,7 +36,7 @@ jobs: git checkout gh-pages || git checkout --orphan gh-pages git pull origin gh-pages || true rm -rf * - mv -f ../${{ github.workspace }}/docs/_build/html/* . + mv -f ./${{ github.workspace }}/docs/_build/html/* . touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" From 678073dd611b976450f7e5736dc926870db6c906 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 10:50:51 +0300 Subject: [PATCH 17/30] small changes --- .github/workflows/build-docs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 3716e9da..2c68e0f7 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -33,11 +33,11 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - git checkout gh-pages || git checkout --orphan gh-pages - git pull origin gh-pages || true + git checkout gh-pages + git pull origin gh-pages rm -rf * - mv -f ./${{ github.workspace }}/docs/_build/html/* . + mv -f ${{ github.workspace }}/docs/_build/html/* . touch .nojekyll git add . - git commit -m "Deploy documentation from GitHub Actions" + git commit -m "Deploy documentation from GitHub Actions" --allow-empty git push origin gh-pages From fe905a46d2f3456912ce9ff49071b56110dc4762 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:12:39 +0300 Subject: [PATCH 18/30] modify workflow --- .github/workflows/build-docs.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 2c68e0f7..fb771cbb 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -1,4 +1,4 @@ -name: Build-sphinx-docs +name: Build and deploy sphinx docs # Controls when the workflow will run on: @@ -15,8 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + ref: "gh-pages" + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Set up Python uses: actions/setup-python@v3 From 9222e8cd182384f61b2e8277b9c29d168ac8127a Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:22:38 +0300 Subject: [PATCH 19/30] try new workflow --- .github/workflows/build-docs.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index fb771cbb..fc7897ad 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -17,11 +17,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/checkout@v4 - with: - ref: "gh-pages" - repository: ${{ github.event.pull_request.head.repo.full_name }} - - name: Set up Python uses: actions/setup-python@v3 - name: Install dependencies @@ -33,12 +28,16 @@ jobs: run: | cd docs/ make html + + - uses: actions/checkout@v4 + with: + ref: "gh-pages" + repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Deploy to GitHub Pages run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - git checkout gh-pages - git pull origin gh-pages rm -rf * mv -f ${{ github.workspace }}/docs/_build/html/* . touch .nojekyll From 323290b36ea51188c5c6b7675fa8edb4c2527b9e Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:28:05 +0300 Subject: [PATCH 20/30] delete remove files --- .github/workflows/build-docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index fc7897ad..0094418a 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -38,7 +38,6 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - rm -rf * mv -f ${{ github.workspace }}/docs/_build/html/* . touch .nojekyll git add . From ec55a7d5d98cb2a420b56ab9295d8d1719c8fe9c Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:32:44 +0300 Subject: [PATCH 21/30] debugging --- .github/workflows/build-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 0094418a..fd4efe39 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -28,6 +28,7 @@ jobs: run: | cd docs/ make html + ls ./_build/html/ - uses: actions/checkout@v4 with: From 70f60838ff7c35176a7a314b18f6d1433174aea2 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:41:18 +0300 Subject: [PATCH 22/30] try fix --- .github/workflows/build-docs.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index fd4efe39..f3fccc1a 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -1,8 +1,6 @@ name: Build and deploy sphinx docs -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the main branch push: branches: main pull_request: @@ -28,17 +26,18 @@ jobs: run: | cd docs/ make html - ls ./_build/html/ - uses: actions/checkout@v4 with: ref: "gh-pages" repository: ${{ github.event.pull_request.head.repo.full_name }} + path: "docs" - name: Deploy to GitHub Pages run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" + cd ./docs mv -f ${{ github.workspace }}/docs/_build/html/* . touch .nojekyll git add . From 9d120206f9e61febc770980a20df5c95757b958d Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:47:18 +0300 Subject: [PATCH 23/30] try new fix --- .github/workflows/build-docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index f3fccc1a..31bbf2f0 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -37,7 +37,6 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - cd ./docs mv -f ${{ github.workspace }}/docs/_build/html/* . touch .nojekyll git add . From b097f8272fc4739bad031711d28d525c977e90b5 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:51:27 +0300 Subject: [PATCH 24/30] try another fix --- .github/workflows/build-docs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 31bbf2f0..2460fb1e 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -37,7 +37,9 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - mv -f ${{ github.workspace }}/docs/_build/html/* . + rm -rf ./docs/* + mv -f ${{ github.workspace }}/docs/_build/html/* ./docs + cd ./docs touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" --allow-empty From 8f5395cca3720be02d33b102e8c196c4f69ec8ef Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:53:08 +0300 Subject: [PATCH 25/30] debugging --- .github/workflows/build-docs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 2460fb1e..a8f17607 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -37,9 +37,11 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" + ls rm -rf ./docs/* mv -f ${{ github.workspace }}/docs/_build/html/* ./docs cd ./docs + ls touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" --allow-empty From 99917635856ebd7a53a7d40b71cc7984e37d9dfc Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 11:55:11 +0300 Subject: [PATCH 26/30] rename directory --- .github/workflows/build-docs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index a8f17607..2c8ff528 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -31,16 +31,16 @@ jobs: with: ref: "gh-pages" repository: ${{ github.event.pull_request.head.repo.full_name }} - path: "docs" + path: "gh-pages-docs" - name: Deploy to GitHub Pages run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" ls - rm -rf ./docs/* - mv -f ${{ github.workspace }}/docs/_build/html/* ./docs - cd ./docs + rm -rf ./gh-pages-docs/* + mv -f ${{ github.workspace }}/docs/_build/html/* ./gh-pages-docs + cd ./gh-pages-docs ls touch .nojekyll git add . From c7323670134ca8c54445ced57ff686f629cf258e Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 12:19:56 +0300 Subject: [PATCH 27/30] cleanup workflow --- .github/workflows/build-docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 2c8ff528..1e4778fe 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -37,11 +37,9 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - ls rm -rf ./gh-pages-docs/* mv -f ${{ github.workspace }}/docs/_build/html/* ./gh-pages-docs cd ./gh-pages-docs - ls touch .nojekyll git add . git commit -m "Deploy documentation from GitHub Actions" --allow-empty From f93d365d5bf0db5f9e9b33de1082c4957de0a0c3 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 14:59:07 +0300 Subject: [PATCH 28/30] remove tests and constants from the docs & update readme --- README.md | 11 +++ docs/conf.py | 2 +- docs/index.rst | 2 +- docs/multiversx_sdk.core.proto.rst | 8 -- docs/multiversx_sdk.core.rst | 88 ------------------- ...ltiversx_sdk.core.transaction_builders.rst | 48 ---------- ...ultiversx_sdk.core.transaction_parsers.rst | 8 -- ...iversx_sdk.core.transactions_factories.rst | 48 ---------- ..._sdk.core.transactions_outcome_parsers.rst | 8 -- docs/multiversx_sdk.network_providers.rst | 24 ----- docs/multiversx_sdk.wallet.crypto.rst | 8 -- docs/multiversx_sdk.wallet.libraries.rst | 8 -- docs/multiversx_sdk.wallet.rst | 40 --------- 13 files changed, 13 insertions(+), 290 deletions(-) diff --git a/README.md b/README.md index 552ff158..c1b24433 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,14 @@ If you want to skip network interaction tests run: ``` pytest -m "not networkInteraction" ``` + +### Regenerating the docs + +Each time a new module/submodule is added it needs to be added to the docs, as well. To do `cd` in the root directory then run the following command: +```bash +sphinx-apidoc -f -o docs/ multiversx_sdk/ *_test.py *constants.py +``` + +This command will regenerate the `.rst` files for each module, excluding the tests. + +Also, each time a new version is released, the [**conf.py**](/docs/conf.py) file should be updated accordingly. diff --git a/docs/conf.py b/docs/conf.py index 9d259e1e..12e12646 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ extensions = ["sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx.ext.autodoc"] templates_path = ['_templates'] -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '*_test.py', 'constants.py'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # -- Options for HTML output ------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index c3ad4aa3..f6751aa3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,5 @@ .. multiversx-sdk documentation master file, created by - sphinx-quickstart on Tue Apr 2 16:32:28 2024. + sphinx-quickstart on Wed Apr 3 14:19:32 2024. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. diff --git a/docs/multiversx_sdk.core.proto.rst b/docs/multiversx_sdk.core.proto.rst index 617e2e70..6544a8a1 100644 --- a/docs/multiversx_sdk.core.proto.rst +++ b/docs/multiversx_sdk.core.proto.rst @@ -20,14 +20,6 @@ multiversx\_sdk.core.proto.transaction\_serializer module :undoc-members: :show-inheritance: -multiversx\_sdk.core.proto.transaction\_serializer\_test module ---------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.proto.transaction_serializer_test - :members: - :undoc-members: - :show-inheritance: - Module contents --------------- diff --git a/docs/multiversx_sdk.core.rst b/docs/multiversx_sdk.core.rst index 0ba1b570..6fa2f124 100644 --- a/docs/multiversx_sdk.core.rst +++ b/docs/multiversx_sdk.core.rst @@ -25,14 +25,6 @@ multiversx\_sdk.core.account module :undoc-members: :show-inheritance: -multiversx\_sdk.core.account\_test module ------------------------------------------ - -.. automodule:: multiversx_sdk.core.account_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.address module ----------------------------------- @@ -41,14 +33,6 @@ multiversx\_sdk.core.address module :undoc-members: :show-inheritance: -multiversx\_sdk.core.address\_test module ------------------------------------------ - -.. automodule:: multiversx_sdk.core.address_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.bech32 module ---------------------------------- @@ -65,14 +49,6 @@ multiversx\_sdk.core.code\_metadata module :undoc-members: :show-inheritance: -multiversx\_sdk.core.code\_metadata\_test module ------------------------------------------------- - -.. automodule:: multiversx_sdk.core.code_metadata_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.codec module --------------------------------- @@ -81,22 +57,6 @@ multiversx\_sdk.core.codec module :undoc-members: :show-inheritance: -multiversx\_sdk.core.codec\_test module ---------------------------------------- - -.. automodule:: multiversx_sdk.core.codec_test - :members: - :undoc-members: - :show-inheritance: - -multiversx\_sdk.core.constants module -------------------------------------- - -.. automodule:: multiversx_sdk.core.constants - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.contract\_query module ------------------------------------------- @@ -113,14 +73,6 @@ multiversx\_sdk.core.contract\_query\_builder module :undoc-members: :show-inheritance: -multiversx\_sdk.core.contract\_query\_builder\_test module ----------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.contract_query_builder_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.errors module ---------------------------------- @@ -145,14 +97,6 @@ multiversx\_sdk.core.message module :undoc-members: :show-inheritance: -multiversx\_sdk.core.message\_test module ------------------------------------------ - -.. automodule:: multiversx_sdk.core.message_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.serializer module -------------------------------------- @@ -169,14 +113,6 @@ multiversx\_sdk.core.smart\_contract\_queries\_controller module :undoc-members: :show-inheritance: -multiversx\_sdk.core.smart\_contract\_queries\_controller\_test module ----------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.smart_contract_queries_controller_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.smart\_contract\_query module -------------------------------------------------- @@ -193,14 +129,6 @@ multiversx\_sdk.core.token\_payment module :undoc-members: :show-inheritance: -multiversx\_sdk.core.token\_payment\_test module ------------------------------------------------- - -.. automodule:: multiversx_sdk.core.token_payment_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.tokens module ---------------------------------- @@ -209,14 +137,6 @@ multiversx\_sdk.core.tokens module :undoc-members: :show-inheritance: -multiversx\_sdk.core.tokens\_test module ----------------------------------------- - -.. automodule:: multiversx_sdk.core.tokens_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transaction module --------------------------------------- @@ -233,14 +153,6 @@ multiversx\_sdk.core.transaction\_payload module :undoc-members: :show-inheritance: -multiversx\_sdk.core.transaction\_test module ---------------------------------------------- - -.. automodule:: multiversx_sdk.core.transaction_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.typecheck module ------------------------------------- diff --git a/docs/multiversx_sdk.core.transaction_builders.rst b/docs/multiversx_sdk.core.transaction_builders.rst index c12c9962..023b1182 100644 --- a/docs/multiversx_sdk.core.transaction_builders.rst +++ b/docs/multiversx_sdk.core.transaction_builders.rst @@ -12,14 +12,6 @@ multiversx\_sdk.core.transaction\_builders.contract\_builders module :undoc-members: :show-inheritance: -multiversx\_sdk.core.transaction\_builders.contract\_builders\_test module --------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transaction_builders.contract_builders_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transaction\_builders.default\_configuration module ------------------------------------------------------------------------ @@ -28,14 +20,6 @@ multiversx\_sdk.core.transaction\_builders.default\_configuration module :undoc-members: :show-inheritance: -multiversx\_sdk.core.transaction\_builders.default\_configuration\_test module ------------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transaction_builders.default_configuration_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transaction\_builders.esdt\_builders module ---------------------------------------------------------------- @@ -44,14 +28,6 @@ multiversx\_sdk.core.transaction\_builders.esdt\_builders module :undoc-members: :show-inheritance: -multiversx\_sdk.core.transaction\_builders.esdt\_builders\_test module ----------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transaction_builders.esdt_builders_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transaction\_builders.other\_builders module ----------------------------------------------------------------- @@ -68,14 +44,6 @@ multiversx\_sdk.core.transaction\_builders.relayed\_v1\_builder module :undoc-members: :show-inheritance: -multiversx\_sdk.core.transaction\_builders.relayed\_v1\_builder\_test module ----------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transaction_builders.relayed_v1_builder_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transaction\_builders.relayed\_v2\_builder module ---------------------------------------------------------------------- @@ -84,14 +52,6 @@ multiversx\_sdk.core.transaction\_builders.relayed\_v2\_builder module :undoc-members: :show-inheritance: -multiversx\_sdk.core.transaction\_builders.relayed\_v2\_builder\_test module ----------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transaction_builders.relayed_v2_builder_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transaction\_builders.transaction\_builder module ---------------------------------------------------------------------- @@ -108,14 +68,6 @@ multiversx\_sdk.core.transaction\_builders.transfers\_builders module :undoc-members: :show-inheritance: -multiversx\_sdk.core.transaction\_builders.transfers\_builders\_test module ---------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transaction_builders.transfers_builders_test - :members: - :undoc-members: - :show-inheritance: - Module contents --------------- diff --git a/docs/multiversx_sdk.core.transaction_parsers.rst b/docs/multiversx_sdk.core.transaction_parsers.rst index 990e8614..7d627f5f 100644 --- a/docs/multiversx_sdk.core.transaction_parsers.rst +++ b/docs/multiversx_sdk.core.transaction_parsers.rst @@ -20,14 +20,6 @@ multiversx\_sdk.core.transaction\_parsers.token\_operations\_outcome\_parser mod :undoc-members: :show-inheritance: -multiversx\_sdk.core.transaction\_parsers.token\_operations\_outcome\_parser\_test module ------------------------------------------------------------------------------------------ - -.. automodule:: multiversx_sdk.core.transaction_parsers.token_operations_outcome_parser_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transaction\_parsers.token\_operations\_outcome\_parser\_types module ------------------------------------------------------------------------------------------ diff --git a/docs/multiversx_sdk.core.transactions_factories.rst b/docs/multiversx_sdk.core.transactions_factories.rst index 77d64aae..6d5b3ec8 100644 --- a/docs/multiversx_sdk.core.transactions_factories.rst +++ b/docs/multiversx_sdk.core.transactions_factories.rst @@ -12,14 +12,6 @@ multiversx\_sdk.core.transactions\_factories.account\_transactions\_factory modu :undoc-members: :show-inheritance: -multiversx\_sdk.core.transactions\_factories.account\_transactions\_factory\_test module ----------------------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transactions_factories.account_transactions_factory_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transactions\_factories.delegation\_transactions\_factory module ------------------------------------------------------------------------------------- @@ -28,14 +20,6 @@ multiversx\_sdk.core.transactions\_factories.delegation\_transactions\_factory m :undoc-members: :show-inheritance: -multiversx\_sdk.core.transactions\_factories.delegation\_transactions\_factory\_test module -------------------------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transactions_factories.delegation_transactions_factory_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transactions\_factories.relayed\_transactions\_factory module ---------------------------------------------------------------------------------- @@ -44,22 +28,6 @@ multiversx\_sdk.core.transactions\_factories.relayed\_transactions\_factory modu :undoc-members: :show-inheritance: -multiversx\_sdk.core.transactions\_factories.relayed\_transactions\_factory\_test module ----------------------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transactions_factories.relayed_transactions_factory_test - :members: - :undoc-members: - :show-inheritance: - -multiversx\_sdk.core.transactions\_factories.smart\_contract\_transaction\_factory\_test module ------------------------------------------------------------------------------------------------ - -.. automodule:: multiversx_sdk.core.transactions_factories.smart_contract_transaction_factory_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transactions\_factories.smart\_contract\_transactions\_factory module ------------------------------------------------------------------------------------------ @@ -76,14 +44,6 @@ multiversx\_sdk.core.transactions\_factories.token\_management\_transactions\_fa :undoc-members: :show-inheritance: -multiversx\_sdk.core.transactions\_factories.token\_management\_transactions\_factory\_test module --------------------------------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.core.transactions_factories.token_management_transactions_factory_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transactions\_factories.token\_transfers\_data\_builder module ----------------------------------------------------------------------------------- @@ -116,14 +76,6 @@ multiversx\_sdk.core.transactions\_factories.transfer\_transactions\_factory mod :undoc-members: :show-inheritance: -multiversx\_sdk.core.transactions\_factories.transfer\_transactions\_factory\_test module ------------------------------------------------------------------------------------------ - -.. automodule:: multiversx_sdk.core.transactions_factories.transfer_transactions_factory_test - :members: - :undoc-members: - :show-inheritance: - Module contents --------------- diff --git a/docs/multiversx_sdk.core.transactions_outcome_parsers.rst b/docs/multiversx_sdk.core.transactions_outcome_parsers.rst index fafaf713..397b957f 100644 --- a/docs/multiversx_sdk.core.transactions_outcome_parsers.rst +++ b/docs/multiversx_sdk.core.transactions_outcome_parsers.rst @@ -20,14 +20,6 @@ multiversx\_sdk.core.transactions\_outcome\_parsers.token\_management\_transacti :undoc-members: :show-inheritance: -multiversx\_sdk.core.transactions\_outcome\_parsers.token\_management\_transactions\_outcome\_parser\_test module ------------------------------------------------------------------------------------------------------------------ - -.. automodule:: multiversx_sdk.core.transactions_outcome_parsers.token_management_transactions_outcome_parser_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.core.transactions\_outcome\_parsers.token\_management\_transactions\_outcome\_parser\_types module ------------------------------------------------------------------------------------------------------------------ diff --git a/docs/multiversx_sdk.network_providers.rst b/docs/multiversx_sdk.network_providers.rst index fe282244..3ecbf285 100644 --- a/docs/multiversx_sdk.network_providers.rst +++ b/docs/multiversx_sdk.network_providers.rst @@ -20,14 +20,6 @@ multiversx\_sdk.network\_providers.api\_network\_provider module :undoc-members: :show-inheritance: -multiversx\_sdk.network\_providers.api\_network\_provider\_test module ----------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.network_providers.api_network_provider_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.network\_providers.config module ------------------------------------------------ @@ -36,14 +28,6 @@ multiversx\_sdk.network\_providers.config module :undoc-members: :show-inheritance: -multiversx\_sdk.network\_providers.constants module ---------------------------------------------------- - -.. automodule:: multiversx_sdk.network_providers.constants - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.network\_providers.contract\_query\_requests module ------------------------------------------------------------------- @@ -124,14 +108,6 @@ multiversx\_sdk.network\_providers.proxy\_network\_provider module :undoc-members: :show-inheritance: -multiversx\_sdk.network\_providers.proxy\_network\_provider\_test module ------------------------------------------------------------------------- - -.. automodule:: multiversx_sdk.network_providers.proxy_network_provider_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.network\_providers.resources module --------------------------------------------------- diff --git a/docs/multiversx_sdk.wallet.crypto.rst b/docs/multiversx_sdk.wallet.crypto.rst index 1fe091f4..2b5f54e7 100644 --- a/docs/multiversx_sdk.wallet.crypto.rst +++ b/docs/multiversx_sdk.wallet.crypto.rst @@ -4,14 +4,6 @@ multiversx\_sdk.wallet.crypto package Submodules ---------- -multiversx\_sdk.wallet.crypto.constants module ----------------------------------------------- - -.. automodule:: multiversx_sdk.wallet.crypto.constants - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.wallet.crypto.decryptor module ---------------------------------------------- diff --git a/docs/multiversx_sdk.wallet.libraries.rst b/docs/multiversx_sdk.wallet.libraries.rst index 3f092179..fcdcee72 100644 --- a/docs/multiversx_sdk.wallet.libraries.rst +++ b/docs/multiversx_sdk.wallet.libraries.rst @@ -12,14 +12,6 @@ multiversx\_sdk.wallet.libraries.bls\_facade module :undoc-members: :show-inheritance: -multiversx\_sdk.wallet.libraries.bls\_facade\_test module ---------------------------------------------------------- - -.. automodule:: multiversx_sdk.wallet.libraries.bls_facade_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.wallet.libraries.libbls module ---------------------------------------------- diff --git a/docs/multiversx_sdk.wallet.rst b/docs/multiversx_sdk.wallet.rst index 493355c7..81034b10 100644 --- a/docs/multiversx_sdk.wallet.rst +++ b/docs/multiversx_sdk.wallet.rst @@ -13,14 +13,6 @@ Subpackages Submodules ---------- -multiversx\_sdk.wallet.constants module ---------------------------------------- - -.. automodule:: multiversx_sdk.wallet.constants - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.wallet.core module ---------------------------------- @@ -53,14 +45,6 @@ multiversx\_sdk.wallet.mnemonic module :undoc-members: :show-inheritance: -multiversx\_sdk.wallet.mnemonic\_test module --------------------------------------------- - -.. automodule:: multiversx_sdk.wallet.mnemonic_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.wallet.pem\_entry module ---------------------------------------- @@ -69,14 +53,6 @@ multiversx\_sdk.wallet.pem\_entry module :undoc-members: :show-inheritance: -multiversx\_sdk.wallet.pem\_entry\_test module ----------------------------------------------- - -.. automodule:: multiversx_sdk.wallet.pem_entry_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.wallet.user\_keys module ---------------------------------------- @@ -101,14 +77,6 @@ multiversx\_sdk.wallet.user\_signer module :undoc-members: :show-inheritance: -multiversx\_sdk.wallet.user\_test module ----------------------------------------- - -.. automodule:: multiversx_sdk.wallet.user_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.wallet.user\_verifer module ------------------------------------------- @@ -149,14 +117,6 @@ multiversx\_sdk.wallet.validator\_signer module :undoc-members: :show-inheritance: -multiversx\_sdk.wallet.validator\_test module ---------------------------------------------- - -.. automodule:: multiversx_sdk.wallet.validator_test - :members: - :undoc-members: - :show-inheritance: - multiversx\_sdk.wallet.validator\_verifier module ------------------------------------------------- From af9d5b03d2da56d0b25bbc09caf160c55112d8c2 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Wed, 3 Apr 2024 15:34:49 +0300 Subject: [PATCH 29/30] update readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c1b24433..bca1a3f2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ The Python SDK for interacting with MultiversX. It's an all in one sdk that can be used to create transactions (including smart contract calls and deployments), sign and broadcast transactions, create wallets and many more. +## Documentation + +- [Cookbook](./examples/Cookbook.ipynb) +- [Auto-generated documentation](https://multiversx.github.io/mx-sdk-py-incubator/) + ## Development setup ### Virtual environment From 1ce1d7c1a912eef0a82263dfc663d9d3f46208d7 Mon Sep 17 00:00:00 2001 From: Alexandru Popenta Date: Thu, 4 Apr 2024 11:05:04 +0300 Subject: [PATCH 30/30] fix readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bca1a3f2..f3876df3 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,11 @@ pytest -m "not networkInteraction" ### Regenerating the docs -Each time a new module/submodule is added it needs to be added to the docs, as well. To do `cd` in the root directory then run the following command: +Each time a new module/submodule is added it needs to be added to the docs, as well. To do so `cd` in the root directory then run the following command: ```bash sphinx-apidoc -f -o docs/ multiversx_sdk/ *_test.py *constants.py ``` -This command will regenerate the `.rst` files for each module, excluding the tests. +This command will regenerate the `.rst` files for each module, excluding the tests and the `constants.py` files. Also, each time a new version is released, the [**conf.py**](/docs/conf.py) file should be updated accordingly.