Skip to content

Commit 4e0179e

Browse files
committed
Edits from review
1 parent cf79f06 commit 4e0179e

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

tutorials/1-installable-code.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Make your Python code pip installable
1+
# Make your Python code installable
22

33
In the previous lesson, you learned about both what a Python package is. You also learned about the [benefits of creating a Python
44
package](tutorials/intro.html#why-create-a-python-package) including:
@@ -50,30 +50,47 @@ environment. You are welcome to use any environment manager that you choose.
5050
you are a scientist, we suggest that you use `conda`, particularly if you are working with any sort of spatial data.
5151
:::
5252

53-
## Make your package installable
53+
54+
55+
## Make a basic installable Python package
5456

5557

5658
:::{figure-md} packages-environment
5759

5860
<img src="../images/tutorials/environment-package-install.png" alt="This diagram has two smaller boxes with arrows pointing to the right to a python environment. The small boxes read your-package and pip install package. The environment box on the right reads - your python environment. It them lists your-package along with a few other core packages such as matplotlib, numpy, pandas, xarray and geopandas." width="700px">
5961

60-
Making your source code pip-installable is the first step towards creating a Python package. Once your code is pip-installable, it is a Python package and can be added to any Python environment on your computer and imported in the same way that you might import a package such as `Pandas` or `Geopandas`.
62+
Making your source code pip-installable is the first step towards creating a Python package. Once your code is pip-installable, it is a Python package and can be added to any Python environment on your computer and imported in the same way that you might import a package such as Pandas or GeoPandas.
6163
:::
6264

63-
## Make a basic Python package
64-
6565
It’s time to create the most basic version of a Python package.
66-
While this code can't be yet published to PyPI or conda and
67-
is not documented, it will be installable on your computer or
68-
anyone elses.
66+
67+
What you'll be able to do with this package at the end of this lesson is:
68+
69+
* Install it into any Python environment on your computer
70+
* If you share your code with someone else on GitHub or some other file/sharing or cloud based sharing platform, others will be able to install your package too.
71+
72+
While installable code is the first step towards making a Python package, there are some limitations. What you won't be able to do
73+
by the end of this lesson is publish your package to PyPI and then conda-forge.
74+
75+
The next 3 lessons in this series will teach you how to add the proper
76+
metadata and documentation that you will need to publish to PyPI.
77+
78+
:::{admonition} Installing packages from GitHub
79+
80+
If you wish to share your code without publishing to PyPI you can
81+
always install packages directly from GitHub using the syntax:
82+
83+
`pip install git+https://github.com/user/repo.git@branch_or_tag``
84+
85+
:::
6986

7087
### What does a basic package directory structure look like?
7188
To make your code installable you need:
7289

73-
- A `pyproject.toml` file
74-
- An (optional but recommended) `__init__.py` file in your code directory
75-
- A specific directory structure
90+
- A `pyproject.toml` file.
91+
- A specific directory structure.
7692
- Some code.
93+
- An `__init__.py` file in your code directory.
7794

7895
The directory structure you’ll create in this first section looks like this:
7996

0 commit comments

Comments
 (0)