Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 28, 2025
1 parent 9c072d0 commit 13f61ea
Show file tree
Hide file tree
Showing 22 changed files with 117 additions and 5 deletions.
Binary file modified latest/.doctrees/commands/networks.doctree
Binary file not shown.
Binary file modified latest/.doctrees/environment.pickle
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_accounts.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_compile.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_ethereum.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_node.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_pm.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_test.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/api.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/cli.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/contracts.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/exceptions.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/managers.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/plugins.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/types.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/utils.doctree
Binary file not shown.
Binary file modified latest/.doctrees/userguides/config.doctree
Binary file not shown.
51 changes: 50 additions & 1 deletion latest/_sources/userguides/config.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,58 @@ plugin:

This helps keep your secrets out of Ape!

Similarly, any config key-name can also be set with the same named environment variable (with a prefix).

If a configuration is left unset (i.e., not included in the `ape-config.(yaml|json|toml)` file, Ape will inspect the environment variables as a fallback, following the pattern `APE_<PLUGIN?>_SETTING`, where different plugins define different prefixes.

For example, the following config:

```yaml
contracts_folder: src/qwe
test:
number_of_accounts: 3
show_internal: True
compile:
exclude:
- "one"
- "two"
- "three"
include_dependencies: true
```

could be entirely defined with environment variables as follows:

```shell
APE_CONTRACTS_FOLDER=src/contracts
APE_TEST_NUMBER_OF_ACCOUNTS=3
APE_TEST_SHOW_INTERNAL=true
APE_COMPILE_EXCLUDE='["one", "two", "three"]'
APE_COMPILE_INCLUDE_DEPENDENCIES=true
```

Notice the `ape-compile` and `ape-test` plugin include their plugin name `APE_COMPILE` and `APE_TEST` respectively where `contracts_folder` only has the prefix `APE_` since it is not part of a plugin.

Here is the complete list of supported prefixes that come with Ape out-of-the-box:

| Module/Plugin | Prefix |
| ------------- | ------------ |
| ape | APE |
| ape_cache | APE_CACHE |
| ape_compile | APE_COMPILE |
| ape_console | APE_CONSOLE |
| ape_ethereum | APE_ETHEREUM |
| ape_networks | APE_NETWORKS |
| ape_node | APE_NODE |
| ape_test | APE_TEST |

Each plugin outside the core package may define its own prefix, but the standard is `APE_PLUGINNAME_`.

Using environment variables assists in keeping secrets out of your config files.
However, the primary config should be file-driven and environment variables should only be used when necessary.

## Base Path

Change the base path if it is different than your project root.
Change the base path if it is different from your project root.
For example, imagine a project structure like:

```
Expand Down
4 changes: 2 additions & 2 deletions latest/commands/networks.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Link to this heading"
<dd><p>Filter the results by ecosystem</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>apechain | abstract | taiko | palm | unichain | polygon | soneium | crossfi | polynomial | cronos-zkevm | gnosis | metis | bsc | lumia | ethereum | moonbeam | avalanche | flow-evm | zksync | blast | arbitrum | rootstock | zetachain | fantom | optimism | geist | zora | astar | bttc | mantle | cronos | kroma | linea | lens | scroll | shape | base | shibarium | fraxtal | berachain | wemix | celo | polygon-zkevm | xai | xmtp | world-chain | oort</p>
<dd class="field-odd"><p>polygon-zkevm | wemix | polygon | fantom | linea | scroll | flow-evm | polynomial | geist | avalanche | cronos | zetachain | base | lumia | gnosis | rootstock | taiko | soneium | abstract | mantle | palm | world-chain | shape | xai | kroma | zksync | berachain | bttc | unichain | xmtp | celo | fraxtal | oort | arbitrum | astar | lens | cronos-zkevm | moonbeam | metis | optimism | crossfi | bsc | apechain | ethereum | shibarium | zora | blast</p>
</dd>
</dl>
</dd></dl>
Expand All @@ -204,7 +204,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Link to this heading"
<dd><p>Filter the results by network</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>dev-fork | opbnb | amoy | cardona | mainnet-fork | alfajores-fork | bartio-fork | sepolia-fork | testnet-fork | curtis | bartio | moonriver-fork | hekla | fuji-fork | donau | nova | dev | goerli | fuji | hekla-fork | moonbase | amoy-fork | alfajores | minato-fork | mainnet | opbnb-testnet | donau-fork | polter | moonriver | chiado | holesky-fork | nova-fork | moonbase-fork | polter-fork | cardona-fork | local | minato | mumbai-fork | prism | curtis-fork | sepolia | goerli-fork | testnet | holesky | opbnb-fork | mumbai | puppynet-fork | puppynet | chiado-fork | prism-fork | opbnb-testnet-fork</p>
<dd class="field-odd"><p>opbnb-testnet | chiado | minato | hekla-fork | bartio | donau-fork | holesky-fork | puppynet | dev | polter-fork | prism | bartio-fork | sepolia | fuji | opbnb-fork | curtis-fork | alfajores-fork | local | prism-fork | mumbai | hekla | moonriver-fork | nova | donau | opbnb | goerli | minato-fork | dev-fork | cardona | goerli-fork | amoy-fork | opbnb-testnet-fork | mainnet-fork | moonbase | puppynet-fork | polter | moonbase-fork | nova-fork | holesky | amoy | chiado-fork | cardona-fork | mainnet | sepolia-fork | mumbai-fork | moonriver | fuji-fork | testnet | testnet-fork | alfajores | curtis</p>
</dd>
</dl>
</dd></dl>
Expand Down
2 changes: 1 addition & 1 deletion latest/searchindex.js

Large diffs are not rendered by default.

65 changes: 64 additions & 1 deletion latest/userguides/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,72 @@ <h1>Configure Ape<a class="headerlink" href="#configure-ape" title="Link to this
</span></pre></div>
</div>
<p>This helps keep your secrets out of Ape!</p>
<p>Similarly, any config key-name can also be set with the same named environment variable (with a prefix).</p>
<p>If a configuration is left unset (i.e., not included in the <code class="docutils literal notranslate"><span class="pre">ape-config.(yaml|json|toml)</span></code> file, Ape will inspect the environment variables as a fallback, following the pattern <code class="docutils literal notranslate"><span class="pre">APE_&lt;PLUGIN?&gt;_SETTING</span></code>, where different plugins define different prefixes.</p>
<p>For example, the following config:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="nt">contracts_folder</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">src/qwe</span>
</span><span data-line="2"><span class="nt">test</span><span class="p">:</span>
</span><span data-line="3"><span class="w"> </span><span class="nt">number_of_accounts</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
</span><span data-line="4"><span class="w"> </span><span class="nt">show_internal</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">True</span>
</span><span data-line="5"><span class="nt">compile</span><span class="p">:</span>
</span><span data-line="6"><span class="w"> </span><span class="nt">exclude</span><span class="p">:</span>
</span><span data-line="7"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&quot;one&quot;</span>
</span><span data-line="8"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&quot;two&quot;</span>
</span><span data-line="9"><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">&quot;three&quot;</span>
</span><span data-line="10"><span class="w"> </span><span class="nt">include_dependencies</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
</span></pre></div>
</div>
<p>could be entirely defined with environment variables as follows:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="nv">APE_CONTRACTS_FOLDER</span><span class="o">=</span>src/contracts
</span><span data-line="2"><span class="nv">APE_TEST_NUMBER_OF_ACCOUNTS</span><span class="o">=</span><span class="m">3</span>
</span><span data-line="3"><span class="nv">APE_TEST_SHOW_INTERNAL</span><span class="o">=</span><span class="nb">true</span>
</span><span data-line="4"><span class="nv">APE_COMPILE_EXCLUDE</span><span class="o">=</span><span class="s1">&#39;[&quot;one&quot;, &quot;two&quot;, &quot;three&quot;]&#39;</span>
</span><span data-line="5"><span class="nv">APE_COMPILE_INCLUDE_DEPENDENCIES</span><span class="o">=</span><span class="nb">true</span>
</span></pre></div>
</div>
<p>Notice the <code class="docutils literal notranslate"><span class="pre">ape-compile</span></code> and <code class="docutils literal notranslate"><span class="pre">ape-test</span></code> plugin include their plugin name <code class="docutils literal notranslate"><span class="pre">APE_COMPILE</span></code> and <code class="docutils literal notranslate"><span class="pre">APE_TEST</span></code> respectively where <code class="docutils literal notranslate"><span class="pre">contracts_folder</span></code> only has the prefix <code class="docutils literal notranslate"><span class="pre">APE_</span></code> since it is not part of a plugin.</p>
<p>Here is the complete list of supported prefixes that come with Ape out-of-the-box:</p>
<div class="table-wrapper colwidths-auto docutils container">
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Module/Plugin</p></th>
<th class="head"><p>Prefix</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>ape</p></td>
<td><p>APE</p></td>
</tr>
<tr class="row-odd"><td><p>ape_cache</p></td>
<td><p>APE_CACHE</p></td>
</tr>
<tr class="row-even"><td><p>ape_compile</p></td>
<td><p>APE_COMPILE</p></td>
</tr>
<tr class="row-odd"><td><p>ape_console</p></td>
<td><p>APE_CONSOLE</p></td>
</tr>
<tr class="row-even"><td><p>ape_ethereum</p></td>
<td><p>APE_ETHEREUM</p></td>
</tr>
<tr class="row-odd"><td><p>ape_networks</p></td>
<td><p>APE_NETWORKS</p></td>
</tr>
<tr class="row-even"><td><p>ape_node</p></td>
<td><p>APE_NODE</p></td>
</tr>
<tr class="row-odd"><td><p>ape_test</p></td>
<td><p>APE_TEST</p></td>
</tr>
</tbody>
</table>
</div>
<p>Each plugin outside the core package may define its own prefix, but the standard is <code class="docutils literal notranslate"><span class="pre">APE_PLUGINNAME_</span></code>.</p>
<p>Using environment variables assists in keeping secrets out of your config files.
However, the primary config should be file-driven and environment variables should only be used when necessary.</p>
<section id="base-path">
<h2>Base Path<a class="headerlink" href="#base-path" title="Link to this heading"></a></h2>
<p>Change the base path if it is different than your project root.
<p>Change the base path if it is different from your project root.
For example, imagine a project structure like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1">project
</span><span data-line="2">└── src/
Expand Down

0 comments on commit 13f61ea

Please sign in to comment.