0 added
0 removed
Original
2026-01-01
Modified
2026-02-21
1
<p>When your project is ready to be shared with others, it's time to build the code. The compiled distribution doesn't need Poetry anymore. The program will run without it.</p>
1
<p>When your project is ready to be shared with others, it's time to build the code. The compiled distribution doesn't need Poetry anymore. The program will run without it.</p>
2
<p>It is where Poetry comes in again. In this tutorial, we'll learn how to build and install the distribution.</p>
2
<p>It is where Poetry comes in again. In this tutorial, we'll learn how to build and install the distribution.</p>
3
<h2>Building and installing the distribution kit</h2>
3
<h2>Building and installing the distribution kit</h2>
4
<p>Usually, Poetry projects are almost ready to build their distributions. Some cases require additional configuration steps. But we won't go into that because it's irrelevant.</p>
4
<p>Usually, Poetry projects are almost ready to build their distributions. Some cases require additional configuration steps. But we won't go into that because it's irrelevant.</p>
5
<p>You can build a simple project using the poetry build command:</p>
5
<p>You can build a simple project using the poetry build command:</p>
6
<p>Run this command in the root directory of the project. You will see a dist/ directory with two files with different extensions.</p>
6
<p>Run this command in the root directory of the project. You will see a dist/ directory with two files with different extensions.</p>
7
<p>First, we look at a file with the .whl extension, which is short for<em>wheel</em>. This file is already suitable for installation using pip. Let's install it in the user's environment:</p>
7
<p>First, we look at a file with the .whl extension, which is short for<em>wheel</em>. This file is already suitable for installation using pip. Let's install it in the user's environment:</p>
8
<p>If there are scripts described for the project, they're available as commands. For example, this is how say-hello works in our case:</p>
8
<p>If there are scripts described for the project, they're available as commands. For example, this is how say-hello works in our case:</p>
9
<h2>Installing the package without building the distribution</h2>
9
<h2>Installing the package without building the distribution</h2>
10
<p>When you work on code, you often want to try out your project quickly and without too much effort.</p>
10
<p>When you work on code, you often want to try out your project quickly and without too much effort.</p>
11
<p>Let's try running the program without building a distribution. To do this, specify the path to the project directory as the package name in the pip install command:</p>
11
<p>Let's try running the program without building a distribution. To do this, specify the path to the project directory as the package name in the pip install command:</p>
12
<p>In the code above, we used the dot . - if you remember, that means the current directory.</p>
12
<p>In the code above, we used the dot . - if you remember, that means the current directory.</p>
13
<h2>Installing Poetry projects from GitHub</h2>
13
<h2>Installing Poetry projects from GitHub</h2>
14
<p>This course mentioned earlier that you can install packages directly from GitHub using pip. This feature is also available for poetry projects.</p>
14
<p>This course mentioned earlier that you can install packages directly from GitHub using pip. This feature is also available for poetry projects.</p>
15
<p>Pip has only recently become aware of pyproject.toml. We recommend that you upgrade pip regularly with the pip install --user --upgrade pip command.</p>
15
<p>Pip has only recently become aware of pyproject.toml. We recommend that you upgrade pip regularly with the pip install --user --upgrade pip command.</p>