Skip to content

Commit 708b8a3

Browse files
Mikhail AstafevCopilot
andcommitted
Drop Python 3.11 from CI matrix
QCoDeS already requires Python >=3.12. This PR updates the CI configuration and applies pyupgrade fixes: - Updated pytest.yaml: removed 3.11 from matrix, min-version test now uses 3.12 - Updated docs.yaml: removed 3.11, gh-pages deploy uses 3.12 - Updated upload_to_pypi.yaml: build uses 3.12 - Removed obsolete pyvisa-sim deprecation warning filter (was only needed for 3.11) - Bumped minimum dependency versions for Python 3.12 compat: numpy>=1.26.0, pandas>=2.1.1, pyarrow>=14.0.0, h5py>=3.10.0, h5netcdf>=1.3.0, pillow>=10.2.0, matplotlib>=3.8.0, scipy>=1.12.0 - Applied ruff pyupgrade fixes (UP040 TypeAlias->type, UP046 Generic->type params) - Added noqa: UP046 for 13 complex multi-inheritance generic classes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 33f9ff8 commit 708b8a3

151 files changed

Lines changed: 210 additions & 249 deletions

File tree

Some content is hidden

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

.github/workflows/docs.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
os: [ubuntu-latest, windows-latest]
32-
python-version: ["3.11", "3.12", "3.13", "3.14"]
32+
python-version: ["3.12", "3.13", "3.14"]
3333
exclude:
34-
- os: windows-latest
35-
python-version: 3.11
3634
- os: windows-latest
3735
python-version: 3.13
3836
- os: windows-latest
@@ -122,7 +120,7 @@ jobs:
122120
- name: Download artifact
123121
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
124122
with:
125-
name: docs_3.11_ubuntu-latest
123+
name: docs_3.12_ubuntu-latest
126124
path: build_docs
127125

128126
- name: Deploy to gh pages

.github/workflows/pytest.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,13 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
os: [ubuntu-latest, windows-latest]
33-
python-version: ["3.11", "3.12", "3.13", "3.14"]
33+
python-version: ["3.12", "3.13", "3.14"]
3434
min-version: [false]
3535
include:
3636
- os: ubuntu-latest
37-
python-version: "3.11"
37+
python-version: "3.12"
3838
min-version: true
3939
exclude:
40-
- os: ubuntu-latest
41-
python-version: "3.11"
42-
- os: windows-latest
43-
python-version: "3.11"
4440
- os: windows-latest
4541
python-version: "3.13"
4642
- os: windows-latest

.github/workflows/upload_to_pypi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Set up Python
2626
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
2727
with:
28-
python-version: '3.11'
28+
python-version: '3.12'
2929
- name: Install build deps
3030
run: pip install --upgrade pip setuptools wheel build
3131
- name: Build

docs/examples/writing_drivers/A-ParameterWithSetpoints-Example-with-Dual-Setpoints.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"from typing import TYPE_CHECKING\n",
2222
"\n",
2323
"if TYPE_CHECKING:\n",
24-
" from typing_extensions import Unpack\n",
24+
" from typing import Unpack\n",
2525
"\n",
2626
"import numpy as np\n",
2727
"import numpy.typing as npt\n",

docs/examples/writing_drivers/Creating-Instrument-Drivers.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
"from typing import TYPE_CHECKING, Any\n",
2222
"\n",
2323
"if TYPE_CHECKING:\n",
24-
" from typing_extensions import (\n",
25-
" Unpack, # can be imported from typing if python >= 3.12\n",
26-
" )\n",
24+
" from typing import Unpack\n",
2725
"\n",
2826
"import numpy as np\n",
2927
"\n",

docs/examples/writing_drivers/Creating-Simulated-PyVISA-Instruments.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"from qcodes.instrument.visa import VisaInstrument, VisaInstrumentKWArgs\n",
7575
"\n",
7676
"if TYPE_CHECKING:\n",
77-
" from typing_extensions import Unpack\n",
77+
" from typing import Unpack\n",
7878
"\n",
7979
"\n",
8080
"class Weinschel8320(VisaInstrument):\n",

