HTML Diff
2 added 0 removed
Original 2026-01-01
Modified 2026-02-21
1 <p>A programming language is useless without a suitable interpreter or compiler.</p>
1 <p>A programming language is useless without a suitable interpreter or compiler.</p>
2 <p>But programs not only have to run, they also have to be delivered to the user. And the programs are rarely ready to go, so we need to update them after the installation. And they need to be developed further, sometimes for several years.</p>
2 <p>But programs not only have to run, they also have to be delivered to the user. And the programs are rarely ready to go, so we need to update them after the installation. And they need to be developed further, sometimes for several years.</p>
3 <p>Sometimes, situations arise where you need to update third-party libraries and sometimes the compiler or interpreter itself. Several tools have appeared and evolved in Python to solve the above issues. We will discuss some of them below. In this lesson, we will talk about the importance of choosing your tools.</p>
3 <p>Sometimes, situations arise where you need to update third-party libraries and sometimes the compiler or interpreter itself. Several tools have appeared and evolved in Python to solve the above issues. We will discuss some of them below. In this lesson, we will talk about the importance of choosing your tools.</p>
4 <p>Most tools have good documentation, and we won't repeat it here. The lesson's purpose is to give you a general idea of what's available and to empower you to choose which tool you want from those available.</p>
4 <p>Most tools have good documentation, and we won't repeat it here. The lesson's purpose is to give you a general idea of what's available and to empower you to choose which tool you want from those available.</p>
5 <p>But first, let's get acquainted with a new concept -<strong>lock files</strong>.</p>
5 <p>But first, let's get acquainted with a new concept -<strong>lock files</strong>.</p>
6 <h2>What are lock files</h2>
6 <h2>What are lock files</h2>
7 <p>When developing any library, the author should specify the versions of third-party packages required to make his code work.</p>
7 <p>When developing any library, the author should specify the versions of third-party packages required to make his code work.</p>
8 <p>Usually, the versioning is not rigid. Instead, programmers specify a range of versions that do not compromise compatibility between different parts.</p>
8 <p>Usually, the versioning is not rigid. Instead, programmers specify a range of versions that do not compromise compatibility between different parts.</p>
9 <p>But things don't go as planned sometimes:</p>
9 <p>But things don't go as planned sometimes:</p>
10 <ul><li>People may use a version range that is too wide</li>
10 <ul><li>People may use a version range that is too wide</li>
11 <li>Semantic versioning may not work properly</li>
11 <li>Semantic versioning may not work properly</li>
12 <li>There may be a bug in some package versions</li>
12 <li>There may be a bug in some package versions</li>
13 </ul><p>In such cases, the project only works with a combination of different package versions and not with all of them, as may have been intended.</p>
13 </ul><p>In such cases, the project only works with a combination of different package versions and not with all of them, as may have been intended.</p>
14 <p>A<strong>lock file</strong>can help with this problem. It lists packages with their versions currently suitable for the project. Programmers use lock files in one form or another by most package managers for different programming languages.</p>
14 <p>A<strong>lock file</strong>can help with this problem. It lists packages with their versions currently suitable for the project. Programmers use lock files in one form or another by most package managers for different programming languages.</p>
15 <h2>Interpreter version control - pyenv</h2>
15 <h2>Interpreter version control - pyenv</h2>
16 <p>Even while you're learning, you should have an up-to-date interpreter version. Python is suitable for automation needs, so it's often available in the package directories of different operating systems. As a rule, packages only contain CPython. But other implementations and versions of Python interpreters are helpful in different situations.</p>
16 <p>Even while you're learning, you should have an up-to-date interpreter version. Python is suitable for automation needs, so it's often available in the package directories of different operating systems. As a rule, packages only contain CPython. But other implementations and versions of Python interpreters are helpful in different situations.</p>
17 <p>Library authors often have to maintain multiple versions of Python and check whether new changes in code affect performance in different versions of Python.</p>
17 <p>Library authors often have to maintain multiple versions of Python and check whether new changes in code affect performance in different versions of Python.</p>
18 <p>Thus, you can install several different implementations of Python on one computer, each with several variants. You can control all this with<a>pyenv</a>.</p>
18 <p>Thus, you can install several different implementations of Python on one computer, each with several variants. You can control all this with<a>pyenv</a>.</p>
 
