Skip to main content

Be a Problem Solver

Managing Project Dependencies with Poetry

Throughout the development of Python projects, incorporating third-party packages becomes essential. The conventional approach for managing project dependencies involves using a requirements.txt file. However, it’s easy to overlook updating this file with newly installed packages using pip freeze > requirements.txt. Moreover, it can be challenging to tell which dependencies were installed directly or indirectly via requirements.txt, making it unclear which packages are genuinely essential after removing some.

To address these issues, it’s recommended to adopt a modern package manager like poetry for more efficient project dependency management.

Using pytest to Test Your Code

Have you ever found yourself inheriting legacy code and questioned its functionality after refactoring? Or, have you made changes to your code and wondered if it still works correctly? If you’ve experienced either of these scenarios, it’s time to consider implementing tests for your code. In this article, we will cover the basics of pytest for conducting unit tests.

Using pyenv to Manage Python Versions

During development, you may require different Python versions for various projects. For example, you might need Python 3.6 for one project and Python 3.10 for another. Instead of installing different Python versions on your system, you can use pyenv to manage multiple Python versions.