pyproject.toml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,27 @@ classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Science/Research",
1515
"Programming Language :: Python :: 3 :: Only",
16-
"Programming Language :: Python :: 3.11",
1716
"Programming Language :: Python :: 3.12",
1817
"Programming Language :: Python :: 3.13",
1918
"Programming Language :: Python :: 3.14",
2019
"Topic :: Scientific/Engineering",
2120
]
2221
license = "MIT"
2322
readme = "README.rst"
24-
requires-python = ">=3.11"
23+
requires-python = ">=3.12"
2524
dependencies = [
2625
"broadbean>=0.11.0",
27-
"h5netcdf>=0.14.1",
28-
"h5py>=3.8.0",
26+
"h5netcdf>=1.3.0",
27+
"h5py>=3.10.0",
2928
"ipywidgets>=8.0.0,<9.0.0",
3029
"ipykernel>=6.12.0", # implicitly required by ipywidgets >=8.0.5
3130
"jsonschema>=4.9.0",
32-
"matplotlib>=3.6.0",
31+
"matplotlib>=3.8.0",
3332
"networkx>=3.1",
34-
"numpy>=1.22.4",
33+
"numpy>=1.26.0",
3534
"packaging>=20.0",
36-
"pandas>=1.5.0",
37-
"pyarrow>=11.0.0", # will become a requirement of pandas. Installing explicitly silences a warning
35+
"pandas>=2.1.1",
36+
"pyarrow>=14.0.0", # will become a requirement of pandas. Installing explicitly silences a warning
3837
"pyvisa>=1.11.0, <1.17.0",
3938
"ruamel.yaml>=0.16.0,!=0.16.6",
4039
"tabulate>=0.9.0",
@@ -46,7 +45,7 @@ dependencies = [
4645
"xarray>=2023.08.0",
4746
"cf_xarray>=0.8.4",
4847
"opentelemetry-api>=1.17.0",
49-
"pillow>=9.2.0",
48+
"pillow>=10.2.0",
5049
"dask>=2022.1.0", # we are making use of xarray features that requires dask implicitly
5150
]
5251

@@ -99,7 +98,7 @@ docs = [
9998
"furo>=2024.8.6",
10099
"sphinxcontrib-towncrier>=0.5.0a0",
101100
"towncrier>=24.8.0,<26.0.0", # sphinxcontrib-towncrier is likely to break with new versions
102-
"scipy>=1.10.0", # examples using scipy
101+
"scipy>=1.12.0", # examples using scipy
103102
"qcodes_loop>=0.1.1", # legacy dataset import examples
104103
"intersphinx_registry>=0.2603.16"
105104
]
@@ -218,7 +217,6 @@ markers = "serial"
218217
# and error on all other warnings
219218
filterwarnings = [
220219
'error',
221-
'ignore:open_binary is deprecated:DeprecationWarning', # pyvisa-sim deprecated in 3.11 un-deprecated in 3.12. Drop filter once we drop support for 3.11
222220
'ignore:unclosed database in:ResourceWarning', # internal should be fixed
223221
'ignore:unclosed\ <socket\.socket:ResourceWarning', # not clear from where this is coming
224222
'ignore:Model_336 is deprecated:qcodes.utils.deprecate.QCoDeSDeprecationWarning', # remove once deprecated Lakeshore Model_336 and its tests has been removed

src/qcodes/dataset/data_set_cache.py

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

33
import logging
44
from pathlib import Path
5-
from typing import TYPE_CHECKING, Generic, Literal, TypeVar
5+
from typing import TYPE_CHECKING, Literal, TypeVar
66

77
import numpy as np
88
import numpy.typing as npt
@@ -39,7 +39,7 @@
3939
log = logging.getLogger(__name__)
4040

4141

42-
class DataSetCache(Generic[DatasetType_co]):
42+
class DataSetCache[DatasetType_co: "DataSetProtocol"]:
4343
"""
4444
The DataSetCache contains a in memory representation of the
4545
data in this dataset as well a a method to progressively read data

src/qcodes/dataset/data_set_protocol.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,15 @@
5151
# twice here convert to set to ensure no duplication.
5252
_EXPORT_CALLBACKS = set(entry_points(group="qcodes.dataset.on_export"))
5353

54-
ScalarResTypes: TypeAlias = (
55-
str | complex | np.integer | np.floating | np.complexfloating
56-
)
57-
ValuesType: TypeAlias = (
54+
type ScalarResTypes = str | complex | np.integer | np.floating | np.complexfloating
55+
type ValuesType = (
5856
ScalarResTypes
5957
| npt.NDArray
6058
| Sequence[ScalarResTypes]
6159
| Sequence[Sequence[ScalarResTypes]]
6260
)
63-
ResType: TypeAlias = "tuple[ParameterBase | str, ValuesType]"
64-
SetpointsType: TypeAlias = "Sequence[str | ParameterBase]"
61+
type ResType = "tuple[ParameterBase | str, ValuesType]"
62+
type SetpointsType = "Sequence[str | ParameterBase]"
6563

6664
# deprecated alias left for backwards compatibility
6765
array_like_types = (tuple, list, npt.NDArray)
@@ -71,12 +69,12 @@
7169
setpoints_type: TypeAlias = SetpointsType # noqa PYI042
7270

7371

74-
SPECS: TypeAlias = list[ParamSpec]
72+
type SPECS = list[ParamSpec]
7573
# Transition period type: SpecsOrInterDeps. We will allow both as input to
7674
# the DataSet constructor for a while, then deprecate SPECS and finally remove
7775
# the ParamSpec class
78-
SpecsOrInterDeps: TypeAlias = SPECS | InterDependencies_
79-
ParameterData: TypeAlias = dict[str, dict[str, npt.NDArray]]
76+
type SpecsOrInterDeps = SPECS | InterDependencies_
77+
type ParameterData = dict[str, dict[str, npt.NDArray]]
8078

8179
LOG = logging.getLogger(__name__)
8280

src/qcodes/dataset/dond/do_0d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .do_nd import DondKWargs, dond
99

1010
if TYPE_CHECKING:
11-
from typing_extensions import Unpack
11+
from typing import Unpack
1212

1313
from .do_nd_utils import (
1414
AxesTupleListWithDataSet,

0 commit comments

Comments
 (0)