# Checklists for upgrading packages and upgrading Python - Public Notes

**URL:** <https://forum.djangoproject.com/t/checklists-for-upgrading-packages-and-upgrading-python-public-notes/25197>\
**Category:** Show & Tell\
**Created:** [November 10, 2023, 12:52pm UTC](https://forum.djangoproject.com/t/checklists-for-upgrading-packages-and-upgrading-python-public-notes/25197 "2023-11-10T12:52:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephanieAG](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/stephanieag/32/17567_2.png) [@StephanieAG](https://forum.djangoproject.com/u/StephanieAG)\
**Post date:** [November 10, 2023, 12:52pm UTC](https://forum.djangoproject.com/t/checklists-for-upgrading-packages-and-upgrading-python-public-notes/25197/1 "2023-11-10T12:52:06Z")

</div>

In the spirit of creating public notes (which I heard about from [Ryan Cheley during his talk at DjangoCon US 2023](https://2023.djangocon.us/talks/contributing-to-django-or-how-i-learned-to-stop-worrying-and-just-try-to-fix-an-orm-bug/)), I’m posting on the chance it could be helpful for anyone else who is also learning.

Feedback welcome - as with everything, I’m sure there are iterations to be made as I learn more (just please keep in mind that I’m a beginner if responding).

## Upgrading packages checklist [check ~monthly]

- Check for deprecation warnings by running the project’s tests  
`python -Wa manage.py test` \>\>\> use if using Django Test module  
`PYTHONWARNINGS=always pytest --capture=no` \>\>\> use if using pytest

- Check if there are any outdated dependencies / package versions in the project:  
`pip list --outdated`

- For each outdated package,

- Save file

- Compile updated requirements.txt or (dev-requirements.txt)  
`pip-compile requirements.in`  
or  
`pip-compile dev-requirements.in`

- Sync your venv to make it match your dev-requirements.txt file  
`pip-sync dev-requirements.txt`  
_Note: you always sync the dev-requirements.txt file (even if you only updated the requirements.in file) because the dev requirements inherit the requirements.txt too and you’re using the dev requirements locally (so the venv should always be updated to match any update)_

- Double-check that the venv has the correct updated version number  
`pip freeze`

- Commit changes to Git  
`git status`  
`git add -A`  
`git commit -m ‘upgraded OutdatedPackageName version to X.X.X; updated requirements files’`

- Double-check everythings OK by running the project’s tests again  
`python -Wa manage.py test` \>\>\> use if using Django Test module  
`PYTHONWARNINGS=always pytest --capture=no` \>\>\> use if using pytest

## Upgrading Homebrew / Python checklist (Mac) [check every ~3 months]

- Find the version of Python your project currently uses in venv  
`python --version`

- Find the release date of the version currently used and compare it to the release date of the newer versions of Python  
[Download Python | Python.org](https://www.python.org/downloads/)

- Upgrade Python version (& other outdated stuff in Homebrew)

**Some assumptions**

- Mac
- pytest
- pip-tools

**Some sources**

- [How to upgrade Django to a newer version | Django documentation | Django](https://docs.djangoproject.com/en/4.2/howto/upgrade-version/#resolving-deprecation-warnings)
- [Django Dependency Management with pip-compile and pip-tools](https://learndjango.com/tutorials/django-dependency-management-pip-compile-and-pip-t)
- [Using pip-compile to manage dependencies in your Python packages](https://medium.com/packagr/using-pip-compile-to-manage-dependencies-in-your-python-packages-8451b21a949e)
- [Managing your requirements.txt with pip-tools in python](https://suyojtamrakar.medium.com/managing-your-requirements-txt-with-pip-tools-in-python-8d07d9dfa464)
- [FAQ (Frequently Asked Questions) — Homebrew Documentation](https://docs.brew.sh/FAQ#how-do-i-update-my-local-packages)
