Skip to content
Closed
51 changes: 49 additions & 2 deletions tutorials/get-to-know-hatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,58 @@ Our Python packaging tutorials use the tool Hatch.
In this tutorial, you will install and get to know Hatch a bit more before starting to use it.

## Install Hatch
To begin, install Hatch from the command line using [pipx](https://pipx.pypa.io/stable/)

```bash
pipx install hatch
pip install hatch
```
:::{note}
You can optionally install Hatch using pipx from the command line using [pipx](https://pipx.pypa.io/stable/). If you're on Windows you may face issues during installation, if so, read further for instructions on a potential solution.

Installation Process for Windows Users:
* Step 0: Open Powershell

Press `Windows Key` and then type `Windows PowerShell`

* Step 1: Ensure Python is installed within your Powershell Terminal

Copy and paste the following code, `python --version`

If Python is not installed, dont be alarmed!
[Download Python Here](https://www.python.org/downloads/)

* Step 2: Using the "curl" command install Pip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get-pip is a great bootstrapping tool for packaging, but unless the user is forced to use a very old version of Python I would strongly recommend python -m ensurepip instead which is part of the base language.

I guess I don't use Windows enough to know if there are any corner cases ensurepip won't work and get-pip would

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but I believe you're referencing Lines 26 to 32! If so, I can happily replace the dated 'get-pip' with 'python -m ensurepip'. That said, I would like to note that I was using the most recent version of Python at the time. Apologies for the tardy reply!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, I don't know why I had so many lines highlighted. get-pip will work with any python version, it's just more roundabout that using the module provided with base Python. Thanks for the update.


Copy and Paste the follwing code,
`curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py`

Then copy and paste the following code,
`python get-pip.py`

* Step 3: Download Scoop

Copy and Paste the following code,
`iwr -useb get.scoop.sh | iex`

If any errors occur copy and paste the following code,
`Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`

Then re-paste the first
`iwr -useb get.scoop.sh | iex`

* Step 4: Install Pipx

Copy and Paste the following code in Powershell,
`scoop install pipx`

Then, Copy and Paste the following code in Powershell,
`pipx ensurepath`

* Now, after completion of Step 4, you're prepared to continue to the first portion of the tutorial,
"Get to know hatch", to proceed in installing Hatch successfully!



:::

:::{tip}
Hatch can also be installed directly using `pip` or `conda`, but we encourage you to use `pipx`.
Expand Down