Skip to content

Fix: small edits to headers of lesson #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ by the community now! Join our community review process or watch development of
:class-card: left-aligned

* [What is a Python package?](/tutorials/intro)
* [Make your code installable](/tutorials/1-installable-code)
* [Make your code installable](/tutorials/installable-code)
* [Publish your package to (test) PyPi](/tutorials/publish-pypi)
* [Publish your package to conda-forge](/tutorials/publish-conda-forge)

Expand Down
2 changes: 1 addition & 1 deletion tutorials/add-license-coc.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ There are several ways to add a LICENSE file:
:::{tip}
If you completed the past lessons including

1. [Making your code installable](1-installable-code.md) and
1. [Making your code installable](installable-code.md) and
2. [publishing your package to PyPI](publish-pypi.md)

then you already have a **LICENSE** file containing text for the MIT license in your Python package. Thus you can skip to the next section of this tutorial which walks you through adding a CODE_OF_CONDUCT.
Expand Down
2 changes: 1 addition & 1 deletion tutorials/add-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
In the previous lessons you learned:

1. [What a Python package is](intro.md)
2. [How to make your code installable](1-installable-code)
2. [How to make your code installable](installable-code)
3. [How to publish your package to (test) PyPI](publish-pypi.md)
4. [How to publish your package to conda-forge](publish-conda-forge.md)

Expand Down
23 changes: 15 additions & 8 deletions tutorials/1-installable-code.md → tutorials/installable-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,9 @@ pyospackage # This is your project directory

```

## Step 2: Add code to your package
## Step 2: Add module to your package

Within the `pyospackage` subdirectory, add one or more Python modules.
A Python module refers to a `.py` file containing the code that you want your package to access and run.
A Python module refers to a `.py` file containing the code that you want your package to access and run. Within the `pyospackage` subdirectory, add at least one Python modules (.py files).

If you don't have code already and are just learning how to create a Python package, then create an empty `add_numbers.py` file. You will
populate the `add_numbers.py` file with code provided below.
Expand All @@ -258,7 +257,7 @@ pyospackage/
├── add_numbers.py
```

## Step 3: Add code to your `add_numbers.py` module
## Step 3: Add code to your module

If you are following along and making a Python package from scratch then you can add the code below to your `add_numbers.py` module. The function below adds two integers together and returns the result. Notice that the code below has a few features that we will review in future tutorials:

Expand Down Expand Up @@ -404,14 +403,22 @@ You will learn how to automate defining a package
version using git tags in the version and release your package lesson.
:::

### Adjust project classifiers
### OPTIONAL: Adjust project classifiers

Hatch by default provides a list of classifiers that define what
Python versions your package supports. While this won't impact your package build, let's remove some of them that you likely don't need.
Python versions your package supports. These classifiers do not
in any way impact your package's build and are primarily
intended to be used when you publish your package to PyPI.

* Remove support for python 3.8
If you don't plan on publishing to PyPI, you can skip this section.
However, if you wish, you can clean it up a bit.

Also because we are assuming you're creating a pure Python package, you can remove the following classifiers:
To begin:

* Remove support for Python 3.8

Also because you are creating a pure Python package, you can
in this lesson, you can remove the following classifiers:

```toml
classifiers = [
Expand Down
4 changes: 2 additions & 2 deletions tutorials/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Get to know Hatch <get-to-know-hatch>
:caption: Create and publish a Python Package

What is a Python package? <self>
Make your code installable <1-installable-code>
Make your code installable <installable-code>
Publish to PyPI <publish-pypi>
Publish to conda-forge <publish-conda-forge>
:::
Expand Down Expand Up @@ -346,5 +346,5 @@ The elements above are also important for future maintenance of your package. In
In future lessons you will learn more about the infrastructure around a published Python package that makes it both easier to maintain, easier for others to contribute to and easier for other scientists to use. However, first we want to get you to your initial goal of publishing a Python package.

In this next lesson you will learn how to create a basic installable Python package.
Make your code pip installable <1-installable-code>
Make your code pip installable <installable-code>
:::
4 changes: 2 additions & 2 deletions tutorials/publish-conda-forge.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In the previous lessons, you've learned:

1. How to [create the most basic version of a Python package](1-installable-code.md). This entailed making your code installable.
1. How to [create the most basic version of a Python package](installable-code.md). This entailed making your code installable.
2. [How to publish your Python package to PyPI](publish-pypi)
3. How to add a `README` and `LICENSE` file to your package
4. How to setup your `pyproject.toml` file with all of the metadata that PyPI requires and also metadata that will be helpful for users to find your package.
Expand Down Expand Up @@ -464,7 +464,7 @@ Review the pull request. If all tests are passing, you can merge it. Shortly aft
If you have walked through this entire tutorial series you have now:

1. Understand [what a Python package is ](intro.md)
2. Know how to [make your code installable](1-installable-code.md) into Python environments
2. Know how to [make your code installable](installable-code.md) into Python environments
3. Know how to create a pyproject.toml file, a README file, and a License and code of conduct.
4. Know how to [publish your package to PyPI](publish-pypi.md) and
5. Know how to publish your package to conda-forge
Expand Down
2 changes: 1 addition & 1 deletion tutorials/publish-pypi.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Once you have your development environment setup, you are ready to build your pa

You will use Hatch as a **Front end** tool that builds
your package's sdist and wheel using the [hatchling](https://hatch.pypa.io/latest/) build back-end.
The hatchling build back-end is used because you declared it in your pyproject.toml file in the [previous lesson](1-installable-code).
The hatchling build back-end is used because you declared it in your pyproject.toml file in the [previous lesson](installable-code).

To build your package run `hatch build`:

Expand Down
4 changes: 2 additions & 2 deletions tutorials/pyproject-toml.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Make your Python package PyPI ready - pyproject.toml

In [the installable code lesson](1-installable-code), you learned how to add the bare minimum information to a `pyproject.toml` file to make it installable. You then learned how to [publish a bare minimum version of your package to PyPI](publish-pypi.md).
In [the installable code lesson](installable-code), you learned how to add the bare minimum information to a `pyproject.toml` file to make it installable. You then learned how to [publish a bare minimum version of your package to PyPI](publish-pypi.md).

Following that you learned how to add a:
* [README.md](add-readme)
Expand Down Expand Up @@ -156,7 +156,7 @@ The documentation for the hatchling back-end is [here](https://hatch.pypa.io/lat

### Step 1: Add Author, maintainer and project description

After completing the [installable code tutorial](1-installable-code), you should have a pyproject.toml file with a project name and a version in the `[project]` table.
After completing the [installable code tutorial](installable-code), you should have a pyproject.toml file with a project name and a version in the `[project]` table.

```toml
[project]
Expand Down