Skip to content

Support python 3.14#3299

Open
afeldman1 wants to merge 8 commits intoapache:mainfrom
afeldman1:main
Open

Support python 3.14#3299
afeldman1 wants to merge 8 commits intoapache:mainfrom
afeldman1:main

Conversation

@afeldman1
Copy link
Copy Markdown

@afeldman1 afeldman1 commented Apr 30, 2026

Rationale for this change

Adds prebuilt support for python 3.14
Free-threaded is still not supported for now
Closes #3123 for standard python

Are these changes tested?

test using:
PYTHON=3.14 make test
PYTHON=3.14 make test-integration

Python Build Release Candidate workflow was run: https://github.com/afeldman1/iceberg-python/actions/runs/25225067214

Are there any user-facing changes?

Just support of python 3.14

Copy link
Copy Markdown
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, a couple of suggestions

I tested this locally with

PYTHON=3.14 make test
PYTHON=3.14 RAY_ENABLE_UV_RUN_RUNTIME_ENV=0 make test-integration 

Comment thread .github/workflows/svn-build-artifacts.yml
Comment thread .github/workflows/python-ci.yml Outdated
Comment on lines +100 to +101
env:
RAY_ENABLE_UV_RUN_RUNTIME_ENV: "0"
Copy link
Copy Markdown
Contributor

@kevinjqliu kevinjqliu May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/ray-project/ray/blob/1c7c90775cc56ced98ef24754e790e2d0d9c732e/python/ray/_private/ray_constants.py#L537-L549

should we set this in the ray_session test fixture instead?
so it works outside of CI

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually tried that initially, but it cannot be done because the ray uv hook looks at the parent uv run process, including the env vars, at it's import time. So by the time it gets to the ray_session test fixture and does the ray.init(), the new env var is not refreshed to be picked up.
I tested using the same commands (PYTHON=3.14 make test : PYTHON=3.14 RAY_ENABLE_UV_RUN_RUNTIME_ENV=0 make test-integration) that you mentioned, and something to keep in mind for next is that including them in the pr description would be helpful.
What we can do is remove this change in python-ci.yml and make the following change instead
https://github.com/apache/iceberg-python/blob/main/Makefile#L118
RAY_ENABLE_UV_RUN_RUNTIME_ENV=0 $(TEST_RUNNER) pytest tests/ -m integration $(PYTEST_ARGS)

Comment thread tests/conftest.py

ray.init(
ignore_reinit_error=True,
runtime_env={"working_dir": None}, # Prevent Ray from serializing the working directory to workers
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RAY_ENABLE_UV_RUN_RUNTIME_ENV is essentially replacing this. None was being passed in to prevent ray from initializing on workers, taking advantage of a bug in ray. Ray has since fixed this bug, preventing None from being passed in for working_dir

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, raised an issue for this earlier today: #3318

Thanks for fixing

@kevinjqliu
Copy link
Copy Markdown
Contributor

kevinjqliu commented May 1, 2026

Could you also test the python-release.yml workflow on your branch?
https://github.com/afeldman1/iceberg-python/actions/workflows/python-release.yml

Manual trigger with these parameters:
Branch: main (the PR branch)
Version: 0.11.0
Release Candidate: 1

and include the link in the PR

This will help test the changes in .github/workflows/pypi-build-artifacts.yml and .github/workflows/svn-build-artifacts.yml

Comment thread .github/workflows/svn-build-artifacts.yml Outdated
Comment thread Makefile

test-integration-exec: ## Run integration tests (excluding provision)
$(TEST_RUNNER) pytest tests/ -m integration $(PYTEST_ARGS)
RAY_ENABLE_UV_RUN_RUNTIME_ENV=0 $(TEST_RUNNER) pytest tests/ -m integration $(PYTEST_ARGS)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont like that we're dependent on this env var to be set correctly for tests to pass. Lets see if there's an alternative. I'll do some research

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option I had looked into was passing in an empty folder to working_dir, but that seemed worse

@kevinjqliu
Copy link
Copy Markdown
Contributor

i think we can use this

@pytest.fixture(scope="session")
def ray_session() -> Generator[Any, None, None]:
    """Fixture to manage Ray initialization and shutdown for tests."""
    import os

    import ray

    # Disable Ray's automatic uv environment propagation to workers.
    # When tests are invoked via `uv run`, Ray detects the wrapper and tries
    # to package the working directory for remote workers, which is unnecessary
    # and problematic in local single-node test mode.
    os.environ["RAY_ENABLE_UV_RUN_RUNTIME_ENV"] = "0"

    ray.init(
        ignore_reinit_error=True,
    )
    yield ray
    ray.shutdown()

And remove RAY_ENABLE_UV_RUN_RUNTIME_ENV from Makefile.

WDYT?

@afeldman1
Copy link
Copy Markdown
Author

@kevinjqliu That looks the same as what I had originally attempted in this commit, which failed on integration test due to not picking up the env variable, set at that point in the flow.
b50e909

@Fokko
Copy link
Copy Markdown
Contributor

Fokko commented May 2, 2026

Thanks for working on this @afeldman1. I think in general this looks good, but I think it would be good to document RAY_ENABLE_UV_RUN_RUNTIME_ENV , I had to look it up: https://docs.ray.io/en/latest/_modules/ray/_private/worker.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FR: Support and provide prebuilt Python 3.14 and 3.14 free-threaded wheels

3 participants