19 + <h2>The pipenv tool</h2>
19 <p>The pipenv program takes over:</p>
20 <p>The pipenv program takes over:</p>
20 <ul><li>Package management via pip</li>
21 <ul><li>Package management via pip</li>
21 <li>Creating virtual environments with venv</li>
22 <li>Creating virtual environments with venv</li>
22 <li>Working with dependencies</li>
23 <li>Working with dependencies</li>
23 <li>Control over versioning and updating</li>
24 <li>Control over versioning and updating</li>
24 <li>Building dependency graphs</li>
25 <li>Building dependency graphs</li>
25 <li>Reproducing assembly with lock files</li>
26 <li>Reproducing assembly with lock files</li>
26 </ul><p>It is a powerful tool, but there is one issue; you have to use distutils and Setuptools to describe how to build a package with a project. It may be difficult for newcomers to master this aspect, but other than that, it's convenient to use this program.</p>
27 </ul><p>It is a powerful tool, but there is one issue; you have to use distutils and Setuptools to describe how to build a package with a project. It may be difficult for newcomers to master this aspect, but other than that, it's convenient to use this program.</p>
27 <h2>Poetry</h2>
28 <h2>Poetry</h2>
28 <p>In our courses and projects, we recommend using Poetry. It's also with Poetry that our<a>python package boilerplate</a>is designed. What kind of tool is it?</p>
29 <p>In our courses and projects, we recommend using Poetry. It's also with Poetry that our<a>python package boilerplate</a>is designed. What kind of tool is it?</p>
29 <p>Overall<a>Poetry</a>- is a relatively new project that simplifies development in Python. It solves all the same problems as<strong>pipenv</strong>but also takes care of<strong>package assembly</strong>. Moreover, when you use Poetry, you don't need to delve deep into distutils or Setuptools.</p>
30 <p>Overall<a>Poetry</a>- is a relatively new project that simplifies development in Python. It solves all the same problems as<strong>pipenv</strong>but also takes care of<strong>package assembly</strong>. Moreover, when you use Poetry, you don't need to delve deep into distutils or Setuptools.</p>
30 <p>Poetry's documentation is concise and clear. It describes the recommended structure of directories in a typical project, the use of alternative indexes, and many other aspects.</p>
31 <p>Poetry's documentation is concise and clear. It describes the recommended structure of directories in a typical project, the use of alternative indexes, and many other aspects.</p>
31 <h2>IPython</h2>
32 <h2>IPython</h2>
32 <p>The Python REPL is pretty simple, and most importantly, it's always available. It is hard to work with for multi-line code and large programs.</p>
33 <p>The Python REPL is pretty simple, and most importantly, it's always available. It is hard to work with for multi-line code and large programs.</p>
33 <p>The good news is that the REPL in Python is modular. There are several improved versions of it. The most popular of which is<a>IPython</a>.</p>
34 <p>The good news is that the REPL in Python is modular. There are several improved versions of it. The most popular of which is<a>IPython</a>.</p>
34 <p>IPython has:</p>
35 <p>IPython has:</p>
35 <ul><li>Syntax highlighting</li>
36 <ul><li>Syntax highlighting</li>
36 <li>Auto-add modules for importing and defining modules</li>
37 <li>Auto-add modules for importing and defining modules</li>
37 <li>Tips for function arguments and displaying documentation</li>
38 <li>Tips for function arguments and displaying documentation</li>
38 <li>Much more</li>
39 <li>Much more</li>
39 </ul><p>Most data analysts spend most of their time in IPython because it is powerful and easy to use.</p>
40 </ul><p>Most data analysts spend most of their time in IPython because it is powerful and easy to use.</p>
 
41 + <h2>Other tools</h2>
40 <p>Over the decades, a large number of tools have emerged around Python. It is a common courtesy to document your code thoroughly when we speak about programming in Python. So, you can learn almost any tool on your own. You can always go to<a>the PyPI website</a>and browse the list of topics. You'll find projects that can make your life easier and development more convenient.</p>
42 <p>Over the decades, a large number of tools have emerged around Python. It is a common courtesy to document your code thoroughly when we speak about programming in Python. So, you can learn almost any tool on your own. You can always go to<a>the PyPI website</a>and browse the list of topics. You'll find projects that can make your life easier and development more convenient.</p>