Python tox Install a dependency as editable

preview_player
Показать описание
In this tutorial, we will learn how to install a Python dependency as "editable" using the tox testing tool. Installing a dependency as "editable" means that changes made to the source code of the dependency will immediately affect your project without requiring a reinstall. This is particularly useful when you are developing your project alongside a dependency, and you want to see the impact of code changes without having to reinstall the dependency each time.
We will cover the following topics:
Before you begin, ensure that you have the following prerequisites in place:
Python installed on your system.
tox installed. You can install it using pip:
Let's start by creating a simple Python project that will serve as our main project. We will also create a dependency that we want to install as editable.
Create a new directory for your project and navigate to it in your terminal:
Create a directory for the dependency:
Now that we have our main project and a dependency set up, we can use tox to install the dependency in editable mode.
Now, in your main project directory, run tox:
That's it! You have successfully installed a Python dependency as editable using tox. This setup allows you to make changes to the dependency's source code and immediately see the impact on your main project without the need for repeated installations.
ChatGPT
Рекомендации по теме