Skip to content

Commit

Permalink
deploy: ce38ab7
Browse files Browse the repository at this point in the history
  • Loading branch information
lwasser committed Sep 12, 2023
1 parent 5c82617 commit c07441c
Show file tree
Hide file tree
Showing 36 changed files with 8 additions and 8 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/package-structure-code/code-style-linting-format.doctree
Binary file not shown.
Binary file modified .doctrees/package-structure-code/python-package-structure.doctree
Binary file not shown.
Binary file modified _images/social_previews/summary_CONTRIBUTING_c433f30d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/social_previews/summary_documentation_index_234ecf2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/social_previews/summary_index_f00605b5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ from stravalib import unithelper as uh

[Ruff](https://beta.ruff.rs) is a new addition to the code quality ecosystem,
gaining some traction since its release.
`ruff` is a linter for Python, aiming to replace several tools behind a single interface.
`ruff` is a linter for Python, aiming to replace several tools behind a single interface.
As such, `ruff` can be used instead of `flake8` and `isort`.

`ruff` has some interesting features that distinguish it from other linters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If `tests/` are outside of the **src/package** directory, they aren't included i

By default, Python adds a module in your current working directory to the front of the Python module search path.

This means that if you run your tests in your packages working directory, using a flat layout, `/package/module.py`, Python will discover `package-name/module.py` file before it discovers the installed package.
This means that if you run your tests in your package's working directory, using a flat layout, `/package/module.py`, Python will discover `package/module.py` file before it discovers the installed package.

However, if your package lives in a src/ directory structure **src/package** then it won't be, by default, added to the Python path. This means that when you import your package, Python will be forced to search the active environment (which has your package installed).

Expand All @@ -109,7 +109,7 @@ We do not recommend including tests as part of your package wheel by default. Ho

```bash
src/
package-name/
package/
tests/
docs/
```
Expand Down Expand Up @@ -185,7 +185,7 @@ The flat layout's primary characteristics are:

- The source code for your package lives in a directory with your package's
name in the root of your directory
- Often the `tests/` directory also lives within that same `package-name` directory.
- Often the `tests/` directory also lives within that same `package` directory.

Below you can see the recommended structure of a scientific Python package
using the flat layout.
Expand Down
2 changes: 1 addition & 1 deletion package-structure-code/code-style-linting-format.html
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ <h4>Example application of isort<a class="headerlink" href="#example-application
<h3>Ruff<a class="headerlink" href="#ruff" title="Permalink to this heading">#</a></h3>
<p><a class="reference external" href="https://beta.ruff.rs">Ruff</a> is a new addition to the code quality ecosystem,
gaining some traction since its release.
<code class="docutils literal notranslate"><span class="pre">ruff</span></code> is a linter for Python, aiming to replace several tools behind a single interface.<br />
<code class="docutils literal notranslate"><span class="pre">ruff</span></code> is a linter for Python, aiming to replace several tools behind a single interface.
As such, <code class="docutils literal notranslate"><span class="pre">ruff</span></code> can be used instead of <code class="docutils literal notranslate"><span class="pre">flake8</span></code> and <code class="docutils literal notranslate"><span class="pre">isort</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">ruff</span></code> has some interesting features that distinguish it from other linters:</p>
<ul class="simple">
Expand Down
6 changes: 3 additions & 3 deletions package-structure-code/python-package-structure.html
Original file line number Diff line number Diff line change
Expand Up @@ -613,15 +613,15 @@ <h2>The src/ layout and testing<a class="headerlink" href="#the-src-layout-and-t
<div class="admonition-how-python-discovers-and-prioritizes-importing-modules admonition">
<p class="admonition-title">How Python discovers and prioritizes importing modules</p>
<p>By default, Python adds a module in your current working directory to the front of the Python module search path.</p>
<p>This means that if you run your tests in your packages working directory, using a flat layout, <code class="docutils literal notranslate"><span class="pre">/package/module.py</span></code>, Python will discover <code class="docutils literal notranslate"><span class="pre">package-name/module.py</span></code> file before it discovers the installed package.</p>
<p>This means that if you run your tests in your package’s working directory, using a flat layout, <code class="docutils literal notranslate"><span class="pre">/package/module.py</span></code>, Python will discover <code class="docutils literal notranslate"><span class="pre">package/module.py</span></code> file before it discovers the installed package.</p>
<p>However, if your package lives in a src/ directory structure <strong>src/package</strong> then it won’t be, by default, added to the Python path. This means that when you import your package, Python will be forced to search the active environment (which has your package installed).</p>
<p>Note: Python versions 3.11 and above have a path setting that can be adjusted to ensure the priority is to use installed packages first (e.g. <code class="docutils literal notranslate"><span class="pre">PYTHONSAFEPATH</span></code>).</p>
</div>
<section id="sometimes-tests-are-needed-in-a-distribution">
<h3>Sometimes tests are needed in a distribution<a class="headerlink" href="#sometimes-tests-are-needed-in-a-distribution" title="Permalink to this heading">#</a></h3>
<p>We do not recommend including tests as part of your package wheel by default. However, not including tests in your package distribution will make it harder for people other than yourself to test whether your package is functioning correctly on their system. If you have a small test suite (Python files + data), and think your users may want to run tests locally on their systems, you can include tests by moving the <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory into the <strong>src/package</strong> directory (see example below).</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>src/
<span class="w"> </span>package-name/
<span class="w"> </span>package/
<span class="w"> </span>tests/
docs/
</pre></div>
Expand Down Expand Up @@ -692,7 +692,7 @@ <h2>What does the flat layout structure look like?<a class="headerlink" href="#w
<ul class="simple">
<li><p>The source code for your package lives in a directory with your package’s
name in the root of your directory</p></li>
<li><p>Often the <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory also lives within that same <code class="docutils literal notranslate"><span class="pre">package-name</span></code> directory.</p></li>
<li><p>Often the <code class="docutils literal notranslate"><span class="pre">tests/</span></code> directory also lives within that same <code class="docutils literal notranslate"><span class="pre">package</span></code> directory.</p></li>
</ul>
<p>Below you can see the recommended structure of a scientific Python package
using the flat layout.</p>
Expand Down

0 comments on commit c07441c

Please sign in to comment.