You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/1-installable-code.md
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -97,8 +97,8 @@ The directory structure you’ll create in this first section looks like this:
97
97
```bash
98
98
pyospackage/
99
99
└─ pyproject.toml
100
-
└─ src/ # The src directory ensures your tests always run on the installed
101
-
└── pyospackage/ # Package directory where code lives, use the package name
100
+
└─ src/ # The src directory ensures your tests always run on the installed version of your code
101
+
└── pyospackage/ # Package directory where code lives, use the package name
102
102
├── __init__.py
103
103
├── add_numbers.py
104
104
└── # Add any other .py modules that you want here
@@ -110,10 +110,12 @@ Below, you will learn about each element of the above package structure.
110
110
111
111
Notice a few things about the above layout:
112
112
113
-
1. Your package code lives within a `src/packagename` directory. We suggest that you use `src/` directory as it ensure you are running tests on the installed version of your code. However, you are welcome to instead use a [flat layout](https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html#about-the-flat-python-package-layout) which does not have a src/ directory at the root. [Learn more here.](https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html#the-src-layout-and-testing)
114
-
2. Within the `src/` directory you have a package directory called `pyospackage/`. Use the name of your package for that directory name.
115
-
3. In your package directory, you have an `__init__.py` file and all of your Python modules.
116
-
4. The `pyproject.toml` file lives at the root directory of your package.
113
+
114
+
1. Your package code lives within a `src/packagename` directory. We suggest that you use `src/` directory as it ensures that you are running tests on the installed version of your code. However, you are welcome to instead use a [flat layout](https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html#about-the-flat-python-package-layout) which does not have a src/ directory at the root. [Learn more here.](https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html#the-src-layout-and-testing)
115
+
1. Within the `src/` directory you have a package directory called `pyospackage/`. Use the name of your package for that directory name.
116
+
1. In your package directory, you have an `__init__.py` file and all of your Python modules.
117
+
1. The `pyproject.toml` file lives at the root directory of your package.
118
+
1. The name of the root directory for the package is **pyospackage** which is the name of the package. This is not a requirement but you will often see that the GitHub / GitLab repo and the root directory name are the same as the package name.
0 commit comments