diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index 376d5519..365538d0 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/package-structure-code/code-style-linting-format.doctree b/.doctrees/package-structure-code/code-style-linting-format.doctree index cba49875..cc53f758 100644 Binary files a/.doctrees/package-structure-code/code-style-linting-format.doctree and b/.doctrees/package-structure-code/code-style-linting-format.doctree differ diff --git a/.doctrees/package-structure-code/python-package-structure.doctree b/.doctrees/package-structure-code/python-package-structure.doctree index 9c334286..dd876c8a 100644 Binary files a/.doctrees/package-structure-code/python-package-structure.doctree and b/.doctrees/package-structure-code/python-package-structure.doctree differ diff --git a/_images/social_previews/summary_CONTRIBUTING_c433f30d.png b/_images/social_previews/summary_CONTRIBUTING_c433f30d.png index 1d540aa9..b435b849 100644 Binary files a/_images/social_previews/summary_CONTRIBUTING_c433f30d.png and b/_images/social_previews/summary_CONTRIBUTING_c433f30d.png differ diff --git a/_images/social_previews/summary_ci-and-testing_intro_a30242e8.png b/_images/social_previews/summary_ci-and-testing_intro_a30242e8.png index df7d7e72..c477eaec 100644 Binary files a/_images/social_previews/summary_ci-and-testing_intro_a30242e8.png and b/_images/social_previews/summary_ci-and-testing_intro_a30242e8.png differ diff --git a/_images/social_previews/summary_documentation_hosting-tools_intro_ca1a55d8.png b/_images/social_previews/summary_documentation_hosting-tools_intro_ca1a55d8.png index eb035a4b..66ab90ba 100644 Binary files a/_images/social_previews/summary_documentation_hosting-tools_intro_ca1a55d8.png and b/_images/social_previews/summary_documentation_hosting-tools_intro_ca1a55d8.png differ diff --git a/_images/social_previews/summary_documentation_hosting-tools_myst-markdown-rst-doc-syntax_da811838.png b/_images/social_previews/summary_documentation_hosting-tools_myst-markdown-rst-doc-syntax_da811838.png index 66c75e64..d7748fe8 100644 Binary files a/_images/social_previews/summary_documentation_hosting-tools_myst-markdown-rst-doc-syntax_da811838.png and b/_images/social_previews/summary_documentation_hosting-tools_myst-markdown-rst-doc-syntax_da811838.png differ diff --git a/_images/social_previews/summary_documentation_hosting-tools_publish-documentation-online_5095365b.png b/_images/social_previews/summary_documentation_hosting-tools_publish-documentation-online_5095365b.png index 746f6c3e..3441b136 100644 Binary files a/_images/social_previews/summary_documentation_hosting-tools_publish-documentation-online_5095365b.png and b/_images/social_previews/summary_documentation_hosting-tools_publish-documentation-online_5095365b.png differ diff --git a/_images/social_previews/summary_documentation_hosting-tools_sphinx-python-package-documentation-tools_0b92015f.png b/_images/social_previews/summary_documentation_hosting-tools_sphinx-python-package-documentation-tools_0b92015f.png index c1959beb..c0136dfa 100644 Binary files a/_images/social_previews/summary_documentation_hosting-tools_sphinx-python-package-documentation-tools_0b92015f.png and b/_images/social_previews/summary_documentation_hosting-tools_sphinx-python-package-documentation-tools_0b92015f.png differ diff --git a/_images/social_previews/summary_documentation_hosting-tools_website-hosting-optimizing-your-docs_077c0ef2.png b/_images/social_previews/summary_documentation_hosting-tools_website-hosting-optimizing-your-docs_077c0ef2.png index e893e06b..7a61e8bc 100644 Binary files a/_images/social_previews/summary_documentation_hosting-tools_website-hosting-optimizing-your-docs_077c0ef2.png and b/_images/social_previews/summary_documentation_hosting-tools_website-hosting-optimizing-your-docs_077c0ef2.png differ diff --git a/_images/social_previews/summary_documentation_index_234ecf2d.png b/_images/social_previews/summary_documentation_index_234ecf2d.png index 22c8558e..1af00586 100644 Binary files a/_images/social_previews/summary_documentation_index_234ecf2d.png and b/_images/social_previews/summary_documentation_index_234ecf2d.png differ diff --git a/_images/social_previews/summary_documentation_repository-files_code-of-conduct-file_9e54b2bf.png b/_images/social_previews/summary_documentation_repository-files_code-of-conduct-file_9e54b2bf.png index f7b40932..2bd6a244 100644 Binary files a/_images/social_previews/summary_documentation_repository-files_code-of-conduct-file_9e54b2bf.png and b/_images/social_previews/summary_documentation_repository-files_code-of-conduct-file_9e54b2bf.png differ diff --git a/_images/social_previews/summary_documentation_repository-files_contributing-file_7650bedb.png b/_images/social_previews/summary_documentation_repository-files_contributing-file_7650bedb.png index f152e8f4..8fe4d681 100644 Binary files a/_images/social_previews/summary_documentation_repository-files_contributing-file_7650bedb.png and b/_images/social_previews/summary_documentation_repository-files_contributing-file_7650bedb.png differ diff --git a/_images/social_previews/summary_documentation_repository-files_development-guide_0ebdb24f.png b/_images/social_previews/summary_documentation_repository-files_development-guide_0ebdb24f.png index 9520719e..03ceffee 100644 Binary files a/_images/social_previews/summary_documentation_repository-files_development-guide_0ebdb24f.png and b/_images/social_previews/summary_documentation_repository-files_development-guide_0ebdb24f.png differ diff --git a/_images/social_previews/summary_documentation_repository-files_intro_2d12c6f4.png b/_images/social_previews/summary_documentation_repository-files_intro_2d12c6f4.png index e03c71e6..d804c1b9 100644 Binary files a/_images/social_previews/summary_documentation_repository-files_intro_2d12c6f4.png and b/_images/social_previews/summary_documentation_repository-files_intro_2d12c6f4.png differ diff --git a/_images/social_previews/summary_documentation_repository-files_license-files_78519ab6.png b/_images/social_previews/summary_documentation_repository-files_license-files_78519ab6.png index 0adfc581..0caac336 100644 Binary files a/_images/social_previews/summary_documentation_repository-files_license-files_78519ab6.png and b/_images/social_previews/summary_documentation_repository-files_license-files_78519ab6.png differ diff --git a/_images/social_previews/summary_documentation_repository-files_readme-file-best-practices_62fcedf7.png b/_images/social_previews/summary_documentation_repository-files_readme-file-best-practices_62fcedf7.png index 843f5f7e..81d51128 100644 Binary files a/_images/social_previews/summary_documentation_repository-files_readme-file-best-practices_62fcedf7.png and b/_images/social_previews/summary_documentation_repository-files_readme-file-best-practices_62fcedf7.png differ diff --git a/_images/social_previews/summary_documentation_write-user-documentation_create-package-tutorials_e963eee3.png b/_images/social_previews/summary_documentation_write-user-documentation_create-package-tutorials_e963eee3.png index 88575730..7b96ac59 100644 Binary files a/_images/social_previews/summary_documentation_write-user-documentation_create-package-tutorials_e963eee3.png and b/_images/social_previews/summary_documentation_write-user-documentation_create-package-tutorials_e963eee3.png differ diff --git a/_images/social_previews/summary_documentation_write-user-documentation_document-your-code-api-docstrings_6530669a.png b/_images/social_previews/summary_documentation_write-user-documentation_document-your-code-api-docstrings_6530669a.png index 7feb8d3d..050c2a90 100644 Binary files a/_images/social_previews/summary_documentation_write-user-documentation_document-your-code-api-docstrings_6530669a.png and b/_images/social_previews/summary_documentation_write-user-documentation_document-your-code-api-docstrings_6530669a.png differ diff --git a/_images/social_previews/summary_documentation_write-user-documentation_get-started_655e1bad.png b/_images/social_previews/summary_documentation_write-user-documentation_get-started_655e1bad.png index 3eeda403..42da2070 100644 Binary files a/_images/social_previews/summary_documentation_write-user-documentation_get-started_655e1bad.png and b/_images/social_previews/summary_documentation_write-user-documentation_get-started_655e1bad.png differ diff --git a/_images/social_previews/summary_documentation_write-user-documentation_intro_073efb6a.png b/_images/social_previews/summary_documentation_write-user-documentation_intro_073efb6a.png index 22762e16..c3f7d542 100644 Binary files a/_images/social_previews/summary_documentation_write-user-documentation_intro_073efb6a.png and b/_images/social_previews/summary_documentation_write-user-documentation_intro_073efb6a.png differ diff --git a/_images/social_previews/summary_index_f00605b5.png b/_images/social_previews/summary_index_f00605b5.png index 4ddc0010..12049ea4 100644 Binary files a/_images/social_previews/summary_index_f00605b5.png and b/_images/social_previews/summary_index_f00605b5.png differ diff --git a/_images/social_previews/summary_package-structure-code_code-style-linting-format_a195a5b9.png b/_images/social_previews/summary_package-structure-code_code-style-linting-format_a195a5b9.png index 2a85cea8..02452304 100644 Binary files a/_images/social_previews/summary_package-structure-code_code-style-linting-format_a195a5b9.png and b/_images/social_previews/summary_package-structure-code_code-style-linting-format_a195a5b9.png differ diff --git a/_images/social_previews/summary_package-structure-code_complex-python-package-builds_d5505a31.png b/_images/social_previews/summary_package-structure-code_complex-python-package-builds_d5505a31.png index 398fd741..ca44d45c 100644 Binary files a/_images/social_previews/summary_package-structure-code_complex-python-package-builds_d5505a31.png and b/_images/social_previews/summary_package-structure-code_complex-python-package-builds_d5505a31.png differ diff --git a/_images/social_previews/summary_package-structure-code_intro_3894ec6c.png b/_images/social_previews/summary_package-structure-code_intro_3894ec6c.png index e638a70f..b391bb05 100644 Binary files a/_images/social_previews/summary_package-structure-code_intro_3894ec6c.png and b/_images/social_previews/summary_package-structure-code_intro_3894ec6c.png differ diff --git a/_images/social_previews/summary_package-structure-code_publish-python-package-pypi-conda_b5c69e7a.png b/_images/social_previews/summary_package-structure-code_publish-python-package-pypi-conda_b5c69e7a.png index e01cc23e..8ac095d8 100644 Binary files a/_images/social_previews/summary_package-structure-code_publish-python-package-pypi-conda_b5c69e7a.png and b/_images/social_previews/summary_package-structure-code_publish-python-package-pypi-conda_b5c69e7a.png differ diff --git a/_images/social_previews/summary_package-structure-code_pyproject-toml-python-package-metadata_4fb05649.png b/_images/social_previews/summary_package-structure-code_pyproject-toml-python-package-metadata_4fb05649.png index ff814770..5591fb31 100644 Binary files a/_images/social_previews/summary_package-structure-code_pyproject-toml-python-package-metadata_4fb05649.png and b/_images/social_previews/summary_package-structure-code_pyproject-toml-python-package-metadata_4fb05649.png differ diff --git a/_images/social_previews/summary_package-structure-code_python-package-build-tools_e4008c3a.png b/_images/social_previews/summary_package-structure-code_python-package-build-tools_e4008c3a.png index 0f8d51b5..3a52fb8d 100644 Binary files a/_images/social_previews/summary_package-structure-code_python-package-build-tools_e4008c3a.png and b/_images/social_previews/summary_package-structure-code_python-package-build-tools_e4008c3a.png differ diff --git a/_images/social_previews/summary_package-structure-code_python-package-distribution-files-sdist-wheel_714f58ff.png b/_images/social_previews/summary_package-structure-code_python-package-distribution-files-sdist-wheel_714f58ff.png index 1885b081..b8684aa4 100644 Binary files a/_images/social_previews/summary_package-structure-code_python-package-distribution-files-sdist-wheel_714f58ff.png and b/_images/social_previews/summary_package-structure-code_python-package-distribution-files-sdist-wheel_714f58ff.png differ diff --git a/_images/social_previews/summary_package-structure-code_python-package-structure_8a84082a.png b/_images/social_previews/summary_package-structure-code_python-package-structure_8a84082a.png index 82f12c51..03d66b36 100644 Binary files a/_images/social_previews/summary_package-structure-code_python-package-structure_8a84082a.png and b/_images/social_previews/summary_package-structure-code_python-package-structure_8a84082a.png differ diff --git a/_images/social_previews/summary_package-structure-code_python-package-versions_3b291cf3.png b/_images/social_previews/summary_package-structure-code_python-package-versions_3b291cf3.png index e57b9f82..88d04791 100644 Binary files a/_images/social_previews/summary_package-structure-code_python-package-versions_3b291cf3.png and b/_images/social_previews/summary_package-structure-code_python-package-versions_3b291cf3.png differ diff --git a/_images/social_previews/summary_python-packaging_intro_93d8367c.png b/_images/social_previews/summary_python-packaging_intro_93d8367c.png index f505a4df..59687b81 100644 Binary files a/_images/social_previews/summary_python-packaging_intro_93d8367c.png and b/_images/social_previews/summary_python-packaging_intro_93d8367c.png differ diff --git a/_sources/package-structure-code/code-style-linting-format.md.txt b/_sources/package-structure-code/code-style-linting-format.md.txt index 4f746ecf..27adeaa7 100644 --- a/_sources/package-structure-code/code-style-linting-format.md.txt +++ b/_sources/package-structure-code/code-style-linting-format.md.txt @@ -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: diff --git a/_sources/package-structure-code/python-package-structure.md.txt b/_sources/package-structure-code/python-package-structure.md.txt index 7103f9bc..137ecab8 100644 --- a/_sources/package-structure-code/python-package-structure.md.txt +++ b/_sources/package-structure-code/python-package-structure.md.txt @@ -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). @@ -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/ ``` @@ -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. diff --git a/package-structure-code/code-style-linting-format.html b/package-structure-code/code-style-linting-format.html index bf9ff3a1..7ce5e224 100644 --- a/package-structure-code/code-style-linting-format.html +++ b/package-structure-code/code-style-linting-format.html @@ -715,7 +715,7 @@

Example application of isort#

Ruff 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:

Below you can see the recommended structure of a scientific Python package using the flat layout.