Skip to content

Commit 76310a4

Browse files
authored
Merge pull request #465 from linode/dev
Release v5.23.0
2 parents e66c812 + 0139b51 commit 76310a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+547
-140
lines changed

.github/workflows/e2e-test.yml

+66
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,69 @@ jobs:
9191
env:
9292
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
9393
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
94+
95+
notify-slack:
96+
runs-on: ubuntu-latest
97+
needs: [integration-tests]
98+
if: always() && github.repository == 'linode/linode_api4-python' # Run even if integration tests fail and only on main repository
99+
100+
steps:
101+
- name: Notify Slack
102+
uses: slackapi/slack-github-action@v1.27.0
103+
with:
104+
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
105+
payload: |
106+
{
107+
"blocks": [
108+
{
109+
"type": "section",
110+
"text": {
111+
"type": "mrkdwn",
112+
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
113+
}
114+
},
115+
{
116+
"type": "divider"
117+
},
118+
{
119+
"type": "section",
120+
"fields": [
121+
{
122+
"type": "mrkdwn",
123+
"text": "*Build Result:*\n${{ needs.integration-tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
124+
},
125+
{
126+
"type": "mrkdwn",
127+
"text": "*Branch:*\n`${{ github.ref_name }}`"
128+
}
129+
]
130+
},
131+
{
132+
"type": "section",
133+
"fields": [
134+
{
135+
"type": "mrkdwn",
136+
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
137+
},
138+
{
139+
"type": "mrkdwn",
140+
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
141+
}
142+
]
143+
},
144+
{
145+
"type": "divider"
146+
},
147+
{
148+
"type": "context",
149+
"elements": [
150+
{
151+
"type": "mrkdwn",
152+
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
153+
}
154+
]
155+
}
156+
]
157+
}
158+
env:
159+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/nightly-smoke-tests.yml

+71
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ on:
44
schedule:
55
- cron: "0 0 * * *"
66
workflow_dispatch:
7+
inputs:
8+
sha:
9+
description: 'Commit SHA to test'
10+
required: false
11+
default: ''
12+
type: string
13+
714

815
jobs:
916
smoke_tests:
17+
if: github.repository == 'linode/linode_api4-python' || github.event_name == 'workflow_dispatch'
1018
runs-on: ubuntu-latest
1119

1220
steps:
@@ -29,7 +37,70 @@ jobs:
2937
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3038

3139
- name: Run smoke tests
40+
id: smoke_tests
3241
run: |
3342
make smoketest
3443
env:
3544
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
45+
46+
- name: Notify Slack
47+
if: always() && github.repository == 'linode/linode_api4-python'
48+
uses: slackapi/slack-github-action@v1.27.0
49+
with:
50+
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
51+
payload: |
52+
{
53+
"blocks": [
54+
{
55+
"type": "section",
56+
"text": {
57+
"type": "mrkdwn",
58+
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
59+
}
60+
},
61+
{
62+
"type": "divider"
63+
},
64+
{
65+
"type": "section",
66+
"fields": [
67+
{
68+
"type": "mrkdwn",
69+
"text": "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
70+
},
71+
{
72+
"type": "mrkdwn",
73+
"text": "*Branch:*\n`${{ github.ref_name }}`"
74+
}
75+
]
76+
},
77+
{
78+
"type": "section",
79+
"fields": [
80+
{
81+
"type": "mrkdwn",
82+
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
83+
},
84+
{
85+
"type": "mrkdwn",
86+
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
87+
}
88+
]
89+
},
90+
{
91+
"type": "divider"
92+
},
93+
{
94+
"type": "context",
95+
"elements": [
96+
{
97+
"type": "mrkdwn",
98+
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
99+
}
100+
]
101+
}
102+
]
103+
}
104+
env:
105+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
106+

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ docs/_build/*
1212
venv
1313
baked_version
1414
.vscode
15+
.DS_Store

.pylintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ confidence=
5050
# --enable=similarities". If you want to run only the classes checker, but have
5151
# no Warning level messages displayed, use"--disable=all --enable=classes
5252
# --disable=W"
53-
disable=consider-using-dict-items,blacklisted-name,invalid-name,missing-docstring,empty-docstring,unneeded-not,singleton-comparison,misplaced-comparison-constant,unidiomatic-typecheck,consider-using-enumerate,consider-iterating-dictionary,bad-classmethod-argument,bad-mcs-method-argument,bad-mcs-classmethod-argument,single-string-used-for-slots,line-too-long,too-many-lines,trailing-whitespace,missing-final-newline,trailing-newlines,multiple-statements,superfluous-parens,bad-whitespace,mixed-line-endings,unexpected-line-ending-format,bad-continuation,wrong-spelling-in-comment,wrong-spelling-in-docstring,invalid-characters-in-docstring,multiple-imports,wrong-import-order,ungrouped-imports,wrong-import-position,old-style-class,len-as-condition,fatal,astroid-error,parse-error,method-check-failed,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,literal-comparison,no-self-use,no-classmethod-decorator,no-staticmethod-decorator,cyclic-import,duplicate-code,too-many-ancestors,too-many-instance-attributes,too-few-public-methods,too-many-public-methods,too-many-return-statements,too-many-branches,too-many-arguments,too-many-locals,too-many-statements,too-many-boolean-expressions,consider-merging-isinstance,too-many-nested-blocks,simplifiable-if-statement,redefined-argument-from-local,no-else-return,consider-using-ternary,trailing-comma-tuple,unreachable,dangerous-default-value,pointless-statement,pointless-string-statement,expression-not-assigned,unnecessary-pass,unnecessary-lambda,duplicate-key,deprecated-lambda,assign-to-new-keyword,useless-else-on-loop,exec-used,eval-used,confusing-with-statement,using-constant-test,lost-exception,assert-on-tuple,attribute-defined-outside-init,bad-staticmethod-argument,protected-access,arguments-differ,signature-differs,abstract-method,super-init-not-called,no-init,non-parent-init-called,useless-super-delegation,unnecessary-semicolon,bad-indentation,mixed-indentation,lowercase-l-suffix,wildcard-import,deprecated-module,relative-import,reimported,import-self,misplaced-future,fixme,invalid-encoded-data,global-variable-undefined,global-variable-not-assigned,global-statement,global-at-module-level,unused-import,unused-variable,unused-argument,unused-wildcard-import,redefined-outer-name,redefined-builtin,redefine-in-handler,undefined-loop-variable,cell-var-from-loop,bare-except,broad-except,duplicate-except,nonstandard-exception,binary-op-exception,property-on-old-class,logging-not-lazy,logging-format-interpolation,bad-format-string-key,unused-format-string-key,bad-format-string,missing-format-argument-key,unused-format-string-argument,format-combined-specification,missing-format-attribute,invalid-format-index,anomalous-backslash-in-string,anomalous-unicode-escape-in-string,bad-open-mode,boolean-datetime,redundant-unittest-assert,deprecated-method,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,useless-object-inheritance,comparison-with-callable,bad-option-value,consider-using-f-string,unspecified-encoding,missing-timeout,unnecessary-dunder-call,no-value-for-parameter,c-extension-no-member,attribute-defined-outside-init,use-a-generator
53+
disable=consider-using-dict-items,blacklisted-name,invalid-name,missing-docstring,empty-docstring,unneeded-not,singleton-comparison,misplaced-comparison-constant,unidiomatic-typecheck,consider-using-enumerate,consider-iterating-dictionary,bad-classmethod-argument,bad-mcs-method-argument,bad-mcs-classmethod-argument,single-string-used-for-slots,line-too-long,too-many-lines,trailing-whitespace,missing-final-newline,trailing-newlines,multiple-statements,superfluous-parens,bad-whitespace,mixed-line-endings,unexpected-line-ending-format,bad-continuation,wrong-spelling-in-comment,wrong-spelling-in-docstring,invalid-characters-in-docstring,multiple-imports,wrong-import-order,ungrouped-imports,wrong-import-position,old-style-class,len-as-condition,fatal,astroid-error,parse-error,method-check-failed,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,literal-comparison,no-self-use,no-classmethod-decorator,no-staticmethod-decorator,cyclic-import,duplicate-code,too-many-ancestors,too-many-instance-attributes,too-few-public-methods,too-many-public-methods,too-many-return-statements,too-many-branches,too-many-arguments,too-many-locals,too-many-statements,too-many-boolean-expressions,consider-merging-isinstance,too-many-nested-blocks,simplifiable-if-statement,redefined-argument-from-local,no-else-return,consider-using-ternary,trailing-comma-tuple,unreachable,dangerous-default-value,pointless-statement,pointless-string-statement,expression-not-assigned,unnecessary-pass,unnecessary-lambda,duplicate-key,deprecated-lambda,assign-to-new-keyword,useless-else-on-loop,exec-used,eval-used,confusing-with-statement,using-constant-test,lost-exception,assert-on-tuple,attribute-defined-outside-init,bad-staticmethod-argument,protected-access,arguments-differ,signature-differs,abstract-method,super-init-not-called,no-init,non-parent-init-called,useless-super-delegation,unnecessary-semicolon,bad-indentation,mixed-indentation,lowercase-l-suffix,wildcard-import,deprecated-module,relative-import,reimported,import-self,misplaced-future,fixme,invalid-encoded-data,global-variable-undefined,global-variable-not-assigned,global-statement,global-at-module-level,unused-import,unused-variable,unused-argument,unused-wildcard-import,redefined-outer-name,redefined-builtin,redefine-in-handler,undefined-loop-variable,cell-var-from-loop,bare-except,broad-except,duplicate-except,nonstandard-exception,binary-op-exception,property-on-old-class,logging-not-lazy,logging-format-interpolation,bad-format-string-key,unused-format-string-key,bad-format-string,missing-format-argument-key,unused-format-string-argument,format-combined-specification,missing-format-attribute,invalid-format-index,anomalous-backslash-in-string,anomalous-unicode-escape-in-string,bad-open-mode,boolean-datetime,redundant-unittest-assert,deprecated-method,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,useless-object-inheritance,comparison-with-callable,bad-option-value,consider-using-f-string,unspecified-encoding,missing-timeout,unnecessary-dunder-call,no-value-for-parameter,c-extension-no-member,attribute-defined-outside-init,use-a-generator,too-many-positional-arguments
5454

5555
# Enable the message, report, category or checker with the given id(s). You can
5656
# either give multiple identifier separated by comma (,) or put this option

linode_api4/groups/image.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def __call__(self, *filters):
3232
def create(
3333
self,
3434
disk: Union[Disk, int],
35-
label: str = None,
36-
description: str = None,
35+
label: Optional[str] = None,
36+
description: Optional[str] = None,
3737
cloud_init: bool = False,
3838
tags: Optional[List[str]] = None,
3939
):
@@ -82,7 +82,7 @@ def create_upload(
8282
self,
8383
label: str,
8484
region: str,
85-
description: str = None,
85+
description: Optional[str] = None,
8686
cloud_init: bool = False,
8787
tags: Optional[List[str]] = None,
8888
) -> Tuple[Image, str]:
@@ -132,7 +132,7 @@ def upload(
132132
label: str,
133133
region: str,
134134
file: BinaryIO,
135-
description: str = None,
135+
description: Optional[str] = None,
136136
tags: Optional[List[str]] = None,
137137
) -> Image:
138138
"""

linode_api4/groups/polling.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Optional
2+
13
import polling
24

35
from linode_api4.groups import Group
@@ -13,7 +15,7 @@ def event_poller_create(
1315
self,
1416
entity_type: str,
1517
action: str,
16-
entity_id: int = None,
18+
entity_id: Optional[int] = None,
1719
) -> EventPoller:
1820
"""
1921
Creates a new instance of the EventPoller class.

linode_api4/groups/volume.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ def create(self, label, region=None, linode=None, size=20, **kwargs):
4545
tags included do not exist, they will be created as part of
4646
this operation.
4747
:type tags: list[str]
48-
48+
:param encryption: Whether the new Volume should opt in or out of disk encryption.
49+
:type encryption: str
50+
Note: Block Storage Disk Encryption is not currently available to all users.
4951
:returns: The new Volume.
5052
:rtype: Volume
5153
"""

linode_api4/linode_client.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import json
44
import logging
55
from importlib.metadata import version
6-
from typing import BinaryIO, List, Tuple
6+
from typing import BinaryIO, List, Optional, Tuple
77
from urllib import parse
88

99
import requests
@@ -391,8 +391,8 @@ def image_create_upload(
391391
self,
392392
label: str,
393393
region: str,
394-
description: str = None,
395-
tags: List[str] = None,
394+
description: Optional[str] = None,
395+
tags: Optional[List[str]] = None,
396396
) -> Tuple[Image, str]:
397397
"""
398398
.. note:: This method is an alias to maintain backwards compatibility.
@@ -409,8 +409,8 @@ def image_upload(
409409
label: str,
410410
region: str,
411411
file: BinaryIO,
412-
description: str = None,
413-
tags: List[str] = None,
412+
description: Optional[str] = None,
413+
tags: Optional[List[str]] = None,
414414
) -> Image:
415415
"""
416416
.. note:: This method is an alias to maintain backwards compatibility.

0 commit comments

Comments
 (0)