Skip to content

Commit

Permalink
Bump required octodns >= 1.5, address pending deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
ross committed Oct 23, 2024
1 parent 766053f commit 526881b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 44 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## v1.0.0 - 2024-??-?? - ???

Noteworthy Changes:

* Complete removal of SPF record support, records should be transitioned to TXT
values before updating to this version.

Changes:

* Address pending octoDNS 2.x deprecations, require minimum of 1.5.x

## v0.0.3 - 2024-03-11 - Format the types

* Fix handling of SRV target trailing dot
Expand Down
3 changes: 0 additions & 3 deletions octodns_dnsimple/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class DnsimpleProvider(BaseProvider):
'NAPTR',
'NS',
'PTR',
'SPF',
'SRV',
'SSHFP',
'TXT',
Expand All @@ -141,7 +140,6 @@ def _data_for_multiple(self, _type, records):

_data_for_A = _data_for_multiple
_data_for_AAAA = _data_for_multiple
_data_for_SPF = _data_for_multiple

def _data_for_TXT(self, _type, records):
return {
Expand Down Expand Up @@ -356,7 +354,6 @@ def _params_for_multiple(self, record):
_params_for_A = _params_for_multiple
_params_for_AAAA = _params_for_multiple
_params_for_NS = _params_for_multiple
_params_for_SPF = _params_for_multiple

def _params_for_TXT(self, record):
for value in record.values:
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ sections="FUTURE,STDLIB,THIRDPARTY,OCTODNS,FIRSTPARTY,LOCALFOLDER"
[tool.pytest.ini_options]
filterwarnings = [
'error',
# TODO: remove once octodns 2.0 has been released
'ignore:.*DEPRECATED.*2.0',
]
pythonpath = "."
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def version():
),
'test': tests_require,
},
install_requires=('octodns>=0.9.14', 'requests>=2.26.0'),
install_requires=('octodns>=1.5.0', 'requests>=2.26.0'),
license='MIT',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
19 changes: 1 addition & 18 deletions tests/config/unit.tests.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
---
? ''
: - geo:
AF:
- 2.2.3.4
- 2.2.3.5
AS-JP:
- 3.2.3.4
- 3.2.3.5
NA-US:
- 4.2.3.4
- 4.2.3.5
NA-US-CA:
- 5.2.3.4
- 5.2.3.5
ttl: 300
: - ttl: 300
type: A
values:
- 1.2.3.4
Expand Down Expand Up @@ -155,10 +142,6 @@ ptr:
ttl: 300
type: PTR
values: [foo.bar.com.]
spf:
ttl: 600
type: SPF
value: v=spf1 ip4:192.168.0.1/16-all
sub:
type: 'NS'
values:
Expand Down
16 changes: 0 additions & 16 deletions tests/fixtures/dnsimple-page-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,6 @@
"created_at": "2017-03-09T15:55:11Z",
"updated_at": "2017-03-09T15:55:11Z"
},
{
"id": 11189900,
"zone_id": "unit.tests",
"parent_id": null,
"name": "spf",
"content": "v=spf1 ip4:192.168.0.1/16-all",
"ttl": 600,
"priority": null,
"type": "SPF",
"regions": [
"global"
],
"system_record": false,
"created_at": "2017-03-09T15:55:11Z",
"updated_at": "2017-03-09T15:55:11Z"
},
{
"id": 11189901,
"zone_id": "unit.tests",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_octodns_provider_dnsimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TestDnsimpleProvider(TestCase):
)
for record in list(expected.records):
if record.name == 'sub' and record._type == 'NS':
expected._remove_record(record)
expected.remove_record(record)
break

def test_list_zones(self):
Expand Down Expand Up @@ -140,14 +140,14 @@ def test_populate(self):

zone = Zone('unit.tests.', [])
provider.populate(zone)
self.assertEqual(16, len(zone.records))
self.assertEqual(15, len(zone.records))
changes = self.expected.changes(zone, provider)
self.assertEqual(0, len(changes))

# 2nd populate makes no network calls/all from cache
again = Zone('unit.tests.', [])
provider.populate(again)
self.assertEqual(16, len(again.records))
self.assertEqual(15, len(again.records))

# bust the cache
del provider._zone_records[zone.name]
Expand Down Expand Up @@ -274,7 +274,7 @@ def test_apply(self):
]
)
# expected number of total calls
self.assertEqual(28, provider._client._request.call_count)
self.assertEqual(27, provider._client._request.call_count)

provider._client._request.reset_mock()

Expand Down

0 comments on commit 526881b

Please sign in to comment.