From 5f0895deafcc58f75a896f0df687d74c508214b8 Mon Sep 17 00:00:00 2001 From: Daniel Gafni Date: Tue, 22 Oct 2024 13:21:55 +0200 Subject: [PATCH] :arrow_up: support Python 3.12 --- .github/workflows/CI.yml | 4 ++-- pyproject.toml | 2 +- scripts/check_deps.py | 31 +++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 scripts/check_deps.py diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b4abde1..990494b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,7 +27,7 @@ jobs: os: - Ubuntu py: - # - "3.12" + - "3.12" - "3.11" - "3.10" - "3.9" @@ -58,7 +58,7 @@ jobs: run: uv python install ${{ matrix.py }} && uv python pin ${{ matrix.py }} && uv venv --python ${{ matrix.py }} - name: Override ray==${{ matrix.ray }} dagster==${{ matrix.dagster }} id: override - run: uv add --no-sync "ray[all]==${{ matrix.ray }}" "dagster==${{ matrix.dagster }}" || echo SKIP=1 >> $GITHUB_OUTPUT + run: (python scripts/check_deps.py --python ${{ matrix.py }} --dagster ${{ matrix.dagster }} --ray ${{ matrix.ray }} && uv add --no-sync "ray[all]==${{ matrix.ray }}" "dagster==${{ matrix.dagster }}") || echo SKIP=1 >> $GITHUB_OUTPUT - name: Install dependencies run: uv sync --all-extras --dev if: ${{ steps.override.outputs.SKIP != '1' }} diff --git a/pyproject.toml b/pyproject.toml index 60d48a3..93affd2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,10 +16,10 @@ keywords = [ "distributed", ] classifiers = [ - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules", diff --git a/scripts/check_deps.py b/scripts/check_deps.py new file mode 100644 index 0000000..bde5372 --- /dev/null +++ b/scripts/check_deps.py @@ -0,0 +1,31 @@ +from argparse import ArgumentParser + +from packaging.version import Version + +parser = ArgumentParser() + +parser.add_argument("--python", type=Version, help="Python version") +parser.add_argument("--dagster", type=Version, help="Dagster version") +parser.add_argument("--ray", type=Version, help="Dagster version") + + +def check_python_312( + python: Version, + dagster: Version, + ray: Version, +): + if python >= Version("3.12") and ray < Version("2.37.0"): + raise RuntimeError("Ray version must be >=2.37.0 for Python >=3.12") + + +def main(): + args = parser.parse_args() + check_python_312( + python=args.python, + dagster=args.dagster, + ray=args.ray, + ) + + +if __name__ == "__main__": + main()