Skip to content

Commit

Permalink
Allow env vars to be sourced from both env_files and kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Aug 16, 2024
1 parent 6348312 commit 66fbff1
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 15 deletions.
10 changes: 6 additions & 4 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ <h2 id="D">D</h2>
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.squire.env_loader">env_loader() (in module pyninja.squire)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig">EnvConfig (class in pyninja.models)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.Config">EnvConfig.Config (class in pyninja.models)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.models.EnvConfig.Config">EnvConfig.Config (class in pyninja.models)</a>
<li><a href="index.html#pyninja.squire.envfile_loader">envfile_loader() (in module pyninja.squire)</a>
</li>
<li><a href="index.html#pyninja.auth.EPOCH">EPOCH() (in module pyninja.auth)</a>
</li>
Expand Down Expand Up @@ -205,10 +205,12 @@ <h2 id="L">L</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.auth.level_1">level_1() (in module pyninja.auth)</a>
</li>
<li><a href="index.html#pyninja.auth.level_2">level_2() (in module pyninja.auth)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pyninja.auth.level_2">level_2() (in module pyninja.auth)</a>
<li><a href="index.html#pyninja.squire.load_env">load_env() (in module pyninja.squire)</a>
</li>
<li><a href="index.html#pyninja.models.EnvConfig.log_config">log_config (pyninja.models.EnvConfig attribute)</a>
</li>
Expand Down
22 changes: 20 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,8 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyninja.squire.env_loader">
<span class="sig-prename descclassname"><span class="pre">pyninja.squire.</span></span><span class="sig-name descname"><span class="pre">env_loader</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">os.PathLike</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#pyninja.models.EnvConfig" title="pyninja.models.EnvConfig"><span class="pre">EnvConfig</span></a></span></span><a class="headerlink" href="#pyninja.squire.env_loader" title="Permalink to this definition"></a></dt>
<dt class="sig sig-object py" id="pyninja.squire.envfile_loader">
<span class="sig-prename descclassname"><span class="pre">pyninja.squire.</span></span><span class="sig-name descname"><span class="pre">envfile_loader</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">os.PathLike</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#pyninja.models.EnvConfig" title="pyninja.models.EnvConfig"><span class="pre">EnvConfig</span></a></span></span><a class="headerlink" href="#pyninja.squire.envfile_loader" title="Permalink to this definition"></a></dt>
<dd><p>Loads environment variables based on filetypes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
Expand All @@ -836,6 +836,24 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pyninja.squire.load_env">
<span class="sig-prename descclassname"><span class="pre">pyninja.squire.</span></span><span class="sig-name descname"><span class="pre">load_env</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#pyninja.models.EnvConfig" title="pyninja.models.EnvConfig"><span class="pre">EnvConfig</span></a></span></span><a class="headerlink" href="#pyninja.squire.load_env" title="Permalink to this definition"></a></dt>
<dd><p>Merge env vars from env_file with kwargs, giving priority to kwargs.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>This function allows env vars to be loaded partially from .env files and partially through kwargs.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>Returns a reference to the <code class="docutils literal notranslate"><span class="pre">EnvConfig</span></code> object.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><a class="reference internal" href="#pyninja.models.EnvConfig" title="pyninja.models.EnvConfig">EnvConfig</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this heading"></a></h1>
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
Loading

0 comments on commit 66fbff1

Please sign in to comment.