A Python tool to help manage CI and project dependencies.

Updating project dependencies is a giant pain in the ass.

About two months ago I made one of my first open source contributions by updating the project’s dependencies, the biggest one being an update from Django 1.x to the current 3.x. Updating everything at once broke the project because of version requirement conflicts, so I updated one library at a time. I ran the project, played whack-a-mole with errors until that dependency was properly updated everywhere, and then repeated for every library in the requirements.txt file. Two hours later it was finally done. It was a small project made just three years ago, so I figured I must have just done this the brute force way. I googled around and asked both Internet strangers and friends in tech what the easier, more efficient way was – it turns out that the brute force method for updates is pretty much the industry standard. I’m not quite skilled enough to write a program that automatically fixes all the update errors for you, so in the meantime I wrote one that at least tells you where those errors might be. (Since puns are not uncommon in Python, I named it thaw as a play off pip freeze.)

Thaw is a command line tool that identifies all out-of-date libraries in your project and generates a report telling you exactly where those libraries are used — even variables you’ve created with those libraries. It’s set to look for your requirements file by default, but if you don’t have a requirements file you can use the —imports flag. The report that generates shows all the libraries used in your project and where they’re used, and notes whether modules are local (and if they aren’t, tells you which downloaded ones are out of date). 

Thaw reports appear in the terminal by default, but you can also create a timestamped .txt file by using the —our flag and specifying a directory to write the report to. Reports give you filepaths relative to the top level of your project and lines within those files that use each library, and if you want the line text as well you can use the —verbose flag. 

Check it out on Github!

I learned a ton while doing this project, and over the next couple of weeks I’ll be making some short tutorials and in-depth looks at the different libraries and techniques I used to make thaw. Stay tuned!

Visits: 3300