Skip to content

Commit 965e8ff

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-5
2 parents e62d075 + 3f80367 commit 965e8ff

Some content is hidden

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

47 files changed

+4517
-259
lines changed

.github/workflows/checks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ jobs:
4141
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
4242
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
4343
SCW_DEFAULT_REGION: ${{ secrets.SCW_DEFAULT_REGION }}
44-
run: poetry run python -m unittest discover -s tests -v
44+
REPLAY_CASSETTES: true
45+
run: poetry run pytest -v
4546

.github/workflows/nightly.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Nightly Tests
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
6+
permissions:
7+
actions: read
8+
9+
jobs:
10+
nightly:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python: [ '3.10' ,'3.11', '3.12', '3.13' ]
15+
products:
16+
- instance
17+
- k8s
18+
- vpc
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python }}
26+
cache: "poetry"
27+
- name: Install dependencies and library
28+
run: poetry install
29+
- name: Run Tests
30+
run: poetry run pytest -v ./internal/namespaces/${{ matrix.products }}/tests/... -timeout=4h
31+
env:
32+
PYTHON_UPDATE_CASSETTES: true
33+
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
34+
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
35+
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
36+
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
37+
- name: Ping on failure
38+
if: ${{ failure() }}
39+
run: |
40+
curl -X POST -H 'Content-type: application/json' \
41+
--data '{
42+
"blocks": [
43+
{
44+
"type": "section",
45+
"text": {
46+
"type": "mrkdwn",
47+
"text": "'"Scaleway SDK Python Nightly workflow failed: <https://github.com/scaleway/scaleway-sdk-python/actions/runs/${GITHUB_RUN_ID}|${FAILED_PRODUCT}>"'"
48+
}
49+
}
50+
]
51+
}' \
52+
${SLACK_WEBHOOK_NIGHTLY};
53+
env:
54+
SLACK_WEBHOOK_NIGHTLY: ${{ secrets.SLACK_WEBHOOK_NIGHTLY }}
55+
FAILED_PRODUCT: "${{ matrix.products }}"

scaleway-async/poetry.lock

Lines changed: 114 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scaleway-async/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ ruff = ">=0.5.0,<0.12.9"
3232
mypy = "^1.5.1"
3333
ty = "^0.0.1a15"
3434
pyrefly = ">=0.24.2,<0.27.0"
35+
pytest = "^8.4.1"
3536

3637
[build-system]
3738
requires = ["poetry-core"]

scaleway-async/scaleway_async/audit_trail/v1alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .types import BaremetalServerInfo
1010
from .types import BaremetalSettingInfo
1111
from .types import InstanceServerInfo
12+
from .types import IpamIpInfo
1213
from .types import KeyManagerKeyInfo
1314
from .types import KubernetesACLInfo
1415
from .types import KubernetesClusterInfo
@@ -38,6 +39,7 @@
3839
"BaremetalServerInfo",
3940
"BaremetalSettingInfo",
4041
"InstanceServerInfo",
42+
"IpamIpInfo",
4143
"KeyManagerKeyInfo",
4244
"KubernetesACLInfo",
4345
"KubernetesClusterInfo",

scaleway-async/scaleway_async/audit_trail/v1alpha1/marshalling.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
BaremetalServerInfo,
1313
BaremetalSettingInfo,
1414
InstanceServerInfo,
15+
IpamIpInfo,
1516
KeyManagerKeyInfo,
1617
KubernetesACLInfo,
1718
KubernetesClusterInfo,
@@ -161,6 +162,23 @@ def unmarshal_InstanceServerInfo(data: Any) -> InstanceServerInfo:
161162
return InstanceServerInfo(**args)
162163

163164

