Skip to content

Commit 15c235b

Browse files
v5.13.0 (#374)
1 parent 981831e commit 15c235b

File tree

18 files changed

+237
-212
lines changed

18 files changed

+237
-212
lines changed

.github/workflows/e2e-test-pr.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
# Check out merge commit
3434
- name: Checkout PR
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3636
with:
3737
ref: ${{ inputs.sha }}
3838
fetch-depth: 0
@@ -63,22 +63,16 @@ jobs:
6363
env:
6464
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6565

66-
- name: Update system packages
67-
run: sudo apt-get update -y
68-
69-
- name: Install system deps
70-
run: sudo apt-get install -y build-essential
71-
7266
- name: Setup Python
73-
uses: actions/setup-python@v4
67+
uses: actions/setup-python@v5
7468
with:
7569
python-version: '3.x'
7670

7771
- name: Install Python deps
78-
run: pip install -r requirements.txt -r requirements-dev.txt wheel boto3
72+
run: pip install -U setuptools wheel boto3 certifi
7973

8074
- name: Install Python SDK
81-
run: make install
75+
run: make dev-install
8276
env:
8377
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8478

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: checkout repo
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: setup python 3
16-
uses: actions/setup-python@v4
16+
uses: actions/setup-python@v5
1717
with:
1818
python-version: '3.x'
1919

2020
- name: install dependencies
21-
run: make requirements
21+
run: make dev-install
2222

2323
- name: run linter
2424
run: make lint

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ['3.8','3.9','3.10','3.11']
17+
python-version: ['3.8','3.9','3.10','3.11', '3.12']
1818
steps:
19-
- uses: actions/checkout@v3
20-
- uses: actions/setup-python@v4
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
- name: Run tests
2424
run: |
25-
pip install .[test]
25+
pip install ".[test]"
2626
tox

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ jobs:
1111

1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515
with:
1616
ref: dev
1717

1818
- name: Set up Python
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: '3.x'
2222

2323
- name: Install Python deps
24-
run: pip install -r requirements.txt -r requirements-dev.txt wheel boto3
24+
run: pip install -U setuptools wheel boto3 certifi
2525

2626
- name: Install Python SDK
27-
run: make install
27+
run: make dev-install
2828
env:
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030

.github/workflows/publish-pypi.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v3
12-
13-
- name: Update system packages
14-
run: sudo apt-get update -y
15-
16-
- name: Install make
17-
run: sudo apt-get install -y build-essential
11+
uses: actions/checkout@v4
1812

1913
- name: Setup Python
20-
uses: actions/setup-python@v4
14+
uses: actions/setup-python@v5
2115
with:
2216
python-version: '3.x'
2317

@@ -30,6 +24,6 @@ jobs:
3024
LINODE_SDK_VERSION: ${{ github.event.release.tag_name }}
3125

3226
- name: Publish the release artifacts to PyPI
33-
uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598 # pin@release/v1.8.6
27+
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # pin@release/v1.8.11
3428
with:
3529
password: ${{ secrets.PYPI_API_TOKEN }}

Makefile

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ INTEGRATION_TEST_PATH :=
44
TEST_CASE_COMMAND :=
55
MODEL_COMMAND :=
66

7+
LINODE_SDK_VERSION ?= "0.0.0.dev"
8+
VERSION_MODULE_DOCSTRING ?= \"\"\"\nThe version of this linode_api4 package.\n\"\"\"\n\n
9+
VERSION_FILE := ./linode_api4/version.py
10+
711
ifdef TEST_CASE
812
TEST_CASE_COMMAND = -k $(TEST_CASE)
913
endif
@@ -12,60 +16,63 @@ ifdef TEST_MODEL
1216
MODEL_COMMAND = models/$(TEST_MODEL)
1317
endif
1418

15-
@PHONEY: clean
19+
.PHONY: clean
1620
clean:
1721
mkdir -p dist
1822
rm -r dist
1923
rm -f baked_version
2024

21-
@PHONEY: build
22-
build: clean
25+
.PHONY: build
26+
build: clean create-version
2327
$(PYTHON) -m build --wheel --sdist
2428

29+
.PHONY: create-version
30+
create-version:
31+
@printf "${VERSION_MODULE_DOCSTRING}__version__ = \"${LINODE_SDK_VERSION}\"\n" > $(VERSION_FILE)
2532

26-
@PHONEY: release
33+
.PHONY: release
2734
release: build
2835
$(PYTHON) -m twine upload dist/*
2936

30-
@PHONEY: install
31-
install: clean requirements
32-
$(PYTHON) -m pip install .
37+
.PHONY: dev-install
38+
dev-install: clean
39+
$(PYTHON) -m pip install -e ".[dev]"
3340

34-
@PHONEY: requirements
35-
requirements:
36-
$(PYTHON) -m pip install -r requirements.txt -r requirements-dev.txt
41+
.PHONY: install
42+
install: clean create-version
43+
$(PYTHON) -m pip install .
3744

38-
@PHONEY: black
45+
.PHONY: black
3946
black:
4047
$(PYTHON) -m black linode_api4 test
4148

42-
@PHONEY: isort
49+
.PHONY: isort
4350
isort:
4451
$(PYTHON) -m isort linode_api4 test
4552

46-
@PHONEY: autoflake
53+
.PHONY: autoflake
4754
autoflake:
4855
$(PYTHON) -m autoflake linode_api4 test
4956

50-
@PHONEY: format
57+
.PHONY: format
5158
format: black isort autoflake
5259

53-
@PHONEY: lint
60+
.PHONY: lint
5461
lint: build
5562
$(PYTHON) -m isort --check-only linode_api4 test
5663
$(PYTHON) -m autoflake --check linode_api4 test
5764
$(PYTHON) -m black --check --verbose linode_api4 test
5865
$(PYTHON) -m pylint linode_api4
5966
$(PYTHON) -m twine check dist/*
6067

61-
@PHONEY: testint
68+
.PHONY: testint
6269
testint:
6370
$(PYTHON) -m pytest test/integration/${INTEGRATION_TEST_PATH}${MODEL_COMMAND} ${TEST_CASE_COMMAND}
6471

65-
@PHONEY: testunit
72+
.PHONY: testunit
6673
testunit:
6774
$(PYTHON) -m pytest test/unit
6875

69-
@PHONEY: smoketest
76+
.PHONY: smoketest
7077
smoketest:
7178
$(PYTHON) -m pytest -m smoke test/integration --disable-warnings

linode_api4/groups/linode.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ def instance_create(
265265
:type metadata: dict
266266
:param firewall: The firewall to attach this Linode to.
267267
:type firewall: int or Firewall
268+
:param interfaces: An array of Network Interfaces to add to this Linode’s Configuration Profile.
269+
At least one and up to three Interface objects can exist in this array.
270+
:type interfaces: list[ConfigInterface] or list[dict[str, Any]]
268271
269272
:returns: A new Instance object, or a tuple containing the new Instance and
270273
the generated password.
@@ -303,6 +306,12 @@ def instance_create(
303306
fw = kwargs.pop("firewall")
304307
kwargs["firewall_id"] = fw.id if isinstance(fw, Firewall) else fw
305308

309+
if "interfaces" in kwargs:
310+
kwargs["interfaces"] = [
311+
i._serialize() if isinstance(i, ConfigInterface) else i
312+
for i in kwargs["interfaces"]
313+
]
314+
306315
params = {
307316
"type": ltype.id if issubclass(type(ltype), Base) else ltype,
308317
"region": region.id if issubclass(type(region), Base) else region,

linode_api4/objects/nodebalancer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class NodeBalancer(Base):
217217
"region": Property(slug_relationship=Region),
218218
"configs": Property(derived_class=NodeBalancerConfig),
219219
"transfer": Property(),
220-
"tags": Property(),
220+
"tags": Property(mutable=True),
221221
}
222222

223223
# create derived objects

linode_api4/version.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""
2+
The version of this linode_api4 package.
3+
"""
4+
5+
__version__ = "0.0.0.dev"

pyproject.toml

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,71 @@
11
[build-system]
2-
requires = ["setuptools"]
2+
requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5+
6+
[project]
7+
name = "linode_api4"
8+
authors = [{ name = "Linode", email = "developers@linode.com" }]
9+
description = "The official Python SDK for Linode API v4"
10+
readme = "README.rst"
11+
requires-python = ">=3.8"
12+
keywords = [
13+
"akamai",
14+
"Akamai Connected Cloud",
15+
"linode",
16+
"cloud",
17+
"SDK",
18+
"Linode APIv4",
19+
]
20+
license = { text = "BSD-3-Clause" }
21+
classifiers = [
22+
"Development Status :: 5 - Production/Stable",
23+
"Intended Audience :: Developers",
24+
"Topic :: Software Development :: Libraries",
25+
"License :: OSI Approved :: BSD License",
26+
"Programming Language :: Python",
27+
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3.8",
29+
"Programming Language :: Python :: 3.9",
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
]
34+
dependencies = ["requests", "polling"]
35+
dynamic = ["version"]
36+
37+
[project.optional-dependencies]
38+
test = ["tox>=4.4.0"]
39+
40+
dev = [
41+
"tox>=4.4.0",
42+
"mock>=5.0.0",
43+
"pytest>=7.3.1",
44+
"httpretty>=1.1.4",
45+
"black>=23.1.0",
46+
"isort>=5.12.0",
47+
"autoflake>=2.0.1",
48+
"pylint",
49+
"twine>=4.0.2",
50+
"build>=0.10.0",
51+
"Sphinx>=6.0.0",
52+
"sphinx-autobuild>=2021.3.14",
53+
"sphinxcontrib-fulltoc>=1.2.0",
54+
"build>=0.10.0",
55+
"twine>=4.0.2",
56+
]
57+
58+
[project.urls]
59+
Homepage = "https://github.com/linode/linode_api4-python"
60+
Documentation = "https://linode-api4.readthedocs.io/"
61+
Repository = "https://github.com/linode/linode_api4-python.git"
62+
63+
[tool.setuptools.dynamic]
64+
version = { attr = "linode_api4.version.__version__" }
65+
66+
[tool.setuptools.packages.find]
67+
exclude = ['contrib', 'docs', 'test', 'test.*']
68+
569
[tool.isort]
670
profile = "black"
771
line_length = 80

requirements-dev.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)