-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: notebook setup * fix: make it so users can rerun the setup * feat: juypter notebook support
- Loading branch information
1 parent
22511bf
commit c85c815
Showing
7 changed files
with
506 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Juypter Notebooks (IPython) | ||
########################### | ||
|
||
If you want to run a Jupyter notebook with all the setup a script has (named contracts, ``sys.path`` adjustments, etc), you can use the following code: | ||
|
||
.. code-block:: python | ||
from moccasin import setup_notebook | ||
setup_notebook() | ||
Then, you can work with the notebook as you would normally. | ||
|
||
.. code-block:: python | ||
from moccasin.config import get_active_network | ||
active_network = get_active_network() | ||
eth_usd = active_network.manifest_named("eth_usd_price_feed") | ||
If you update your config while the notebook is running, you can reload the config with: | ||
|
||
.. code-block:: python | ||
from moccasin.config import get_config | ||
config = get_config() | ||
# This command | ||
config.reload() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "moccasin" | ||
version = "0.3.4" | ||
version = "0.3.5" | ||
description = "Pythonic smart contract development framework using Titanoboa" | ||
authors = [ | ||
{ name = "PatrickAlphac", email = "[email protected]" }, | ||
|
@@ -11,12 +11,14 @@ dependencies = [ | |
"python-dotenv>=1.0.1", | ||
"titanoboa-zksync>=0.2.8", | ||
"tqdm>=4.66.5", | ||
"tomlkit>=0.13.2", # For preserving comments when writing to toml | ||
"tomlkit>=0.13.2", | ||
# For preserving comments when writing to toml | ||
"tomli-w>=1.0.0", | ||
"pytest-cov>=5.0.0", | ||
"uv>=0.4.15", | ||
"pytest-xdist>=3.6.1", | ||
"vyper==0.4.0", # We will want to get rid of this hard-coded dependency in 0.3.4 of moccasin | ||
"vyper>=0.4.0", | ||
"ipykernel>=6.29.5", | ||
] | ||
readme = "README.md" | ||
requires-python = ">= 3.11, <= 3.13" | ||
|
Oops, something went wrong.