Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,9 @@ jobs:
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: poetry install
- name: Plugin Codegen
- name: Plugins Codegen
run: yarn codegen
if: contains(matrix.package, 'plugins')
- name: Config Bundle Codegen
run: yarn codegen
if: contains(matrix.package, 'config-bundles')
- name: Client Codegen
run: yarn codegen
if: endsWith(matrix.package, 'polywrap-client')
- name: Client Config Builder Codegen
run: yarn codegen
if: endsWith(matrix.package, 'polywrap-client-config-builder')
working-directory: packages/polywrap
- name: Typecheck
run: poetry run tox -e typecheck
- name: Lint
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/examples-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Examples-CI
on:
push:
branches:
- main
pull_request:

jobs:
examples:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./examples
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: 'v18.16.0'
- name: Install poetry
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: poetry install
- name: Start polywrap infra
run: npx polywrap infra up --modules=eth-ens-ipfs
- name: Codegen
run: yarn codegen
working-directory: ./packages/polywrap-client
- name: Run tests
run: poetry run pytest -v
53 changes: 41 additions & 12 deletions docs/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ polywrap-http-plugin = { path = "../packages/plugins/polywrap-http-plugin", deve
polywrap-ethereum-provider = { path = "../packages/plugins/polywrap-ethereum-provider", develop = true }
polywrap-sys-config-bundle = { path = "../packages/config-bundles/polywrap-sys-config-bundle", develop = true }
polywrap-web3-config-bundle = { path = "../packages/config-bundles/polywrap-web3-config-bundle", develop = true }
polywrap = { path = "../packages/polywrap", develop = true }

[tool.poetry.group.dev.dependencies]
sphinx = "^6.1.3"
Expand Down
27 changes: 19 additions & 8 deletions docs/source/Quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
Polywrap Client
===============
This package contains the implementation of polywrap python client.
Polywrap
========
This package contains the Polywrap Python SDK

Installation
============
Install the package with pip:

.. code-block:: bash

pip install polywrap

Quickstart
==========

Imports
-------

>>> from polywrap_core import Uri, ClientConfig
>>> from polywrap_client import PolywrapClient
>>> from polywrap_client_config_builder import PolywrapClientConfigBuilder
>>> from polywrap_sys_config_bundle import sys_bundle
>>> from polywrap_web3_config_bundle import web3_bundle
>>> from polywrap import (
... Uri,
... ClientConfig,
... PolywrapClient,
... PolywrapClientConfigBuilder,
... sys_bundle,
... web3_bundle
... )

Configure and Instantiate
-------------------------
Expand Down
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
"sphinx.ext.napoleon",
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"myst_parser",
]

templates_path = ['_templates']
exclude_patterns = []

source_suffix = [".rst", ".md"]


# -- Options for HTML output -------------------------------------------------
Expand Down Expand Up @@ -54,5 +56,5 @@
shutil.rmtree(os.path.join(root_dir, "docs", "source", "misc"), ignore_errors=True)
shutil.copytree(os.path.join(root_dir, "misc"), os.path.join(root_dir, "docs", "source", "misc"))

shutil.copy2(os.path.join(root_dir, "packages", "polywrap-client", "README.rst"), os.path.join(root_dir, "docs", "source", "Quickstart.rst"))
shutil.copy2(os.path.join(root_dir, "packages", "polywrap", "README.rst"), os.path.join(root_dir, "docs", "source", "Quickstart.rst"))
shutil.copy2(os.path.join(root_dir, "CONTRIBUTING.rst"), os.path.join(root_dir, "docs", "source", "CONTRIBUTING.rst"))
1 change: 1 addition & 0 deletions docs/source/examples/ens.md
1 change: 1 addition & 0 deletions docs/source/examples/ethers.md
11 changes: 11 additions & 0 deletions docs/source/examples/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Examples
========

.. toctree::
:maxdepth: 4

ens.md
ethers.md
filesystem.md
http.md
ipfs.md
1 change: 1 addition & 0 deletions docs/source/examples/filesystem.md
1 change: 1 addition & 0 deletions docs/source/examples/http.md
1 change: 1 addition & 0 deletions docs/source/examples/ipfs.md
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Welcome to polywrap-client's documentation!
:maxdepth: 1
:caption: Contents:

examples/examples.rst
CONTRIBUTING.rst
polywrap-client/modules.rst
polywrap-client-config-builder/modules.rst
Expand Down
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.polywrap
33 changes: 33 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Polywrap Python Client Examples

This directory contains examples of how to use the Polywrap Python client.

## Running the Examples

### Install Dependencies

```
poetry install
```

> NOTE: if you don't have Poetry installed, you can follow the instructions [here](https://python-poetry.org/docs/#installation).

### Run the Examples

```
poetry run pytest
```

> We are using markdown_pytest plugin to run the examples. You can find more information about it [here](https://pypi.org/project/markdown-pytest/).

### Run a Specific Example

```
poetry run pytest <example_name>
```

For example:

```
poetry run pytest ens.md
```
Loading