Просмотр исходного кода

Fixes #3460: Extend upgrade script to validate Python dependencies

Jeremy Stretch 6 лет назад
Родитель
Сommit
ae4f17264f
2 измененных файлов с 12 добавлено и 0 удалено
  1. 1 0
      docs/release-notes/version-2.6.md
  2. 11 0
      upgrade.sh

+ 1 - 0
docs/release-notes/version-2.6.md

@@ -9,6 +9,7 @@
 ## Bug Fixes
 ## Bug Fixes
 
 
 * [#3340](https://github.com/netbox-community/netbox/issues/3340) - Add missing options to connect front ports to console ports
 * [#3340](https://github.com/netbox-community/netbox/issues/3340) - Add missing options to connect front ports to console ports
+* [#3460](https://github.com/netbox-community/netbox/issues/3460) - Extend upgrade script to validate Python dependencies
 * [#3596](https://github.com/netbox-community/netbox/issues/3596) - Prevent server error when reassigning a device to a new device bay
 * [#3596](https://github.com/netbox-community/netbox/issues/3596) - Prevent server error when reassigning a device to a new device bay
 
 
 ---
 ---

+ 11 - 0
upgrade.sh

@@ -20,6 +20,17 @@ COMMAND="${PIP} install -r requirements.txt --upgrade"
 echo "Updating required Python packages ($COMMAND)..."
 echo "Updating required Python packages ($COMMAND)..."
 eval $COMMAND
 eval $COMMAND
 
 
+# Validate Python dependencies
+COMMAND="${PIP} check"
+echo "Validating Python dependencies ($COMMAND)..."
+eval $COMMAND || (
+  echo "******** PLEASE FIX THE DEPENDENCIES BEFORE CONTINUING ********"
+  echo "* Manually install newer version(s) of the highlighted packages"
+  echo "* so that 'pip3 check' passes. For more information see:"
+  echo "* https://github.com/pypa/pip/issues/988"
+  exit 1
+)
+
 # Apply any database migrations
 # Apply any database migrations
 COMMAND="${PYTHON} netbox/manage.py migrate"
 COMMAND="${PYTHON} netbox/manage.py migrate"
 echo "Applying database migrations ($COMMAND)..."
 echo "Applying database migrations ($COMMAND)..."