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/get-to-know-hatch.md
+15-19Lines changed: 15 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
# Get to know hatch
1
+
# Get to know Hatch
2
2
3
3
Our Python packaging tutorials use the tool Hatch.
4
-
In this tutorial, you will install and get to know hatch a bit more before starting to use it.
4
+
In this tutorial, you will install and get to know Hatch a bit more before starting to use it.
5
5
6
6
## Install Hatch
7
7
To begin, install Hatch from the command line using [pipx](https://pipx.pypa.io/stable/)
@@ -10,11 +10,6 @@ To begin, install Hatch from the command line using [pipx](https://pipx.pypa.io/
10
10
pipx install hatch
11
11
```
12
12
13
-
:::{tip}
14
-
Hatch also provides pre-build binaries available from common OS package managers or directly from
15
-
the [hatch website](https://hatch.pypa.io/latest/install/).
16
-
:::
17
-
18
13
:::{tip}
19
14
Hatch can also be installed directly using `pip` or `conda`, but we encourage you to use `pipx`.
20
15
This is because `pipx` will ensure that your package is available across all of your Python
@@ -34,24 +29,24 @@ Note the version numbers will likely be different
34
29
35
30
## Configure hatch
36
31
37
-
Once you have installed hatch, you will want to customize the configuration.
32
+
Once you have installed Hatch, you will want to customize the configuration.
38
33
39
-
Hatch stores your configuration information in a [config.toml file](https://hatch.pypa.io/latest/config/project-templates/).
34
+
Hatch stores your configuration information in a [`config.toml` file](https://.pypa.io/latest/config/project-templates/).
40
35
41
36
While you can update the `config.toml` file through the command line,
42
37
it might be easier to look at it and update it in a text editor if you are using it for the first time.
43
38
44
-
### Step 1: Open and edit your config.toml file
39
+
### Step 1: Open and edit your `config.toml` file
45
40
46
41
To open the config file in your file browser, run the following command in your shell:
47
42
48
43
`hatch config explore`
49
44
50
-
This will open up a directory window that will allow you to double click on the file and open it in your favorite text editor
45
+
This will open up a directory window that will allow you to double click on the file and open it in your favorite text editor.
51
46
52
47
### Step 2 - update your email and name
53
48
54
-
Once the file is open, update the [template] table of the config.toml file with your name and email. This information will be used in any pyproject.toml metadata files that you create using hatch.
49
+
Once the file is open, update the [template] table of the `config.toml` file with your name and email. This information will be used in any `pyproject.toml` metadata files that you create using Hatch.
Next, set tests to false in the `[template.plugins.default]` table.
65
60
66
61
While tests are important, setting the tests configuration in Hatch
67
-
to `true` will create a more complex pyproject.toml file. You won't
62
+
to `true` will create a more complex `pyproject.toml` file. You won't
68
63
need to use this feature in this beginner friendly tutorial series
69
64
but we will introduce it in later tutorials.
70
65
@@ -111,19 +106,19 @@ license in more detail in a later lesson, the MIT license is the
111
106
recommended permissive license from [choosealicense.com](https://www.choosealicense.com) and as such we will
112
107
use it for this tutorial series.
113
108
114
-
You are of course welcome to select another license
109
+
You are of course welcome to select another license.
115
110
116
111
:::{todo}
117
112
I think we'd need the SPDX license options here if they want to chose bsd-3 for instance
118
113
:::
119
114
120
-
### Step 4: Close the config file and run hatch config show
115
+
### Step 4: Close the config file and run `hatch config show`
121
116
122
117
Once you have completed the steps above run the following command in your shell.
123
118
124
119
`hatch config show`
125
120
126
-
hatch config show will print out the contents of your config.toml file in your shell. look at the values and ensure that your name, email is set. Also make sure that tests=false.
121
+
`hatch config show` will print out the contents of your `config.toml` file in your shell. look at the values and ensure that your name, email is set. Also make sure that `tests=false`.
127
122
128
123
## Hatch features
129
124
@@ -132,12 +127,13 @@ and maintaining your Python package easier.
132
127
133
128
:::{admonition} Comparison to other tools
134
129
:class: tip
135
-
[We compared hatch to several of the other popular packaging tools in the ecosystem including flit, pdm and poetry. Learn more here](package-features)
130
+
[We compared Hatch to several of the other popular packaging tools in the ecosystem including flit, pdm and poetry. Learn more here](package-features)
136
131
:::
137
132
138
-
[More on hatch here](hatch)
133
+
[More on Hatch here](hatch)
134
+
135
+
A few features that Hatch offers
139
136
140
-
A few features that hatch offers
141
137
142
138
1. it will convert metadata stored in a `setup.py` or `setup.cfg` file to a pyproject.toml file for you (see [Migrating setup.py to pyproject.toml using Hatch](setup-py-to-pyproject-toml.md
0 commit comments