Skip to content

Commit 6a3b93b

Browse files
authored
fix: make build work with python 3.11 again (#91)
* fix: make build work with python 3.11 again * chore: black (version update) * chore: fix versioning
1 parent 23e859c commit 6a3b93b

File tree

10 files changed

+265
-240
lines changed

10 files changed

+265
-240
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ jobs:
1616
- name: Set up Python
1717
uses: actions/setup-python@v4
1818
with:
19-
python-version: "3.13"
19+
python-version: "3.11"
2020
cache: 'poetry'
2121
- name: Install Dependencies
2222
run: |
2323
pip install --upgrade pip
2424
pip install --upgrade setuptools
25-
poetry env use "3.13"
25+
poetry env use "3.11"
2626
poetry install
2727
- name: Run Lints
2828
run: |

nodestream_akamai/akamai_utils/addresses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Common utils for getting information about addresses."""
2+
23
from enum import StrEnum
34
from ipaddress import IPv4Address, IPv6Address, ip_address
45

nodestream_akamai/akamai_utils/cloudlets_v2_client.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,17 @@ def get_policy_rule_set(self, policy):
109109
policy["policyId"], policy["version"]
110110
)
111111
policy["id"] = f"akamai_redirect:{policy['policyId']}"
112-
policy[
113-
"inbound_hosts"
114-
] = self.search_akamai_ruleset_for_inbound_hosts(raw_ruleset)
115-
policy[
116-
"outbound_hosts"
117-
] = self.search_akamai_ruleset_for_outbound_hosts(raw_ruleset)
118-
policy[
119-
"deeplink"
120-
] = deeplink_prefix + "{p}/versions?gid={g}&shared=false".format(
121-
p=policy["policyId"], g=policy["groupId"]
112+
policy["inbound_hosts"] = (
113+
self.search_akamai_ruleset_for_inbound_hosts(raw_ruleset)
114+
)
115+
policy["outbound_hosts"] = (
116+
self.search_akamai_ruleset_for_outbound_hosts(raw_ruleset)
117+
)
118+
policy["deeplink"] = (
119+
deeplink_prefix
120+
+ "{p}/versions?gid={g}&shared=false".format(
121+
p=policy["policyId"], g=policy["groupId"]
122+
)
122123
)
123124
policy_list.append(policy)
124125
except Exception as e:

nodestream_akamai/edgeworkers/edgeworkers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ async def extract_records(self):
3131
)
3232

3333
# Add deeplink
34-
edgeworker[
35-
"deeplink"
36-
] = f'https://control.akamai.com/apps/edgeworkers/#/ids/{edgeworker["edgeWorkerId"]}/versions'
34+
edgeworker["deeplink"] = (
35+
f'https://control.akamai.com/apps/edgeworkers/#/ids/{edgeworker["edgeWorkerId"]}/versions'
36+
)
3737

3838
if active_version is not None:
3939
edgeworker["activeVersion"] = active_version["version"]

nodestream_akamai/edns/edns.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
import logging
32

43
from nodestream.pipeline.extractors import Extractor
@@ -38,7 +37,7 @@ def _extract_recordset(self, recordset, zone):
3837
recordset[node_type] = node_type_list
3938
return recordset
4039

41-
async def _extract_zone(self, zone):
40+
def _extract_zone(self, zone):
4241
try:
4342
record_sets = self.client.list_recordsets(zone["zone"])
4443
except Exception as e:
@@ -62,5 +61,5 @@ async def extract_records(self):
6261
self.logger.exception("problem fetching zones: %s", e)
6362
raise e
6463

65-
for zone in asyncio.as_completed(self._extract_zone(z) for z in zones):
66-
yield await zone
64+
for zone in zones:
65+
yield self._extract_zone(zone)

nodestream_akamai/iam_clients/iam_clients.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ async def extract_records(self):
1919

2020
for client in clients:
2121
client["authorizedUsersList"] = ",".join(client["authorizedUsers"])
22-
client[
23-
"deeplink"
24-
] = "https://control.akamai.com/apps/identity-management/#/tabs/users/list/api-client/{id}/details".format(
25-
id=client["clientId"]
22+
client["deeplink"] = (
23+
"https://control.akamai.com/apps/identity-management/#/tabs/users/list/api-client/{id}/details".format(
24+
id=client["clientId"]
25+
)
2626
)
2727
if client["activeCredentialCount"] > 0:
2828
try:

nodestream_akamai/siteshield/siteshield.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async def extract_records(self):
2121
deeplink_prefix = (
2222
"https://control.akamai.com/apps/siteshield-ui/#/mapRequest/"
2323
)
24-
siteshield_map[
25-
"deeplink"
26-
] = f'{deeplink_prefix}{siteshield_map["latestTicketId"]}/status'
24+
siteshield_map["deeplink"] = (
25+
f'{deeplink_prefix}{siteshield_map["latestTicketId"]}/status'
26+
)
2727
yield siteshield_map

0 commit comments

Comments
 (0)