Skip to content
Open
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
31 changes: 24 additions & 7 deletions .github/workflows/pythonbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set Python versions for run
run: |
if [[ ${{ github.event_name }} == "schedule" ]]; then
echo "python_versions=[\"3.10\",\"3.11\",\"3.12\"]" >> $GITHUB_ENV
echo "python_versions=[\"3.10\",\"3.11\",\"3.12\",\"3.13\"]" >> $GITHUB_ENV
else
echo "python_versions=[\"3.12\"]" >> $GITHUB_ENV
fi
Expand Down Expand Up @@ -110,9 +110,9 @@ jobs:
uv pip uninstall --system pandas pyarrow
uv pip freeze
- name: Run extras unit tests with coverage
# Skip this step if running on python 3.12 due to https://github.com/tensorflow/tensorflow/issues/62003
# Skip this step if running on python 3.12+ due to https://github.com/tensorflow/tensorflow/issues/62003
# and https://github.com/pytorch/pytorch/issues/110436
if: ${{ matrix.python-version != '3.12' }}
if: ${{ matrix.python-version != '3.12' && matrix.python-version != '3.13' }}
run: |
make unit_test_extras_codecov
- name: Codecov
Expand All @@ -139,6 +139,8 @@ jobs:
pandas: "pandas>=2.0.0"
- pandas: "pandas<2.0.0"
python-version: "3.12"
- pandas: "pandas<2.0.0"
python-version: "3.13"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -370,24 +372,39 @@ jobs:
# See: https://github.com/flyteorg/flytekit/actions/runs/4493746408/jobs/7905368664
- python-version: 3.11
plugin-names: "flytekit-whylogs"
# apache-beam, one of flytekit-airflow dependencies, does not support python 3.12: https://github.com/apache/beam/issues/29149
# apache-beam, one of flytekit-airflow dependencies, does not support python 3.12+: https://github.com/apache/beam/issues/29149
- python-version: 3.12
plugin-names: "flytekit-airflow"
- python-version: 3.13
plugin-names: "flytekit-airflow"
# Tensorflow is a dependency of flytekit-mlflow tests and that is not supported yet: https://github.com/tensorflow/tensorflow/issues/62003
- python-version: 3.12
plugin-names: "flytekit-mlflow"
# modin[ray] is a dependency needed to run the tests, unfortunately this is not supported in python 3.12 yet
- python-version: 3.13
plugin-names: "flytekit-mlflow"
# modin[ray] is a dependency needed to run the tests, unfortunately this is not supported in python 3.12+ yet
- python-version: 3.12
plugin-names: "flytekit-modin"
# vaex currently doesn't support python 3.12
- python-version: 3.13
plugin-names: "flytekit-modin"
# vaex currently doesn't support python 3.12+
- python-version: 3.12
plugin-names: "flytekit-vaex"
# Ray does not support python 3.12 yet: https://github.com/ray-project/ray/issues/40211
- python-version: 3.13
plugin-names: "flytekit-vaex"
# Ray does not support python 3.12+ yet: https://github.com/ray-project/ray/issues/40211
- python-version: 3.12
plugin-names: "flytekit-ray"
- python-version: 3.13
plugin-names: "flytekit-ray"
# Segmentation fault on python 3.12: https://github.com/flyteorg/flyte/issues/5020
- python-version: 3.12
plugin-names: "flytekit-kf-pytorch"
- python-version: 3.13
plugin-names: "flytekit-kf-pytorch"
# onnx-pytorch does not support python 3.12+ yet
- python-version: 3.13
plugin-names: "flytekit-onnx-pytorch"
steps:
- uses: actions/checkout@v4
- name: "Clear action cache"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ keyrings.alt
setuptools_scm
pytest-icdiff

# Tensorflow is not available for python 3.12 yet: https://github.com/tensorflow/tensorflow/issues/62003
# Tensorflow is not available for python 3.12+ yet: https://github.com/tensorflow/tensorflow/issues/62003
tensorflow<=2.15.1; python_version<'3.12'
# Newer versions of torch bring in nvidia dependencies that are not present in windows, so
# we put this constraint while we do not have per-environment requirements files
torch<=1.12.1; python_version<'3.11'
# pytorch 2 supports python 3.11
# pytorch 2 does not support 3.12 yet: https://github.com/pytorch/pytorch/issues/110436
# pytorch 2 does not support 3.12+ yet: https://github.com/pytorch/pytorch/issues/110436
torch; python_version<'3.12'
pydantic

Expand Down
2 changes: 2 additions & 0 deletions flytekit/configuration/default_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class PythonVersion(enum.Enum):
PYTHON_3_10 = (3, 10)
PYTHON_3_11 = (3, 11)
PYTHON_3_12 = (3, 12)
PYTHON_3_13 = (3, 13)


class DefaultImages(object):
Expand All @@ -26,6 +27,7 @@ class DefaultImages(object):
PythonVersion.PYTHON_3_10: "cr.flyte.org/flyteorg/flytekit:py3.10-",
PythonVersion.PYTHON_3_11: "cr.flyte.org/flyteorg/flytekit:py3.11-",
PythonVersion.PYTHON_3_12: "cr.flyte.org/flyteorg/flytekit:py3.12-",
PythonVersion.PYTHON_3_13: "cr.flyte.org/flyteorg/flytekit:py3.13-",
}

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class OpenAIFileDefaultImages(DefaultImages):
PythonVersion.PYTHON_3_10: "cr.flyte.org/flyteorg/flytekit:py3.10-openai-batch-",
PythonVersion.PYTHON_3_11: "cr.flyte.org/flyteorg/flytekit:py3.11-openai-batch-",
PythonVersion.PYTHON_3_12: "cr.flyte.org/flyteorg/flytekit:py3.12-openai-batch-",
PythonVersion.PYTHON_3_13: "cr.flyte.org/flyteorg/flytekit:py3.13-openai-batch-",
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SQLAlchemyDefaultImages(DefaultImages):
PythonVersion.PYTHON_3_10: "cr.flyte.org/flyteorg/flytekit:py3.10-sqlalchemy-",
PythonVersion.PYTHON_3_11: "cr.flyte.org/flyteorg/flytekit:py3.11-sqlalchemy-",
PythonVersion.PYTHON_3_12: "cr.flyte.org/flyteorg/flytekit:py3.12-sqlalchemy-",
PythonVersion.PYTHON_3_13: "cr.flyte.org/flyteorg/flytekit:py3.13-sqlalchemy-",
}


Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [{ name = "Flyte Contributors", email = "admin@flyte.org" }]
description = "Flyte SDK for Python"
license = { text = "Apache-2.0" }
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10,<3.14"
dependencies = [
# Please maintain an alphabetical order in the following list
"adlfs>=2023.3.0",
Expand Down Expand Up @@ -61,6 +61,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
Expand Down
5 changes: 5 additions & 0 deletions tests/flytekit/unit/extras/pytorch/test_checkpoint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import sys
from dataclasses import asdict, dataclass
from typing import NamedTuple

import pytest

pytest.importorskip("torch", reason="torch is not available for Python 3.12+")
pytestmark = pytest.mark.skipif(sys.version_info >= (3, 12), reason="torch is not available for Python 3.12+")

import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
Expand Down
7 changes: 7 additions & 0 deletions tests/flytekit/unit/extras/pytorch/test_native.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import sys

import pytest

pytest.importorskip("torch", reason="torch is not available for Python 3.12+")
pytestmark = pytest.mark.skipif(sys.version_info >= (3, 12), reason="torch is not available for Python 3.12+")

import torch

from flytekit import task, workflow
Expand Down
5 changes: 5 additions & 0 deletions tests/flytekit/unit/extras/pytorch/test_transformations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import sys
from collections import OrderedDict
from typing import Union

import pytest

pytest.importorskip("torch", reason="torch is not available for Python 3.12+")
pytestmark = pytest.mark.skipif(sys.version_info >= (3, 12), reason="torch is not available for Python 3.12+")

import torch

import flytekit
Expand Down
7 changes: 7 additions & 0 deletions tests/flytekit/unit/extras/tensorflow/model/test_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import sys

import pytest

pytest.importorskip("tensorflow", reason="tensorflow is not available for Python 3.12+")
pytestmark = pytest.mark.skipif(sys.version_info >= (3, 12), reason="tensorflow is not available for Python 3.12+")

import tensorflow as tf

from flytekit import task, workflow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import sys
from collections import OrderedDict

import numpy as np
import pytest

pytest.importorskip("tensorflow", reason="tensorflow is not available for Python 3.12+")
pytestmark = pytest.mark.skipif(sys.version_info >= (3, 12), reason="tensorflow is not available for Python 3.12+")

import tensorflow as tf

import flytekit
Expand Down
6 changes: 6 additions & 0 deletions tests/flytekit/unit/extras/tensorflow/record/test_record.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import sys
from typing import Dict, Tuple

import numpy as np
import pytest

pytest.importorskip("tensorflow", reason="tensorflow is not available for Python 3.12+")
pytestmark = pytest.mark.skipif(sys.version_info >= (3, 12), reason="tensorflow is not available for Python 3.12+")

import tensorflow as tf
from tensorflow.python.data.ops.readers import TFRecordDatasetV2
from typing_extensions import Annotated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import sys

import pytest

pytest.importorskip("tensorflow", reason="tensorflow is not available for Python 3.12+")
pytestmark = pytest.mark.skipif(sys.version_info >= (3, 12), reason="tensorflow is not available for Python 3.12+")

import tensorflow
import tensorflow as tf
from tensorflow.core.example.example_pb2 import Example
Expand Down
Loading