From aca47811557cb3e6cd343dc3bb602148f54ace5a Mon Sep 17 00:00:00 2001 From: Jeremy Paige Date: Wed, 6 Sep 2023 09:38:15 -0700 Subject: [PATCH] package name consistency --- package-structure-code/python-package-structure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-structure-code/python-package-structure.md b/package-structure-code/python-package-structure.md index 7103f9bc4..137ecab80 100644 --- a/package-structure-code/python-package-structure.md +++ b/package-structure-code/python-package-structure.md @@ -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.