Skip to content
Snippets Groups Projects
Commit 954397f6 authored by David Schäfer's avatar David Schäfer
Browse files

Support python 3.12

parent 538e46a1
No related branches found
No related tags found
1 merge request!803Support python 3.12
...@@ -29,7 +29,7 @@ jobs: ...@@ -29,7 +29,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"] os: ["windows-latest", "ubuntu-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11"] python-version: ["3.9", "3.10", "3.11", "3.12"]
defaults: defaults:
run: run:
# somehow this also works for windows O.o ?? # somehow this also works for windows O.o ??
......
...@@ -30,7 +30,7 @@ stages: ...@@ -30,7 +30,7 @@ stages:
- deploy - deploy
default: default:
image: python:3.10 image: python:3.11
before_script: before_script:
- pip install --upgrade pip - pip install --upgrade pip
- pip install -r requirements.txt - pip install -r requirements.txt
...@@ -133,6 +133,19 @@ python311: ...@@ -133,6 +133,19 @@ python311:
reports: reports:
junit: report.xml junit: report.xml
python312:
stage: test
image: python:3.12
script:
- export DISPLAY=:99
- Xvfb :99 &
- pytest tests -Werror --junitxml=report.xml
- python -m saqc --config docs/resources/data/config.csv --data docs/resources/data/data.csv --outfile /tmp/test.csv
artifacts:
when: always
reports:
junit: report.xml
doctest: doctest:
stage: test stage: test
script: script:
...@@ -180,6 +193,16 @@ wheel311: ...@@ -180,6 +193,16 @@ wheel311:
- pip install . - pip install .
- python -c 'import saqc; print(f"{saqc.__version__=}")' - python -c 'import saqc; print(f"{saqc.__version__=}")'
wheel312:
stage: build
image: python:3.12
variables:
PYPI_PKG_NAME: "saqc-dev"
script:
- pip install wheel
- pip wheel .
- pip install .
- python -c 'import saqc; print(f"{saqc.__version__=}")'
# =========================================================== # ===========================================================
# Extra Pipeline (run with a successful run of all other jobs on develop) # Extra Pipeline (run with a successful run of all other jobs on develop)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
Click==8.1.7 Click==8.1.7
docstring_parser==0.16 docstring_parser==0.16
fancy-collections==0.2.1
fastdtw==0.3.4 fastdtw==0.3.4
matplotlib==3.8.3 matplotlib==3.8.3
numpy==1.26.4 numpy==1.26.4
...@@ -13,4 +14,3 @@ pandas==2.2.1 ...@@ -13,4 +14,3 @@ pandas==2.2.1
scikit-learn==1.4.1.post1 scikit-learn==1.4.1.post1
scipy==1.12.0 scipy==1.12.0
typing_extensions==4.10.0 typing_extensions==4.10.0
fancy-collections==0.2.1
...@@ -10,7 +10,7 @@ from __future__ import annotations ...@@ -10,7 +10,7 @@ from __future__ import annotations
import pickle import pickle
import tkinter as tk import tkinter as tk
import warnings import warnings
from typing import TYPE_CHECKING, Optional from typing import TYPE_CHECKING
import matplotlib as mpl import matplotlib as mpl
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
...@@ -24,7 +24,7 @@ from saqc.lib.checking import validateChoice ...@@ -24,7 +24,7 @@ from saqc.lib.checking import validateChoice
from saqc.lib.docs import DOC_TEMPLATES from saqc.lib.docs import DOC_TEMPLATES
from saqc.lib.plotting import makeFig from saqc.lib.plotting import makeFig
from saqc.lib.selectionGUI import MplScroller, SelectionOverlay from saqc.lib.selectionGUI import MplScroller, SelectionOverlay
from saqc.lib.tools import periodicMask, toSequence from saqc.lib.tools import periodicMask
if TYPE_CHECKING: if TYPE_CHECKING:
from saqc import SaQC from saqc import SaQC
...@@ -138,7 +138,7 @@ class ToolsMixin: ...@@ -138,7 +138,7 @@ class ToolsMixin:
if not _TEST_MODE: if not _TEST_MODE:
root.destroy() root.destroy()
else: # show figure if only overlay is used else: # show figure if only overlay is used
plt.show(block=~_TEST_MODE) plt.show(block=not _TEST_MODE)
plt.rcParams["toolbar"] = "toolbar2" plt.rcParams["toolbar"] = "toolbar2"
# disconnect mouse events when GUI is closed # disconnect mouse events when GUI is closed
...@@ -329,7 +329,7 @@ class ToolsMixin: ...@@ -329,7 +329,7 @@ class ToolsMixin:
datcol_idx = self._data[field].index datcol_idx = self._data[field].index
if mode == "periodic": if mode == "periodic":
mask = periodicMask(datcol_idx, start, end, ~closed) mask = periodicMask(datcol_idx, start, end, closed)
elif mode == "selection_field": elif mode == "selection_field":
idx = self._data[selection_field].index.intersection(datcol_idx) idx = self._data[selection_field].index.intersection(datcol_idx)
mask = self._data[selection_field].loc[idx] mask = self._data[selection_field].loc[idx]
...@@ -357,7 +357,7 @@ class ToolsMixin: ...@@ -357,7 +357,7 @@ class ToolsMixin:
mode: Literal["subplots", "oneplot"] | str = "oneplot", mode: Literal["subplots", "oneplot"] | str = "oneplot",
history: Literal["valid", "complete"] | list[str] | None = "valid", history: Literal["valid", "complete"] | list[str] | None = "valid",
xscope: slice | str | None = None, xscope: slice | str | None = None,
yscope: tuple | list[tuple] | dict = None, yscope: tuple | list[tuple] | dict | None = None,
store_kwargs: dict | None = None, store_kwargs: dict | None = None,
ax: mpl.axes.Axes | None = None, ax: mpl.axes.Axes | None = None,
ax_kwargs: dict | None = None, ax_kwargs: dict | None = None,
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
import ast import ast
import importlib import importlib
import numpy as np
from saqc.core.register import FUNC_MAP from saqc.core.register import FUNC_MAP
from saqc.parsing.environ import ENVIRONMENT from saqc.parsing.environ import ENVIRONMENT
...@@ -28,13 +26,12 @@ class ConfigExpressionParser(ast.NodeVisitor): ...@@ -28,13 +26,12 @@ class ConfigExpressionParser(ast.NodeVisitor):
""" """
SUPPORTED = ( SUPPORTED = (
ast.Str, ast.Constant,
ast.Expression, ast.Expression,
ast.UnaryOp, ast.UnaryOp,
ast.BinOp, ast.BinOp,
ast.BitOr, ast.BitOr,
ast.BitAnd, ast.BitAnd,
ast.Num,
ast.Compare, ast.Compare,
ast.Add, ast.Add,
ast.Sub, ast.Sub,
...@@ -86,10 +83,8 @@ class ConfigExpressionParser(ast.NodeVisitor): ...@@ -86,10 +83,8 @@ class ConfigExpressionParser(ast.NodeVisitor):
class ConfigFunctionParser(ast.NodeVisitor): class ConfigFunctionParser(ast.NodeVisitor):
SUPPORTED_NODES = ( SUPPORTED_NODES = (
ast.Call, ast.Call,
ast.Num, ast.Constant,
ast.Str,
ast.keyword, ast.keyword,
ast.NameConstant,
ast.UnaryOp, ast.UnaryOp,
ast.Name, ast.Name,
ast.Load, ast.Load,
......
...@@ -50,9 +50,9 @@ setup( ...@@ -50,9 +50,9 @@ setup(
python_requires=">=3.9", python_requires=">=3.9",
install_requires=[ install_requires=[
"Click", "Click",
"dtw",
"docstring_parser", "docstring_parser",
"fancy-collections", "fancy-collections",
"fastdtw",
"matplotlib>=3.4", "matplotlib>=3.4",
"numpy", "numpy",
"outlier-utils", "outlier-utils",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment