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
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -92,13 +92,13 @@ pyospackage/ # Your project directory
92
92
93
93
Notice a few things about the above layout:
94
94
95
-
1. Your package code lives within a `src/packagename` directory. We suggest that you use `src` (short for **source code**) directory as it [ensures that you are running tests on the installed version of your code](https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html#the-src-layout-and-testing). 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.
96
-
1. Within the `src` directory you have a package directory called `pyospackage`. Use the name of your package for that directory name.
95
+
1. Your package code lives within a `src/packagename` directory. We suggest that you use `src` (short for **source code**) directory as it [ensures that you are running tests on the installed version of your code](https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html#the-src-layout-and-testing).
96
+
1. Within the `src` directory you have a package directory called `pyospackage`. Use the name of your package for that directory name. This will be the name for importing your package in Python code once installed.
97
97
1. In your package directory, you have an `__init__.py` file and all of your Python modules. You will learn more about the __init__.py file below.
98
98
1. The `pyproject.toml` file lives at the root directory of your package.
99
99
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.
100
100
101
-
### What is an __init__.py file?
101
+
### What is an `__init__.py` file?
102
102
103
103
The `__init__.py` file tells Python that a directory
104
104
should be treated as a Python package. As such, a directory with an `__init__.py` file can be imported
@@ -117,7 +117,7 @@ The **pyproject.toml** file is:
117
117
118
118
- Where you define your project’s metadata (including its name, authors, license, etc)
119
119
- Where you define dependencies (the packages that it depends on)
120
-
- Used to specify and configure what build back end you want to use to [build your package](../package-structure-code/python-package-distribution-files-sdist-wheel).
120
+
- Used to specify and configure what build backend you want to use to [build your package](../package-structure-code/python-package-distribution-files-sdist-wheel).
121
121
122
122
After the `__init__.py` and `pyproject.toml` files have been added,
123
123
your package can be built and distributed as an installable Python
0 commit comments