The Magic of Dependencies Installing Themselves
2024-09-23 , Online talks

Python scripts often rely on dependencies, which can make the sharing of code a more complex process. This process has been streamlined with the introduction of PEP 723, which allows dependencies information to be embedded in the same file as the code.
By leveraging this, Django developers can eliminate the need for complex setup instructions when sharing their code. In this talk, we are going to dissect the utilization of this method while using it in Python scripts with different dependencies.


When you write a Python script that has dependencies, the standard has always been to use a separate file like requirements.txt or pyproject.toml (using Tom’s Obvious, Minimal Language format) for handling the dependencies from external libraries. To share these scripts that are dependent on external libraries or other versions of Python, the process becomes more complex since the receiver has no choice but to create a new virtual environment with all the necessary dependencies. It becomes even more cumbersome in educational settings or among collaborators, where people might have different levels of Python expertise.

With the introduction of PEP 723, we’ve brought simplicity to our code, as we can now embed dependencies directly in a single file script. In this talk, we will explore this new method that enhances our productivity by making it easier to share, deploy, and work with Python scripts, making working with Django closer to being seamless.

Ilerioluwakiiye Abolade is a third year Mechatronics engineering student building expertise in Machine Learning. Leveraging a strong foundation in software development, she's actively expanding her skillset to tackle real-world ML challenges.