165+
def unmarshal_IpamIpInfo(data: Any) -> IpamIpInfo:
166+
if not isinstance(data, dict):
167+
raise TypeError(
168+
"Unmarshalling the type 'IpamIpInfo' failed as data isn't a dictionary."
169+
)
170+
171+
args: Dict[str, Any] = {}
172+
173+
field = data.get("address", None)
174+
if field is not None:
175+
args["address"] = field
176+
else:
177+
args["address"] = None
178+
179+
return IpamIpInfo(**args)
180+
181+
164182
def unmarshal_KeyManagerKeyInfo(data: Any) -> KeyManagerKeyInfo:
165183
if not isinstance(data, dict):
166184
raise TypeError(
@@ -466,6 +484,12 @@ def unmarshal_Resource(data: Any) -> Resource:
466484
else:
467485
args["baremetal_setting_info"] = None
468486

487+
field = data.get("ipam_ip_info", None)
488+
if field is not None:
489+
args["ipam_ip_info"] = unmarshal_IpamIpInfo(field)
490+
else:
491+
args["ipam_ip_info"] = None
492+
469493
return Resource(**args)
470494

471495

scaleway-async/scaleway_async/audit_trail/v1alpha1/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
4646
ACCOUNT_ORGANIZATION = "account_organization"
4747
ACCOUNT_PROJECT = "account_project"
4848
INSTANCE_SERVER = "instance_server"
49+
INSTANCE_PLACEMENT_GROUP = "instance_placement_group"
50+
INSTANCE_SECURITY_GROUP = "instance_security_group"
4951
APPLE_SILICON_SERVER = "apple_silicon_server"
5052
BAREMETAL_SERVER = "baremetal_server"
5153
BAREMETAL_SETTING = "baremetal_setting"
54+
IPAM_IP = "ipam_ip"
5255

5356
def __str__(self) -> str:
5457
return str(self.value)
@@ -92,6 +95,11 @@ class InstanceServerInfo:
9295
name: str
9396

9497

98+
@dataclass
99+
class IpamIpInfo:
100+
address: str
101+
102+
95103
@dataclass
96104
class KeyManagerKeyInfo:
97105
pass
@@ -182,6 +190,8 @@ class Resource:
182190

183191
baremetal_setting_info: Optional[BaremetalSettingInfo] = None
184192

193+
ipam_ip_info: Optional[IpamIpInfo] = None
194+
185195

186196
@dataclass
187197
class ProductService:

scaleway-async/scaleway_async/qaas/v1alpha1/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ async def create_session(
794794
deduplication_id: Optional[str] = None,
795795
booking_demand: Optional[CreateSessionRequestBookingDemand] = None,
796796
model_id: Optional[str] = None,
797+
parameters: Optional[str] = None,
797798
) -> Session:
798799
"""
799800
Create a session.
@@ -807,6 +808,7 @@ async def create_session(
807808
:param deduplication_id: Deduplication ID of the session.
808809
:param booking_demand: A booking demand to schedule the session, only applicable if the platform is bookable.
809810
:param model_id: Default computation model ID to be executed by job assigned to this session.
811+
:param parameters: Optional platform configuration parameters applied to this session.
810812
:return: :class:`Session <Session>`
811813
812814
Usage:
@@ -831,6 +833,7 @@ async def create_session(
831833
deduplication_id=deduplication_id,
832834
booking_demand=booking_demand,
833835
model_id=model_id,
836+
parameters=parameters,
834837
),
835838
self.client,
836839
),

scaleway-async/scaleway_async/qaas/v1alpha1/marshalling.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,12 @@ def unmarshal_Session(data: Any) -> Session:
752752
else:
753753
args["model_id"] = None
754754

755+
field = data.get("parameters", None)
756+
if field is not None:
757+
args["parameters"] = field
758+
else:
759+
args["parameters"] = None
760+
755761
return Session(**args)
756762

757763

@@ -1221,6 +1227,9 @@ def marshal_CreateSessionRequest(
12211227
if request.model_id is not None:
12221228
output["model_id"] = request.model_id
12231229

1230+
if request.parameters is not None:
1231+
output["parameters"] = request.parameters
1232+
12241233
return output
12251234

12261235

0 commit comments

Comments
 (0)