diff --git a/docs/installation/1-postgresql.md b/docs/installation/1-postgresql.md index 97a44c20e..a6aa27b1b 100644 --- a/docs/installation/1-postgresql.md +++ b/docs/installation/1-postgresql.md @@ -21,9 +21,6 @@ This section entails the installation and configuration of a local PostgreSQL da sudo postgresql-setup --initdb ``` - !!! info - PostgreSQL 10 and later are available natively on CentOS 8.2. If using an earlier CentOS release, you may need to [install it from an RPM](https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/). - CentOS configures ident host-based authentication for PostgreSQL by default. Because NetBox will need to authenticate using a username and password, modify `/var/lib/pgsql/data/pg_hba.conf` to support MD5 authentication by changing `ident` to `md5` for the lines below: ```no-highlight diff --git a/docs/installation/3-netbox.md b/docs/installation/3-netbox.md index c864ccd07..0b78e0ef4 100644 --- a/docs/installation/3-netbox.md +++ b/docs/installation/3-netbox.md @@ -17,8 +17,13 @@ Begin by installing all system packages required by NetBox and its dependencies. === "CentOS" + !!! warning + CentOS 8 does not provide Python 3.7 or later via its native package manager. You will need to install it via some other means. [Here is an example](https://tecadmin.net/install-python-3-7-on-centos-8/) of installing Python 3.7 from source. + + Once you have Python 3.7 or later installed, install the remaining system packages: + ```no-highlight - sudo yum install -y gcc python36 python36-devel python3-pip libxml2-devel libxslt-devel libffi-devel libpq-devel openssl-devel redhat-rpm-config + sudo yum install -y gcc libxml2-devel libxslt-devel libffi-devel libpq-devel openssl-devel redhat-rpm-config ``` Before continuing, check that your installed Python version is at least 3.7: diff --git a/docs/installation/index.md b/docs/installation/index.md index 12d78c439..74b51da7f 100644 --- a/docs/installation/index.md +++ b/docs/installation/index.md @@ -1,6 +1,6 @@ # Installation -The installation instructions provided here have been tested to work on Ubuntu 20.04 and CentOS 8.2. The particular commands needed to install dependencies on other distributions may vary significantly. Unfortunately, this is outside the control of the NetBox maintainers. Please consult your distribution's documentation for assistance with any errors. +The installation instructions provided here have been tested to work on Ubuntu 20.04 and CentOS 8.3. The particular commands needed to install dependencies on other distributions may vary significantly. Unfortunately, this is outside the control of the NetBox maintainers. Please consult your distribution's documentation for assistance with any errors. The following sections detail how to set up a new instance of NetBox: diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index 528b90846..eaac82444 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -2,6 +2,10 @@ ## v3.0.10 (FUTURE) +### Bug Fixes + +* [#7752](https://github.com/netbox-community/netbox/issues/7752) - Fix minimum version check under Python v3.10 + --- ## v3.0.9 (2021-11-03) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index e8ae1ef69..f4f6c2f32 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -4,6 +4,7 @@ import os import platform import re import socket +import sys import warnings from urllib.parse import urlsplit @@ -27,11 +28,11 @@ HOSTNAME = platform.node() BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Validate Python version -if platform.python_version_tuple() < ('3', '7'): +if sys.version_info < (3, 7): raise RuntimeError( - f"NetBox requires Python 3.7 or higher (current: Python {platform.python_version()})" + f"NetBox requires Python 3.7 or later. (Currently installed: Python {platform.python_version()})" ) -if platform.python_version_tuple() < ('3', '8'): +if sys.version_info < (3, 8): warnings.warn( f"NetBox v3.2 will require Python 3.8 or later. (Currently installed: Python {platform.python_version()})" ) diff --git a/netbox/utilities/testing/api.py b/netbox/utilities/testing/api.py index 8498f93ae..b3fa5704f 100644 --- a/netbox/utilities/testing/api.py +++ b/netbox/utilities/testing/api.py @@ -345,7 +345,7 @@ class APIViewTestCases: obj_perm.users.add(self.user) obj_perm.object_types.add(ContentType.objects.get_for_model(self.model)) - id_list = self._get_queryset().values_list('id', flat=True)[:3] + id_list = list(self._get_queryset().values_list('id', flat=True)[:3]) self.assertEqual(len(id_list), 3, "Insufficient number of objects to test bulk update") data = [ {'id': id, **self.bulk_update_data} for id in id_list @@ -416,7 +416,7 @@ class APIViewTestCases: # Target the three most recently created objects to avoid triggering recursive deletions # (e.g. with MPTT objects) - id_list = self._get_queryset().order_by('-id').values_list('id', flat=True)[:3] + id_list = list(self._get_queryset().order_by('-id').values_list('id', flat=True)[:3]) self.assertEqual(len(id_list), 3, "Insufficient number of objects to test bulk deletion") data = [{"id": id} for id in id_list]