Skip to content

Commit d414904

Browse files
rbell517spanglerco
andauthored
feat: Rev minimum python version to 3.10 and add python 3.14 (#168)
Co-authored-by: Paul Spangler <[email protected]>
1 parent 1371857 commit d414904

File tree

149 files changed

+1851
-1799
lines changed

Some content is hidden

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

149 files changed

+1851
-1799
lines changed

.flake8

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@ max-line-length = 119
44
# but keep line length to 88 in general
55
# - use "black" to auto-format
66

7+
# D400 and D205 are because we sometimes split the first line of the docstring
8+
# F821 is temporary, until code is complete and stuff like ObjectDisposedException is gone
79
ignore =
8-
# D400 and D205 are because we sometimes split the first line of the docstring
9-
*.py E203, W503, D100,D101,D102,D105,D106,D107, D400,D205, D415
10-
# temporary, until code is complete and stuff like ObjectDisposedException is gone:
11-
*.py F821
10+
E203,
11+
W503,
12+
D100,
13+
D101,
14+
D102,
15+
D105,
16+
D106,
17+
D107,
18+
D400,
19+
D205,
20+
D415,
21+
F821
1222

1323
# Config for flake8-docstrings
1424
docstring-convention = google

.github/workflows/python-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
14+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Install poetry
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: ubuntu-latest
3030
strategy:
3131
matrix:
32-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
32+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
3333
# Do not run in parallel to limit parallel integration tests stomping on each other
3434
max-parallel: 1
3535
steps:
@@ -59,7 +59,7 @@ jobs:
5959
run: pipx install poetry
6060
- uses: actions/setup-python@v4
6161
with:
62-
python-version: 3.9
62+
python-version: 3.10
6363
cache: "poetry"
6464
- run: poetry install
6565
- name: Semantic release

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ version: 2
77

88
# Set the version of Python and other tools you might need
99
build:
10-
os: ubuntu-20.04
10+
os: ubuntu-lts-latest
1111
tools:
12-
python: "3.9"
12+
python: "3.10"
1313

1414
# Build documentation in the docs/ directory with Sphinx
1515
sphinx:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ To contribute to this project, it is recommended that you follow these steps:
3737

3838
## Testing
3939

40-
Before running any tests, you must have a supported version of Python (3.9+) and [Poetry](https://python-poetry.org/docs/) installed locally.
40+
Before running any tests, you must have a supported version of Python (3.10+) and [Poetry](https://python-poetry.org/docs/) installed locally.
4141

4242
It is also helpful to install SystemLink Server and configure the NI Web Server
4343
to run on localhost.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Requirements
1818
**nisystemlink-clients** has the following requirements:
1919

2020
* Access to a SystemLink Server or SystemLink Enterprise installation
21-
* CPython 3.9+
21+
* CPython 3.10+
2222

2323
.. _installation_section:
2424

nisystemlink/clients/artifact/_artifact_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Implementation of ArtifactClient"""
22

3-
from typing import BinaryIO, Optional
3+
from typing import BinaryIO
44

55
from nisystemlink.clients import core
66
from nisystemlink.clients.core._uplink._base_client import BaseClient
@@ -18,7 +18,7 @@
1818

1919

2020
class ArtifactClient(BaseClient):
21-
def __init__(self, configuration: Optional[core.HttpConfiguration] = None):
21+
def __init__(self, configuration: core.HttpConfiguration | None = None):
2222
"""Initialize an instance.
2323
2424
Args:

nisystemlink/clients/assetmanagement/_asset_management_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Implementation of AssetManagementClient."""
22

3-
from typing import List, Optional
3+
from typing import List
44

55
from nisystemlink.clients import core
66
from nisystemlink.clients.core._http_configuration import HttpConfiguration
@@ -17,7 +17,7 @@
1717
on_exception=retry.CONNECTION_ERROR,
1818
)
1919
class AssetManagementClient(BaseClient):
20-
def __init__(self, configuration: Optional[HttpConfiguration] = None):
20+
def __init__(self, configuration: HttpConfiguration | None = None):
2121
"""Initialize an instance.
2222
2323
Args:
@@ -126,7 +126,7 @@ def delete_assets(self, ids: List[str]) -> models.DeleteAssetsResponse:
126126
@post("assets/{assetId}/file", args=[Path("assetId"), Field("fileIds")])
127127
def link_files(
128128
self, asset_id: str, file_ids: List[str]
129-
) -> Optional[models.LinkFilesPartialSuccessResponse]:
129+
) -> models.LinkFilesPartialSuccessResponse | None:
130130
"""Link files to an asset.
131131
132132
Args:
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from datetime import datetime
2-
from typing import Dict, List, Optional
2+
from typing import Dict, List
33

44
from nisystemlink.clients.core._uplink._json_model import JsonModel
55
from pydantic import Field
@@ -17,98 +17,98 @@
1717
class Asset(JsonModel):
1818
"""Model for an object describing an asset with all of its properties."""
1919

20-
model_name: Optional[str] = None
20+
model_name: str | None = None
2121
"""Gets or sets model name of the asset."""
2222

23-
model_number: Optional[int] = None
23+
model_number: int | None = None
2424
"""Gets or sets model number of the asset."""
2525

26-
serial_number: Optional[str] = None
26+
serial_number: str | None = None
2727
"""Gets or sets serial number of the asset."""
2828

29-
vendor_name: Optional[str] = None
29+
vendor_name: str | None = None
3030
"""Gets or sets vendor name of the asset."""
3131

32-
vendor_number: Optional[int] = None
32+
vendor_number: int | None = None
3333
"""Gets or sets vendor number of the asset."""
3434

35-
bus_type: Optional[AssetBusType] = None
35+
bus_type: AssetBusType | None = None
3636
"""Gets or sets all supported bus types for an asset."""
3737

38-
name: Optional[str] = None
38+
name: str | None = None
3939
"""Gets or sets name of the asset."""
4040

41-
asset_type: Optional[AssetType] = None
41+
asset_type: AssetType | None = None
4242
"""Gets or sets all supported asset types."""
4343

44-
discovery_type: Optional[AssetDiscoveryType] = None
44+
discovery_type: AssetDiscoveryType | None = None
4545
"""Gets or sets the discovery type."""
4646

47-
firmware_version: Optional[str] = None
47+
firmware_version: str | None = None
4848
"""Gets or sets firmware version of the asset."""
4949

50-
hardware_version: Optional[str] = None
50+
hardware_version: str | None = None
5151
"""Gets or sets hardware version of the asset."""
5252

53-
visa_resource_name: Optional[str] = None
53+
visa_resource_name: str | None = None
5454
"""Gets or sets VISA resource name of the asset."""
5555

56-
temperature_sensors: Optional[List[TemperatureSensor]] = None
56+
temperature_sensors: List[TemperatureSensor] | None = None
5757
"""Gets or sets an array of temperature sensor information."""
5858

59-
supports_self_calibration: Optional[bool] = None
59+
supports_self_calibration: bool | None = None
6060
"""Gets or sets whether the asset supports self-calibration."""
6161

62-
supports_external_calibration: Optional[bool] = None
62+
supports_external_calibration: bool | None = None
6363
"""Gets or sets whether the asset supports external calibration."""
6464

65-
custom_calibration_interval: Optional[int] = None
65+
custom_calibration_interval: int | None = None
6666
"""Gets or sets the interval represented in months used for computing calibration due date."""
6767

68-
self_calibration: Optional[SelfCalibration] = None
68+
self_calibration: SelfCalibration | None = None
6969
"""Gets or sets the last self-calibration of the asset."""
7070

71-
is_NI_asset: Optional[bool] = Field(alias="isNIAsset", default=None)
71+
is_NI_asset: bool | None = Field(alias="isNIAsset", default=None)
7272
"""Gets or sets whether this asset is an NI asset (true) or a third-party asset (false)."""
7373

74-
id: Optional[str] = None
74+
id: str | None = None
7575
"""Gets or sets unique identifier of the asset."""
7676

77-
location: Optional[AssetLocation] = None
77+
location: AssetLocation | None = None
7878
"""Model for information about the asset location, presence and the connection status of the system"""
7979

80-
calibration_status: Optional[CalibrationStatus] = None
80+
calibration_status: CalibrationStatus | None = None
8181
"""Gets or sets the calibration category the asset belongs to based on the next due calibration date."""
8282

83-
is_system_controller: Optional[bool] = None
83+
is_system_controller: bool | None = None
8484
"""Gets or sets whether this asset represents a System Controller."""
8585

86-
external_calibration: Optional[ExternalCalibration] = None
86+
external_calibration: ExternalCalibration | None = None
8787
"""Gets or sets the last external calibration of the asset."""
8888

89-
workspace: Optional[str] = None
89+
workspace: str | None = None
9090
"""Gets or sets the ID of the workspace."""
9191

92-
properties: Optional[Dict[str, str]] = None
92+
properties: Dict[str, str] | None = None
9393
""" Gets or sets key-value-pair metadata associated with an asset."""
9494

95-
keywords: Optional[List[str]] = None
95+
keywords: List[str] | None = None
9696
"""Gets or sets words or phrases associated with an asset."""
9797

98-
last_updated_timestamp: Optional[datetime] = None
98+
last_updated_timestamp: datetime | None = None
9999
"""Gets or sets ISO-8601 formatted timestamp specifying the last date that the asset has had a property update."""
100100

101-
file_ids: Optional[List[str]] = None
101+
file_ids: List[str] | None = None
102102
"""Gets or sets all files linked to the asset."""
103103

104-
supports_self_test: Optional[bool] = None
104+
supports_self_test: bool | None = None
105105
"""Gets or sets whether the asset supports self-test."""
106106

107-
supports_reset: Optional[bool] = None
107+
supports_reset: bool | None = None
108108
"""Gets or sets whether the asset supports reset."""
109109

110-
part_number: Optional[str] = None
110+
part_number: str | None = None
111111
"""Gets or sets part number of the asset."""
112112

113-
out_for_calibration: Optional[bool] = None
113+
out_for_calibration: bool | None = None
114114
"""Get or set whether the asset is out for calibration."""

nisystemlink/clients/assetmanagement/models/_asset_calibration.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from datetime import datetime
44
from enum import Enum
5-
from typing import List, Optional
5+
from typing import List
66

77
from nisystemlink.clients.core._uplink._json_model import JsonModel
88

@@ -19,18 +19,18 @@ class CalibrationStatus(Enum):
1919
class TemperatureSensor(JsonModel):
2020
"""Temperature sensor information."""
2121

22-
name: Optional[str] = None
22+
name: str | None = None
2323
"""Gets or sets sensor name."""
2424

2525
reading: float
2626
"""Gets or sets sensor reading."""
2727

2828

2929
class SelfCalibration(JsonModel):
30-
temperature_sensors: Optional[List[TemperatureSensor]] = None
30+
temperature_sensors: List[TemperatureSensor] | None = None
3131
"""Gets or sets an array of temperature sensor information."""
3232

33-
is_limited: Optional[bool] = None
33+
is_limited: bool | None = None
3434
"""Gets or sets whether the last self-calibration of the asset was a limited calibration."""
3535

3636
date: datetime
@@ -45,10 +45,10 @@ class CalibrationMode(Enum):
4545

4646

4747
class ExternalCalibration(JsonModel):
48-
temperature_sensors: Optional[List[TemperatureSensor]] = None
48+
temperature_sensors: List[TemperatureSensor] | None = None
4949
"""Gets or sets an array of temperature sensor information."""
5050

51-
is_limited: Optional[bool] = None
51+
is_limited: bool | None = None
5252
"""Gets or sets whether the last external calibration of the asset was a limited calibration."""
5353

5454
date: datetime
@@ -60,14 +60,14 @@ class ExternalCalibration(JsonModel):
6060
next_recommended_date: datetime
6161
"""Gets or sets ISO-8601 formatted timestamp specifying the recommended date for the next external calibration."""
6262

63-
next_custom_due_date: Optional[datetime] = None
63+
next_custom_due_date: datetime | None = None
6464
"""Gets or sets ISO-8601 formatted timestamp specifying the date for the next external calibration."""
6565

66-
resolved_due_date: Optional[datetime] = None
66+
resolved_due_date: datetime | None = None
6767
"""Gets ISO-8601 formatted timestamp specifying the resolved due date for external calibration."""
6868

69-
comments: Optional[str] = None
69+
comments: str | None = None
7070
"""Gets or sets calibration comments provided by an operator."""
7171

72-
entry_type: Optional[CalibrationMode] = None
72+
entry_type: CalibrationMode | None = None
7373
"""Gets or sets whether automatically discovered the calibration data for an asset or manually entered."""

nisystemlink/clients/assetmanagement/models/_asset_location.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from enum import Enum
2-
from typing import Optional
32

43
from nisystemlink.clients.core._uplink._json_model import JsonModel
54

@@ -36,7 +35,7 @@ class AssetPresenceWithSystemConnection(JsonModel):
3635
asset_presence: AssetPresenceStatus
3736
"""Gets or sets the status of an asset's presence in a system."""
3837

39-
system_connection: Optional[SystemConnection] = None
38+
system_connection: SystemConnection | None = None
4039
"""Gets or sets whether or not the minion is connected to the server and has updated the server with its data."""
4140

4241

@@ -50,19 +49,19 @@ class AssetPresence(JsonModel):
5049
class _AssetLocation(JsonModel):
5150
"""local model for information about the asset location, presence and the connection status of the system."""
5251

53-
minion_id: Optional[str] = None
52+
minion_id: str | None = None
5453
"""Gets or sets identifier of the minion where the asset is located."""
5554

56-
physical_location: Optional[str] = None
55+
physical_location: str | None = None
5756
"""Gets or sets the physical location of the asset."""
5857

59-
parent: Optional[str] = None
58+
parent: str | None = None
6059
"""Gets or sets the parent of the asset."""
6160

62-
resource_uri: Optional[str] = None
61+
resource_uri: str | None = None
6362
"""Gets or sets identifier of a resource."""
6463

65-
slot_number: Optional[int] = None
64+
slot_number: int | None = None
6665
"""Gets or sets the number of the slot in which the asset is located."""
6766

6867

0 commit comments

Comments
 (0)