Skip to content

[FLINK-39578][python] Include py.typed in PyFlink distribution#28068

Open
florianvazelle wants to merge 1 commit intoapache:masterfrom
florianvazelle:39578-missing-py-typed
Open

[FLINK-39578][python] Include py.typed in PyFlink distribution#28068
florianvazelle wants to merge 1 commit intoapache:masterfrom
florianvazelle:39578-missing-py-typed

Conversation

@florianvazelle
Copy link
Copy Markdown

What is the purpose of the change

This pull request ensures that the py.typed marker file is included in the PyFlink wheel distribution.

Without this file, type checkers such as mypy treat PyFlink as an untyped package and ignore inline type annotations. Including py.typed makes PyFlink compliant with PEP 561 and enables proper static type checking for users.


Brief change log

  • Add py.typed to the pyflink package
  • Update MANIFEST.in to ensure py.typed is packaged correctly

Verifying this change

This change is a trivial packaging fix and can be verified as follows:

  • Build the wheel:

    python setup.py bdist_wheel
  • Verify py.typed is included:

    unzip -l dist/*.whl | grep py.typed
  • Install the package and run mypy on a project importing pyflink to confirm it is no longer treated as untyped.

Same for the sdist:

  • Build the sdit:

    python setup.py sdit
  • Verify py.typed is included:

    tar xvfz dist/*.tar.g | grep py.typed

No additional tests are required.


Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery (JobManager, Checkpointing, Kubernetes/Yarn, ZooKeeper): no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented Apr 29, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@florianvazelle florianvazelle force-pushed the 39578-missing-py-typed branch from dd5af04 to 0bcd779 Compare April 30, 2026 08:25
Copy link
Copy Markdown
Contributor

@spuru9 spuru9 left a comment

Choose a reason for hiding this comment

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

1 minor nit. LGTM

Comment thread flink-python/MANIFEST.in
include LICENSE
include NOTICE
include pyflink/README.txt
include pyflink/py.typed
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.

nit: may consider adding 'py.typed' to PACKAGE_DATA['pyflink'] in setup.py (README.txt precedent)

Add `py.typed` to the `pyflink` package and update setup.py and MANIFEST.in
to ensure it is included in the built wheel.

This allows type checkers (e.g. mypy) to recognize PyFlink as a typed package
per PEP 561.
@florianvazelle florianvazelle force-pushed the 39578-missing-py-typed branch from 0bcd779 to 6ff9e70 Compare April 30, 2026 10:04
@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants