Support for Python 3.10?

オープン
#921 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

cf/regrid/regrid.py の 2203 行付近にある mask1 の代入から始め、issue に記載されているコマンドを使って Python 3.10 環境で import 失敗を再現してください。タプルインデックスによる回避策がパッケージ全体で機能するか確認し、その後、サポート対象バージョンでリグレッションを発生させずに、Python 3.10 で cf を正常に import できることを検証してください。

索引モデルが issue の本文から書いたものです。

説明

bug?

Firstly, thank you for maintaining this software.

The latest update of cf-python appears to break for Python 3.10.

Importing leads to a traceback detailed below.

PyPI still lists 3.10 as being supported and there is a possible fix (see below) so we presume this is a bug and not a dropping in support for Python 3.10 (not mentioned in the release notes for cf-python 3.19).

Steps to reproduce:

Create an environment with Python 3.10 and install cf-python, launch a repl, and attempt to import cf.

python3.10 -m venv cf-venv
source cf-venv/bin/activate
pip install cf-python
python
Python 3.10.19 (main, Oct  9 2025, 15:25:03) [Clang 17.0.0 (clang-1700.0.13.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cf

Expected behaviour:

cf-python imported and useable, as is the case for Python >=3.11

Actual behaviour:

Import fails due to invalid syntax

>>> import cf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jwa34/venv/lib/python3.10/site-packages/cf/__init__.py", line 215, in <module>
    from .regrid import RegridOperator
  File "/Users/jwa34/venv/lib/python3.10/site-packages/cf/regrid/__init__.py", line 1, in <module>
    from .regrid import regrid
  File "/Users/jwa34/venv/lib/python3.10/site-packages/cf/regrid/regrid.py", line 2203
    mask1 = mask1[..., *partition]
                       ^
SyntaxError: invalid syntax

Version:

Downloaded: cf_python-3.19.0.tar.gz
Working on M2 Macbook, but reproducible on linux rhel environment and GitHub Workflow.

Possible Solution/Workaround:

Editing the offending line to be a tuple of arguments allows successful import, but this is not extensively tested to you will need to confirm that it is satisfactory for the wider package.

mask1 = mask1[(..., *partition)]

cc @sjavis

主要言語
Python
スター
151
フォーク
23
平均マージ
3日 9時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NCAS-CMS/cf-python のほかの issue

NCAS-CMS/cf-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。