Skip to content

Commit dfbca35

Browse files
committed
Init hatch
1 parent 88845b5 commit dfbca35

File tree

2 files changed

+85
-2
lines changed

2 files changed

+85
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Popular Python virtual environment management tools:
1212
* [5] [poetry](poetry/README.md)
1313
* [6] [pyenv + virtualenv](pyenv+virtualenv/README.md)
1414
* [7] [conda](conda/README.md)
15-
* hatch
16-
* pdm + venv, virtualenv, conda
15+
* [8] [hatch](hatch/README.md)
16+
* pdm
1717
* pew
1818
* tox
1919
* nox

hatch/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# hatch
2+
3+
Hatch is a modern, extensible Python project manager.
4+
5+
6+
## How to install it?
7+
8+
Install using `pip`
9+
```bash
10+
$ pip install hatch
11+
```
12+
13+
Or, install using `pipx`
14+
```bash
15+
$ pipx install hatch
16+
```
17+
18+
Or, install using `conda`
19+
```bash
20+
$ conda install -c conda-forge hatch
21+
```
22+
23+
For MacOS users, Hatch could be installed by using Homebrew,
24+
```bash
25+
$ brew install hatch
26+
```
27+
28+
For more information about Hatch installtion, please see the [official documentation](https://hatch.pypa.io/latest/install/)
29+
30+
31+
## How to use it?
32+
33+
#### 1. Create a virtual environment
34+
35+
You can create virtual environments by using the following command,
36+
```bash
37+
$ hatch env create
38+
```
39+
40+
Actually, you never need to manually create the environment, as spawning a shell or running commands within a project will automatically
41+
trigger the environment creation.
42+
43+
Where the virtual environments would be created? Well, it depends on the operation systems you are using. For my case, I am using Ubuntu,
44+
the directory that contains the virtual environments are:
45+
```bash
46+
~/.local/share/hatch/env/virtual
47+
```
48+
49+
#### 2. Activate the virtual environment
50+
51+
Using the `env show` command to list all available virtual environments:
52+
```bash
53+
$ hatch env show --ascii
54+
```
55+
56+
Spawn a shell to activate and use the environment,
57+
```bash
58+
$ hatch shell
59+
```
60+
61+
#### 3. Manage Python packages
62+
63+
#### 4. Deactivate the virtual environment
64+
65+
You can type `exit` to leave the environment,
66+
```bash
67+
$ exit
68+
```
69+
70+
#### 5. Remove the virtual environment
71+
72+
You can remove a single virtual environment by using this command:
73+
```bash
74+
$ hatch env remove
75+
```
76+
77+
If you try to remove all of a project's environments by using this command:
78+
```bash
79+
$ hatch env prune
80+
```
81+
82+
## Different Python versions?
83+

0 commit comments

Comments
 (0)