Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add support for Python 3.12 #1008

Merged
merged 7 commits into from
Jan 3, 2024
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
13 changes: 10 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ concurrency:
jobs:
tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
include:
- os: "macos-latest"
python-version: "3.11"
python-version: "3.12"
- os: "windows-latest"
python-version: "3.11"
python-version: "3.12"

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

defaults:
run:
shell: bash

name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
steps:
- name: Acquire sources
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Development
***********

- Fix issue with DWD DMO api
- CI: Add support for Python 3.12

0.70.0 (30.12.2023)
*******************
Expand Down
732 changes: 366 additions & 366 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Development Status :: 4 - Beta",
"Environment :: Console",
Expand Down Expand Up @@ -99,7 +100,7 @@ classifiers = [
"Releases" = "https://github.com/earthobservations/wetterdienst/releases"

[tool.poetry.dependencies]
python = "^3.9,!=3.9.7,<3.12"
python = "^3.9,!=3.9.7,<3.13"

aenum = ">=3,<3.2"
aiohttp = ">=3.8,<3.10"
Expand Down Expand Up @@ -137,7 +138,7 @@ crate = { version = ">=0.30.1,<1", optional = true }
dash = { version = ">=2.10,<2.15", optional = true } # Explorer UI feature.
dash-bootstrap-components = { version = ">=1.4,<2", optional = true } # Explorer UI feature.
dash-leaflet = { version = ">=1.0.8,<2", optional = true } # Explorer UI feature.
duckdb = { version = ">=0.9,<0.10", optional = true } # Export feature.
duckdb = { version = ">=0.9", optional = true, markers = "python_version != '3.12'" } # Export feature.
eccodes = { version = ">=1.5.2,<1.7", optional = true }
fastapi = { version = ">=0.95.1,<0.104", optional = true } # HTTP REST API feature.
geojson = { version = ">=3,<4", optional = true } # Explorer UI feature.
Expand Down
3 changes: 3 additions & 0 deletions tests/core/timeseries/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import datetime as dt
import json
import sqlite3
import sys
from unittest import mock

import polars as pl
Expand Down Expand Up @@ -582,6 +583,7 @@ def test_filter_by_date_interval(df_values):


@pytest.mark.sql
@pytest.mark.skipif(not sys.version_info < (3, 12), reason="DuckDB does not support Python 3.12 yet")
def test_filter_by_sql(df_values):
"""Test filter by sql statement"""
df = ExportMixin(df=df_values).filter_by_sql(
Expand Down Expand Up @@ -977,6 +979,7 @@ def test_export_cratedb(


@pytest.mark.remote
@pytest.mark.skipif(not sys.version_info < (3, 12), reason="DuckDB does not support Python 3.12 yet")
def test_export_duckdb(settings_si_false, tmp_path):
"""Test export of DataFrame to duckdb"""
import duckdb
Expand Down
2 changes: 2 additions & 0 deletions tests/example/test_notebook_examples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2021, earthobservations developers.
# Distributed under the MIT License. See LICENSE for more info.
import sys
from pathlib import Path

import pytest
Expand All @@ -12,6 +13,7 @@

@pytest.mark.slow
@pytest.mark.remote
@pytest.mark.skipif(condition=sys.version_info[:2] == (3, 12), reason="Python 3.12 currently not supported by duckdb")
def test_wetterdienst_notebook():
"""Test for climate_observations jupyter notebook"""
fixture = NBRegressionFixture(
Expand Down
4 changes: 3 additions & 1 deletion tests/example/test_regular_examples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2021, earthobservations developers.
# Distributed under the MIT License. See LICENSE for more info.
import sys
from pathlib import Path

import pytest
Expand All @@ -22,7 +23,8 @@ def test_regular_examples():

assert dwd_describe_fields.main() is None
assert mosmix_forecasts.main() is None
assert observations_sql.main() is None
if sys.version_info < (3, 12):
assert observations_sql.main() is None
assert observations_stations.main() is None


Expand Down
5 changes: 5 additions & 0 deletions tests/ui/test_restapi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2021, earthobservations developers.
# Distributed under the MIT License. See LICENSE for more info.
import sys

import pytest
from dirty_equals import IsNumber, IsStr

Expand Down Expand Up @@ -131,6 +133,7 @@ def test_dwd_stations_geo(client):


@pytest.mark.remote
@pytest.mark.skipif(not sys.version_info < (3, 12), reason="DuckDB does not support Python 3.12 yet")
def test_dwd_stations_sql(client):
response = client.get(
"/api/stations",
Expand Down Expand Up @@ -234,6 +237,7 @@ def test_dwd_values_no_resolution(client):

@pytest.mark.remote
@pytest.mark.sql
@pytest.mark.skipif(condition=sys.version_info[:2] == (3, 12), reason="Python 3.12 currently not supported by duckdb")
def test_dwd_values_sql_tabular(client):
response = client.get(
"/api/values",
Expand Down Expand Up @@ -291,6 +295,7 @@ def test_dwd_values_sql_tabular(client):

@pytest.mark.remote
@pytest.mark.sql
@pytest.mark.skipif(condition=sys.version_info[:2] == (3, 12), reason="Python 3.12 currently not supported by duckdb")
def test_dwd_values_sql_long(client):
response = client.get(
"/api/values",
Expand Down