Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13"]
exclude:
- os: windows-latest
python-version: 3.10
- os: windows-latest
python-version: 3.11
- os: windows-latest
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13"]
min-version: [false]
include:
- os: ubuntu-latest
python-version: "3.10"
python-version: "3.11"
min-version: true
exclude:
- os: ubuntu-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.12"
python-version: "3.11"
- os: windows-latest
python-version: "3.13"
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload_to_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: '3.10'
python-version: '3.11'
- name: Install build deps
run: pip install --upgrade pip setuptools wheel build
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To get a feeling of QCoDeS read
and/or browse the Jupyter notebooks in `docs/examples
<https://github.com/QCoDeS/Qcodes/tree/main/docs/examples>`__ .

QCoDeS is compatible with Python 3.10+. It is
QCoDeS is compatible with Python 3.11+. It is
primarily intended for use from Jupyter notebooks, but can be used from
traditional terminal-based shells and in stand-alone scripts as well. The
features in `qcodes.utils.magic` are exclusively for Jupyter notebooks.
Expand Down
1 change: 1 addition & 0 deletions docs/changes/newsfragments/7038.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
QCoDeS has dropped support for python 3.10. QCoDeS now supports Python 3.11, 3.12 and 3.13.
43 changes: 21 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,39 @@ classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
]
license = {text = "MIT"}
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"broadbean>=0.11.0",
"h5netcdf>=0.14.1",
"h5py>=3.6.0",
"h5py>=3.8.0",
"ipywidgets>=8.0.0,<9.0.0",
"ipykernel>=6.6.0", # implicitly required by ipywidgets >=8.0.5
"ipykernel>=6.12.0", # implicitly required by ipywidgets >=8.0.5
"jsonschema>=4.9.0",
"matplotlib>=3.5.0",
"matplotlib>=3.6.0",
"numpy>=1.22.4",
"packaging>=20.0",
"pandas>=1.4.0",
"pandas>=1.5.0",
"pyarrow>=11.0.0", # will become a requirement of pandas. Installing explicitly silences a warning
"pyvisa>=1.11.0, <1.16.0",
"ruamel.yaml>=0.16.0,!=0.16.6",
"tabulate>=0.9.0",
"typing_extensions>=4.6.0",
"tqdm>=4.59.0",
"uncertainties>=3.1.4",
"uncertainties>=3.2.0",
"versioningit>=2.2.1",
"websockets>=11.0",
"wrapt>=1.14.0; python_version < '3.12'",
"wrapt>=1.15.0; python_version < '3.12'",
"wrapt>=1.16.0; python_version >= '3.12'",
"xarray>=2022.06.0",
"cf_xarray>=0.8.4",
"opentelemetry-api>=1.15.0",
"pillow>=9.0.0",
"opentelemetry-api>=1.17.0",
"pillow>=9.2.0",
"dask>=2022.1.0", # we are making use of xarray features that requires dask implicitly
# transitive dependencies. We list these explicitly to",
# ensure that we always use versions that do not have",
Expand All @@ -73,19 +72,19 @@ Changelog = "https://microsoft.github.io/Qcodes/changes/index.html"
zurichinstruments = ["zhinst-qcodes>=0.3"]
loop = ["qcodes_loop>=0.1.2"]
test = [
"coverage[toml]>=6.0.0",
"coverage[toml]>=6.3.0",
"deepdiff>=5.0.2",
"hypothesis>=6.85.0",
"lxml>=4.8.0",
"hypothesis>=6.130.0",
"lxml>=4.9.4",
"lxml-stubs>=0.4.0",
"mypy>=0.971",
"pandas-stubs>=1.2.0.1",
"pytest>=7.2.0",
"pytest-asyncio>=0.19.0",
"pytest-cov>=3.0.0",
"pytest-mock>=3.0.0",
"pytest-rerunfailures>=10.0",
"pytest-xdist>=2.5.0",
"pytest>=8.2.0",
"pytest-asyncio>=0.24.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"pytest-rerunfailures>=10.3",
"pytest-xdist>=3.1.0",
"PyVisa-sim>=0.6.0",
"sphinx>=4.5.0", # sphinx extension tests
"types-jsonschema>=4.16.0",
Expand All @@ -107,9 +106,9 @@ docs = [
"sphinx-issues>=3.0.1",
"sphinx-jsonschema>=1.19.1",
"furo>=2024.8.6",
"sphinxcontrib-towncrier>=0.3.0a0",
"towncrier>=22.8.0,<25.0.0", # sphinxcontrib-towncrier is likely to break with new versions
"scipy>=1.8.0", # examples using scipy
"sphinxcontrib-towncrier>=0.5.0a0",
"towncrier>=24.8.0,<25.0.0", # sphinxcontrib-towncrier is likely to break with new versions
"scipy>=1.10.0", # examples using scipy
"qcodes_loop>=0.1.1", # legacy dataset import examples
"jinja2>=3.1.3", # transitive dependency pin due to cve in earlier version
]
Expand Down
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ ipykernel==6.29.5
# via
# qcodes (pyproject.toml)
# qcodes
ipython==8.35.0; python_version < '3.11'
ipython==9.0.2; python_version >= '3.11'
ipython==9.0.2
# via
# qcodes (pyproject.toml)
# ipykernel
Expand Down Expand Up @@ -368,8 +367,7 @@ sortedcontainers==2.4.0
# via hypothesis
soupsieve==2.6
# via beautifulsoup4
sphinx==8.1.3; python_version < '3.11'
sphinx==8.2.3; python_version >= '3.11'
sphinx==8.2.3
# via
# qcodes (pyproject.toml)
# autodocsumm
Expand Down
3 changes: 1 addition & 2 deletions src/qcodes/dataset/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@

if TYPE_CHECKING:
from types import TracebackType

from typing_extensions import Self
from typing import Self

from qcodes.dataset.descriptions.versioning.rundescribertypes import Shapes
from qcodes.dataset.experiment_container import Experiment
Expand Down
3 changes: 1 addition & 2 deletions src/qcodes/dataset/threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
if TYPE_CHECKING:
from collections.abc import Callable, Sequence
from types import TracebackType

from typing_extensions import Self
from typing import Self

from qcodes.dataset.data_set_protocol import ValuesType
from qcodes.parameters import ParamDataType, ParameterBase
Expand Down
4 changes: 3 additions & 1 deletion src/qcodes/instrument/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
from .instrument_base import InstrumentBase

if TYPE_CHECKING:
from typing_extensions import Self, Unpack
from typing import Self

from typing_extensions import Unpack

from .instrument import Instrument
from .instrument_base import InstrumentBaseKWArgs
Expand Down
4 changes: 3 additions & 1 deletion src/qcodes/instrument/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
from .instrument_meta import InstrumentMeta

if TYPE_CHECKING:
from typing_extensions import Self, Unpack
from typing import Self

from typing_extensions import Unpack

from qcodes.logger.instrument_logger import InstrumentLoggerAdapter

Expand Down
3 changes: 1 addition & 2 deletions src/qcodes/instrument/instrument_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

if TYPE_CHECKING:
from collections.abc import Callable, Mapping, Sequence

from typing_extensions import NotRequired
from typing import NotRequired

from qcodes.instrument.channel import ChannelTuple, InstrumentModule
from qcodes.logger.instrument_logger import InstrumentLoggerAdapter
Expand Down
3 changes: 2 additions & 1 deletion src/qcodes/instrument/visa.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

if TYPE_CHECKING:
from collections.abc import Mapping, Sequence
from typing import NotRequired

from typing_extensions import NotRequired, Unpack
from typing_extensions import Unpack

VISA_LOGGER = ".".join((InstrumentBase.__module__, "com", "visa"))

Expand Down
11 changes: 1 addition & 10 deletions src/qcodes/instrument_drivers/Keithley/_Keithley_2600.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import logging
import struct
import sys
import warnings
from enum import Enum
from enum import StrEnum
from typing import TYPE_CHECKING, Any, Literal

import numpy as np
Expand All @@ -31,14 +30,6 @@
from typing_extensions import Unpack


if sys.version_info >= (3, 11):
from enum import StrEnum
else:

class StrEnum(str, Enum):
pass


log = logging.getLogger(__name__)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import re
import textwrap
from typing import TYPE_CHECKING, Any, Literal, cast, overload
from typing import TYPE_CHECKING, Any, Literal, NotRequired, cast, overload

import numpy as np
from typing_extensions import NotRequired, TypedDict, Unpack
from typing_extensions import TypedDict, Unpack

import qcodes.validators as vals
from qcodes.instrument import InstrumentBaseKWArgs, InstrumentChannel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import sys
from collections.abc import Sequence
from enum import Enum, IntEnum, IntFlag

if sys.version_info >= (3, 11):
from enum import StrEnum
else:

class StrEnum(str, Enum):
pass
from enum import IntEnum, IntFlag, StrEnum


class ChannelName(StrEnum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

if TYPE_CHECKING:
from collections.abc import Iterable
from typing import Self

from typing_extensions import Buffer, Self, Unpack
from typing_extensions import Buffer, Unpack


def _read_curve_file(curve_file: TextIO) -> dict[Any, Any]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import logging
import sys
from enum import Enum
from enum import Enum, StrEnum

from qcodes.instrument_drivers.Keithley._Keithley_2600 import (
Keithley2600,
Expand All @@ -19,14 +19,6 @@
_ParameterWithStatus,
)

if sys.version_info >= (3, 11):
from enum import StrEnum
else:

class StrEnum(str, Enum):
pass


log = logging.getLogger(__name__)


Expand Down
15 changes: 1 addition & 14 deletions src/qcodes/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,7 @@ def get_level_code(level: str | int) -> int:
if isinstance(level, int):
return level
elif isinstance(level, str):
if sys.version_info >= (3, 11):
return logging.getLevelNamesMapping()[level]
else:
# The `getLevelNamesMapping` function was introduced in Python 3.11.
# It is possible to get the level code from the
# `getLevelName` call due to backwards compatibility to an earlier
# bug:
# >>> import logging
# >>> print(logging.getLevelName('DEBUG'))
# but this is now deprecated
# remove this else block when we drop support for Python 3.10
return logging.getLevelName(level) # pyright: ignore[reportDeprecated]
return logging.getLevelNamesMapping()[level]
else:
raise RuntimeError(
"get_level_code: "
Expand Down Expand Up @@ -366,8 +355,6 @@ def start_logging_on_import() -> bool:
raise RuntimeError("Error in qcodesrc validation.")

def running_in_test_or_tool() -> bool:
import sys

tools = (
"pytest.py",
"pytest",
Expand Down
3 changes: 1 addition & 2 deletions src/qcodes/math_utils/field_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

if TYPE_CHECKING:
from collections.abc import Sequence

from typing_extensions import Self
from typing import Self

AllCoordsType = tuple[float, float, float, float, float, float, float]
NormOrder = Literal["fro", "nuc"] | None | float
Expand Down
8 changes: 3 additions & 5 deletions src/qcodes/parameters/multi_channel_instrument_parameter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import logging
import sys
from typing import TYPE_CHECKING, Any, Generic, TypeVar

from .multi_parameter import MultiParameter
Expand Down Expand Up @@ -74,10 +73,9 @@ def set_raw(self, value: ParamRawDataType | Sequence[ParamRawDataType]) -> None:
"Value should either be valid for a single parameter of the channel list "
"or a sequence of valid values of the same length as the list."
)
if sys.version_info >= (3, 11):
err.add_note(note)
else:
_LOG.error(note)

err.add_note(note)

raise err from None

@property
Expand Down
3 changes: 1 addition & 2 deletions src/qcodes/parameters/sweep_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

if TYPE_CHECKING:
from collections.abc import Iterator, Sequence

from typing_extensions import Self
from typing import Self

from qcodes.parameters import ParameterBase

Expand Down
Loading
Loading