ipaddons 0.6.0__tar.gz → 0.6.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: ipaddons
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: Additional tools for the ipaddress standard library module
5
5
  Project-URL: documentation, https://ipaddons.readthedocs.io/
6
6
  Project-URL: homepage, https://gitlab.com/sebastianw/ipaddons/
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
18
19
  Classifier: Topic :: Utilities
19
20
  Requires-Python: >=3.11
20
21
  Description-Content-Type: text/markdown
@@ -20,6 +20,7 @@ classifiers = [
20
20
  "Programming Language :: Python :: 3.12",
21
21
  "Programming Language :: Python :: 3.13",
22
22
  "Programming Language :: Python :: 3.14",
23
+ "Programming Language :: Python :: 3.15",
23
24
  "Topic :: Utilities",
24
25
  ]
25
26
  dynamic = [ "version" ]
@@ -40,10 +41,10 @@ docs = [
40
41
  ]
41
42
 
42
43
  [tool.hatch]
43
- build.hooks.vcs.version-file = "src/ipaddons/_version.py"
44
- build.targets.sdist.only-include = [ "src/ipaddons", "tests" ]
45
44
  version.source = "vcs"
46
45
  version.raw-options.local_scheme = "no-local-version"
46
+ build.hooks.vcs.version-file = "src/ipaddons/_version.py"
47
+ build.targets.sdist.only-include = [ "src/ipaddons", "tests" ]
47
48
 
48
49
  [tool.uv]
49
50
  [[tool.uv.index]]
@@ -119,16 +120,16 @@ lint.isort.required-imports = [ "from __future__ import annotations" ]
119
120
  lint.future-annotations = true
120
121
 
121
122
  [tool.pyproject-fmt]
122
- max_supported_python = "3.14"
123
123
  column_width = 120
124
124
  indent = 4
125
+ max_supported_python = "3.15"
125
126
 
126
127
  [tool.mypy]
128
+ exclude = [ "^src/[^/]+/_version\\.py$" ]
127
129
  disallow_untyped_defs = true
128
130
  pretty = true
129
131
  show_error_codes = true
130
- exclude = [ "^src/[^/]+/_version\\.py$" ]
131
132
 
132
133
  [tool.pytest]
133
- ini_options.addopts = "--color=yes"
134
134
  ini_options.testpaths = [ "tests" ]
135
+ ini_options.addopts = "--color=yes"
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.6.0'
22
- __version_tuple__ = version_tuple = (0, 6, 0)
21
+ __version__ = version = '0.6.1'
22
+ __version_tuple__ = version_tuple = (0, 6, 1)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -100,9 +100,10 @@ def free_ranges(superrange: NetworkRange, used_ranges: list[NetworkRange]) -> Ge
100
100
  :return: An interator for free ranges.
101
101
  """
102
102
  remaining_superrange = superrange
103
- # Make values unique and sort them. This is crucial when interating over them.
103
+ # Make used ranges unique and sort them. This is crucial when iterating over them, as we always remove them from the
104
+ # beginning of the (remaining) superrange.
104
105
  used_ranges = list(dict.fromkeys(used_ranges))
105
- used_ranges = sorted(used_ranges, key=lambda x: (x[0], -x[1]))
106
+ used_ranges.sort(key=lambda x: (x[0], -x[1]))
106
107
  for used_range in used_ranges:
107
108
  if not range_overlap(superrange, used_range):
108
109
  msg = f"{used_range} does not overlap with {remaining_superrange}"
@@ -114,7 +115,7 @@ def free_ranges(superrange: NetworkRange, used_ranges: list[NetworkRange]) -> Ge
114
115
  # Subrange ends below or begins above remaining superrange, ignore.
115
116
  continue
116
117
  if remaining_superrange[0] == used_range[0]:
117
- # Used range is at the beginning of remaining superrange, shrink it.
118
+ # Used range is at the beginning of remaining superrange, shrink the superrange to exclude the used range.
118
119
  remaining_superrange = used_range[1] + 1, remaining_superrange[1]
119
120
  continue
120
121
  # There is a free range between the beginning of the remaining superrange and the current used range.
@@ -141,6 +141,8 @@ def test_base_abstract_methods():
141
141
  "10.66.255.0/24",
142
142
  253,
143
143
  ),
144
+ ("10.0.0.0/24", [], 32, "10.0.0.0/32", "10.0.0.255/32", 256),
145
+ ("10.0.0.0/24", [], 24, "10.0.0.0/24", "10.0.0.0/24", 1),
144
146
  ],
145
147
  )
146
148
  def test_free_networks(supernet, used_nets, cidr, first_free, last_free, num_subnets):
@@ -153,11 +155,11 @@ def test_free_networks(supernet, used_nets, cidr, first_free, last_free, num_sub
153
155
 
154
156
  @pytest.mark.parametrize(
155
157
  ("subnet", "subnet_range"),
156
- zip(
158
+ list(zip(
157
159
  net_attr(v4_subnets, "ipa") + net_attr(v6_subnets, "ipa"),
158
160
  net_attr(v4_subnets, "range") + net_attr(v6_subnets, "range"),
159
161
  strict=True,
160
- ),
162
+ )),
161
163
  )
162
164
  def test_netrange(subnet, subnet_range):
163
165
  assert tools.netrange(subnet) == subnet_range
File without changes
File without changes
File without changes
File without changes