Skip to content

Commit

Permalink
fix typos 0d63aee
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed May 2, 2024
1 parent 9ee8ee8 commit df5a456
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions dev/blog/2024/04/18/hatch-v1100/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<span class=n>installer</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=s2>&quot;uv&quot;</span>
</code></pre></div> </div> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=k>[envs.default]</span>
<span class=n>installer</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=s2>&quot;uv&quot;</span>
</code></pre></div> </div> </div> </div> <p>Semi-internal environments like those used for <a href=../../../../../config/internal/testing/ >testing</a> and <a href=../../../../../config/internal/static-analysis/ >static analysis</a> have this UV enabled by default.</p> <p>See the <a href=../../../../../how-to/environment/select-installer/ >how-to guide</a> for more information about switching the installer.</p> <h2 id=python-script-runner>Python script runner<a class=headerlink href=#python-script-runner title="Permanent link">&para;</a></h2> <p>The <a href=../../../../../cli/reference/#hatch-run><code>run</code></a> command now supports executing Python scripts with <a href=https://packaging.python.org/en/latest/specifications/inline-script-metadata/ >inline metadata</a> as standardized by <a href=https://peps.python.org/pep-0723/ >PEP 723</a>.</p> <p>As an example, consider the following script:</p> <div class="tabbed-set tabbed-alternate" data-tabs=2:1><input checked=checked id=scriptpy name=__tabbed_2 type=radio><div class=tabbed-labels><label for=scriptpy><span class=twemoji><svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 16 16"><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"/></svg></span> script.py</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=c1># /// script</span>
</code></pre></div> </div> </div> </div> <p>Semi-internal environments like those used for <a href=../../../../../config/internal/testing/ >testing</a> and <a href=../../../../../config/internal/static-analysis/ >static analysis</a> have this enabled by default.</p> <p>See the <a href=../../../../../how-to/environment/select-installer/ >how-to guide</a> for more information about switching the installer.</p> <h2 id=python-script-runner>Python script runner<a class=headerlink href=#python-script-runner title="Permanent link">&para;</a></h2> <p>The <a href=../../../../../cli/reference/#hatch-run><code>run</code></a> command now supports executing Python scripts with <a href=https://packaging.python.org/en/latest/specifications/inline-script-metadata/ >inline metadata</a> as standardized by <a href=https://peps.python.org/pep-0723/ >PEP 723</a>.</p> <p>As an example, consider the following script:</p> <div class="tabbed-set tabbed-alternate" data-tabs=2:1><input checked=checked id=scriptpy name=__tabbed_2 type=radio><div class=tabbed-labels><label for=scriptpy><span class=twemoji><svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 16 16"><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"/></svg></span> script.py</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=c1># /// script</span>
<span class=c1># requires-python = &quot;&gt;=3.11&quot;</span>
<span class=c1># dependencies = [</span>
<span class=c1># &quot;httpx&quot;,</span>
Expand All @@ -26,7 +26,7 @@
<span class=n>data</span> <span class=o>=</span> <span class=n>resp</span><span class=o>.</span><span class=n>json</span><span class=p>()</span>
<span class=n>pprint</span><span class=p>([(</span><span class=n>k</span><span class=p>,</span> <span class=n>v</span><span class=p>[</span><span class=s2>&quot;title&quot;</span><span class=p>])</span> <span class=k>for</span> <span class=n>k</span><span class=p>,</span> <span class=n>v</span> <span class=ow>in</span> <span class=n>data</span><span class=o>.</span><span class=n>items</span><span class=p>()][:</span><span class=mi>10</span><span class=p>])</span>
</code></pre></div> </div> </div> </div> <p>If you run the script for the first time as follows:</p> <div class=highlight><pre><span></span><code>hatch run script.py
</code></pre></div> <p>Hatch will create a dedicated environment for that script using a version of Python greater than or equal to 3.11 with dependencies <code>httpx</code> and <code>rich</code>.</p> <figure> <p><a class=glightbox href=../../../../release-hatch-1100/run-script.gif data-type=image data-width=auto data-height=auto data-desc-position=bottom><img alt="Script running example" loading=lazy role=img src=../../../../release-hatch-1100/run-script.gif></a></p> </figure> <p>See the <a href=../../../../../how-to/run/python-scripts/ >how-to guide</a> for more information.</p> <h2 id=static-analysis>Static analysis<a class=headerlink href=#static-analysis title="Permanent link">&para;</a></h2> <p>The environment used for static analysis is now <a href=../../../../../config/internal/static-analysis/#customize-behavior>completely configurable</a> such that you can fully alter the underlying behavior of the <a href=../../../../../cli/reference/#hatch-fmt><code>fmt</code></a> command (see the <a href=../../../../../how-to/static-analysis/behavior/ >how-to</a>).</p> <p>Additionally, Ruff has been updated to version 1.4.0 and the rules selected by default have been updated accordingly. Check out their <a href=https://astral.sh/blog/ruff-v0.4.0>blog post</a> about how the new hand-written parser has made it twice as fast!</p> <h2 id=community-highlights>Community highlights<a class=headerlink href=#community-highlights title="Permanent link">&para;</a></h2> <h3 id=visual-studio-code>Visual Studio Code<a class=headerlink href=#visual-studio-code title="Permanent link">&para;</a></h3> <p>Visual Studio Code <a href=https://code.visualstudio.com/updates/v1_88#_hatch-environment-discovery>announced support</a> for Hatch environments in their latest release. This means that you can now easily discover and select Hatch environments for your projects directly from the editor.</p> <p>See the <a href=../../../../../how-to/integrate/vscode/ >how-to guide</a> detailed instructions.</p> <h3 id=cmake-build-plugin>CMake build plugin<a class=headerlink href=#cmake-build-plugin title="Permanent link">&para;</a></h3> <p>A <a href=https://github.com/scikit-build/scikit-build-core/releases/tag/v0.9.0>new release</a> of the extension module builder <a href=https://github.com/scikit-build/scikit-build-core>scikit-build-core</a> has introduced a <a href=https://scikit-build-core.readthedocs.io/en/stable/plugins/hatchling.html>build plugin</a> for Hatchling. This means that you can use Hatchling as your build backend while also shipping extension modules built with CMake.</p> <p>To get started, add the dependency to your <a href=../../../../../config/build/#build-system>build requirements</a>:</p> <div class="tabbed-set tabbed-alternate" data-tabs=3:1><input checked=checked id=pyprojecttoml_1 name=__tabbed_3 type=radio><div class=tabbed-labels><label for=pyprojecttoml_1><span class=twemoji><svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 16 16"><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"/></svg></span> pyproject.toml</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=k>[build-system]</span>
</code></pre></div> <p>Hatch will create a dedicated environment for that script using a version of Python greater than or equal to 3.11 with dependencies <code>httpx</code> and <code>rich</code>.</p> <figure> <p><a class=glightbox href=../../../../release-hatch-1100/run-script.gif data-type=image data-width=auto data-height=auto data-desc-position=bottom><img alt="Script running example" loading=lazy role=img src=../../../../release-hatch-1100/run-script.gif></a></p> </figure> <p>See the <a href=../../../../../how-to/run/python-scripts/ >how-to guide</a> for more information.</p> <h2 id=static-analysis>Static analysis<a class=headerlink href=#static-analysis title="Permanent link">&para;</a></h2> <p>The environment used for static analysis is now <a href=../../../../../config/internal/static-analysis/#customize-behavior>completely configurable</a> such that you can fully alter the underlying behavior of the <a href=../../../../../cli/reference/#hatch-fmt><code>fmt</code></a> command (see the <a href=../../../../../how-to/static-analysis/behavior/ >how-to</a>).</p> <p>Additionally, Ruff has been updated to version 1.4.0 and the rules selected by default have been updated accordingly. Check out their <a href=https://astral.sh/blog/ruff-v0.4.0>blog post</a> about how the new hand-written parser has made it twice as fast!</p> <h2 id=community-highlights>Community highlights<a class=headerlink href=#community-highlights title="Permanent link">&para;</a></h2> <h3 id=visual-studio-code>Visual Studio Code<a class=headerlink href=#visual-studio-code title="Permanent link">&para;</a></h3> <p>Visual Studio Code <a href=https://code.visualstudio.com/updates/v1_88#_hatch-environment-discovery>announced support</a> for Hatch environments in their latest release. This means that you can now easily discover and select Hatch environments for your projects directly from the editor.</p> <p>See the <a href=../../../../../how-to/integrate/vscode/ >how-to guide</a> for detailed instructions.</p> <h3 id=cmake-build-plugin>CMake build plugin<a class=headerlink href=#cmake-build-plugin title="Permanent link">&para;</a></h3> <p>A <a href=https://github.com/scikit-build/scikit-build-core/releases/tag/v0.9.0>new release</a> of the extension module builder <a href=https://github.com/scikit-build/scikit-build-core>scikit-build-core</a> has introduced a <a href=https://scikit-build-core.readthedocs.io/en/stable/plugins/hatchling.html>build plugin</a> for Hatchling. This means that you can use Hatchling as your build backend while also shipping extension modules built with CMake.</p> <p>To get started, add the dependency to your <a href=../../../../../config/build/#build-system>build requirements</a>:</p> <div class="tabbed-set tabbed-alternate" data-tabs=3:1><input checked=checked id=pyprojecttoml_1 name=__tabbed_3 type=radio><div class=tabbed-labels><label for=pyprojecttoml_1><span class=twemoji><svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 16 16"><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"/></svg></span> pyproject.toml</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=k>[build-system]</span>
<span class=n>requires</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=p>[</span><span class=s2>&quot;hatchling&gt;=1.24.2&quot;</span><span class=p>,</span><span class=w> </span><span class=s2>&quot;scikit-build-core~=0.9.3&quot;</span><span class=p>]</span>
<span class=n>build-backend</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=s2>&quot;hatchling.build&quot;</span>
</code></pre></div> </div> </div> </div> <p>Then explicitly enable the <code>experimental</code> option (acknowledging that the plugin will move to a dedicated package in the future):</p> <div class="tabbed-set tabbed-alternate" data-tabs=4:2><input checked=checked id=pyprojecttoml_2 name=__tabbed_4 type=radio><input id=hatchtoml_1 name=__tabbed_4 type=radio><div class=tabbed-labels><label for=pyprojecttoml_2><span class=twemoji><svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 16 16"><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"/></svg></span> pyproject.toml</label><label for=hatchtoml_1><span class=twemoji><svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 16 16"><path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"/></svg></span> hatch.toml</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=k>[tool.hatch.build.targets.wheel.hooks.scikit-build]</span>
Expand Down
22 changes: 11 additions & 11 deletions dev/install/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/search/search_index.json

Large diffs are not rendered by default.

0 comments on commit df5a456

Please sign in to comment.