Keeping track of Django project dependencies
Introducing django-package-monitor
tl;dr We’ve released django-package-monitor, a django app to make it easier to see which packages are out of date.
UPDATE: I messed up the setup.py dependencies in the original package, and the latest package depends on a source install of semantic_version
, so you will need to use the --process-dependency-links option
when installing dpm. See the README for more details.
UPDATE 2: the --process-dependency-links
option doesn't work when installing from PyPI, so I've removed it. I'm afraid that means you have to install the patched semantic_version
package independently, so you need it in your requirements also. See the README for more details.
If you have a Django project of any size that lasts for more than a few months you’ll have come across the issue of package version updates. Keeping on top of this if you have a large project (we have close on 100 external requirements in our project) is a PITA and generally goes like this:
“Apparently Django 1.8 is out, we should upgrade”
“OK. Whilst I’m editing requirements.txt
I’ll check the rest (pip list --outdated
)"
“Ah. We have 94 packages that are out of date.”
In order to keep on top of this we have had a monthly Trello card for someone to run pip list —outdated
, parse the output into three blocks - ‘major’, ‘minor’ and ‘patch’ - and then go through updating them. The theory is that we can update all the patch updates in one go, then proceed with caution updating the rest.
As the November update came and went, we decided to try and make it a less onerous task, and so we give you django-package-monitor, an app that surfaces your current setup within the standard Django admin site.
It’s very simple, and works thus:
- Parse the project requirements.txt file into package + version.
- Check the PyPI API for updates, and record those.
- Display current and latest versions in the admin list view.
- Allow you to filter by major / minor / patch / other
More details over on the Github project page.
Making Freelance Work
Posted in: django