Skip to content

Commit

Permalink
[deps] Added support for Django 4.1.0 and 4.2.0
Browse files Browse the repository at this point in the history
- Added support for Django 4.1.0 and 4.2.0 
- Dropped support for Django 4.0.0
  • Loading branch information
pandafy authored Jun 20, 2023
1 parent e363f0b commit f2df406
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 26 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
- "3.10"
django-version:
- django~=3.2.0
- django~=4.0.0
- django~=4.1.0
- django~=4.2.0

steps:
- name: Install system packages
Expand Down Expand Up @@ -66,7 +67,7 @@ jobs:
- name: Install openwisp-network-topology
run: |
pip install -e .
pip install -U -e .
pip install ${{ matrix.django-version }}
- name: QA checks
Expand Down
3 changes: 0 additions & 3 deletions openwisp_network_topology/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ def get_version():
rev = 0
version = '%s%s%s' % (version, VERSION[3][0:1], rev)
return version


default_app_config = 'openwisp_network_topology.apps.OpenwispNetworkTopologyConfig'
3 changes: 0 additions & 3 deletions openwisp_network_topology/integrations/device/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
default_app_config = (
'openwisp_network_topology.integrations.device.apps.OpenwispTopologyDeviceConfig'
)
2 changes: 1 addition & 1 deletion openwisp_network_topology/integrations/device/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class WifiMeshInlineAdmin(admin.StackedInline):


if app_settings.WIFI_MESH_INTEGRATION:
TopologyAdmin.inlines = TopologyAdmin.inlines + [WifiMeshInlineAdmin]
TopologyAdmin.inlines = list(TopologyAdmin.inlines) + [WifiMeshInlineAdmin]
9 changes: 1 addition & 8 deletions openwisp_network_topology/integrations/device/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,7 @@ def auto_create_wireguard(cls, node):
ip_addresses = []
for ip in allowed_ips:
try:
network = ip_network(ip)
if network.prefixlen == network._max_prefixlen:
# In python 3.7, hosts method is not returning any ip
# if subnet mask is 32, resolved in future python releases
# https://bugs.python.org/issue28577
ip_addresses.append(str(network.network_address))
else:
ip_addresses.extend([str(host) for host in ip_network(ip).hosts()])
ip_addresses.extend([str(host) for host in ip_network(ip).hosts()])
except ValueError:
# invalid IP address
continue
Expand Down
10 changes: 10 additions & 0 deletions openwisp_network_topology/static/netjsongraph/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ input[type='text'].readonly {
.submit-row .visualizelink:focus {
background: #576a7c;
}

/*
The CSS for "hidden" class in Django >= 4.1 sets
"display: none !important". This hides the
"sideBarHandle" button. Thus, we unset the display
property below.
*/
.njg-sideBar.hidden {
display: unset !important;
}
4 changes: 2 additions & 2 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
responses~=0.16.0
pytest-asyncio~=0.14.0
responses~=0.23.1
pytest-asyncio~=0.21.0
pytest-django~=4.5.2
freezegun~=1.1.0
# Needed to test integrations
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
django>=3.0,<4.1
openwisp-users @ https://github.com/openwisp/openwisp-users/tarball/master
netdiff @ https://github.com/openwisp/netdiff/tarball/master
jsonfield~=3.1.0
Expand Down
3 changes: 0 additions & 3 deletions tests/openwisp2/sample_integration_device/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
default_app_config = (
'openwisp2.sample_integration_device.apps.OpenwispTopologyDeviceConfig'
)
3 changes: 3 additions & 0 deletions tests/openwisp2/sample_integration_device/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
class OpenwispTopologyDeviceConfig(BaseAppConfig):
name = 'openwisp2.sample_integration_device'
label = 'sample_integration_device'


del BaseAppConfig
3 changes: 0 additions & 3 deletions tests/openwisp2/sample_network_topology/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
default_app_config = (
'openwisp2.sample_network_topology.apps.SampleNetworkTopologyConfig'
)
3 changes: 3 additions & 0 deletions tests/openwisp2/sample_network_topology/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
class SampleNetworkTopologyConfig(OpenwispNetworkTopologyConfig):
name = 'openwisp2.sample_network_topology'
label = 'sample_network_topology'


del OpenwispNetworkTopologyConfig

0 comments on commit f2df406

Please sign in to comment.