Skip to content

Commit 90424ae

Browse files
committed
Fix: edits from review
1 parent da9994e commit 90424ae

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# pyOpenSci Python Open Source Package Development Guide
22

3+
```{toctree}
4+
:hidden:
5+
:caption: Tutorials
6+
Tutorials <tutorials/intro>
7+
```
8+
39
```{toctree}
410
:hidden:
511
:caption: Documentation

tutorials/1-installable-code.md

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

3-
The first step in creating a Python package based on code that you
4-
have is to make that code pip installable. You will learn how to make
5-
your code pip installable in this lesson.
3+
In the previous lesson, you learned about both what a Python package is. You also learned about the [benefits of creating a Python
4+
package](tutorials/intro.html#why-create-a-python-package) including:
5+
6+
* Being able to easily reuse in multiple workflows on your computer
7+
* Being able to share your code with others who may find the functionality useful.
8+
* Being able to better organize code that needs to be reused.
9+
10+
11+
The first step in creating a Python package is turning that
12+
code into a Python package that is pip installable.
13+
The package that you create in this lesson will have
14+
the bare minimum elements that you need to install a package.
15+
16+
In upcoming lessons you will learn how to:
17+
* add a **README** file to support community use of your package
18+
* add package metadata in a **pyproject.toml** file to support publication to PyPI
619

720
<!--
821
TODO: is it clear where to add commands? bash vs. python console
@@ -11,11 +24,12 @@ Bash vs zsh is different
1124
does this work on windows and mac? i know it works on mac/linux
1225
-->
1326

14-
:::{figure-md} code-to-script
27+
:::{figure-md} code-to-python-package
28+
29+
<img src="../images/tutorials/code-to-python-package.png" alt="Diagram showing the basic steps to creating an installable package. There are 4 boxes with arrows pointing towards the right. The boxes read, your code, create package structure, add metadata to pyproject.toml and pip install package." width="700px">
1530

16-
<img src="../images/tutorials/code-to-script-diagram.png" alt="Diagram showing the basic steps to creating an installable package. There are 4 boxes with arrows pointing towards the right. The boxes read, your code, create package structure, add metadata to pyproject.toml and pip install package." width="700px">
31+
A basic installable package needs a few things: code, a [specific package file structure](https://www.pyopensci.org/python-package-guide/package-structure-code/python-package-structure.html) and a `pyproject.toml` containing your package's name and version. Once you have these items in the correct directory structure, you can pip install your package into any environment on your computer.
1732

18-
A basic installable package needs a few things: code, a specific package structure and a `pyproject.toml` containing your package's name and version. Once you have these items in the correct directory structure, you can pip install your package into any environment on your computer.
1933
:::
2034

2135
:::{admonition} Learning Objectives
@@ -33,7 +47,7 @@ environment. You are welcome to use any environment manager that you choose.
3347

3448
* [If you need guidance creating a Python environment, review this lesson](extras/1-create-environment.md) which walks you through creating an environment using both `venv` and `conda`.
3549
* If you aren't sure which environment manager to use and
36-
you are a scientist, we suggest that you use `conda`.
50+
you are a scientist, we suggest that you use `conda`, particularly if you are working with any sort of spatial data.
3751
:::
3852

3953
## Make your package installable

tutorials/intro.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Python packaging 101
2+
3+
When we merge PR 1 this file will be updated with
4+
full content. please ignore for now it's a placeholder for the toctree
5+
6+
:::{toctree}
7+
:hidden:
8+
:caption: Python Packaging 101
9+
10+
What is a Python package? <self>
11+
Make your code pip installable <1-installable-code>
12+
:::

0 commit comments

Comments
 (0)