Skip to content

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

Merged
dianfu merged 1 commit into
apache:masterfrom
florianvazelle:39578-missing-py-typed
Aug 25, 2026
Merged

[FLINK-39578][python] Include py.typed in PyFlink distribution#28068
dianfu merged 1 commit into
apache:masterfrom
florianvazelle:39578-missing-py-typed

Conversation

@florianvazelle

Copy link
Copy Markdown
Contributor

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

flinkbot commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

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

@spuru9 spuru9 left a comment

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.

1 minor nit. LGTM

Comment thread flink-python/MANIFEST.in
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
@florianvazelle

Copy link
Copy Markdown
Contributor Author

Hi @spuru9 thanks for the review. Do I need to ping someone to have this pull request fully reviewed and merged?

@spuru9

spuru9 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Hi @spuru9 thanks for the review. Do I need to ping someone to have this pull request fully reviewed and merged?

Yes, a commiter would help in the final review and merge.

@florianvazelle

Copy link
Copy Markdown
Contributor Author

Hi @dianfu, a small PR to enables proper static type checking for users 🙏

@dianfu dianfu left a comment

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.

@florianvazelle LGTM 👍

@dianfu
dianfu merged commit f3cfe3e into apache:master Aug 25, 2026
@florianvazelle
florianvazelle deleted the 39578-missing-py-typed branch August 25, 2026 07:43
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.

4 participants