Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to manage .pyi <-> .py consistency #36408

Open
1 task done
potiuk opened this issue Dec 24, 2023 · 3 comments
Open
1 task done

Add a way to manage .pyi <-> .py consistency #36408

potiuk opened this issue Dec 24, 2023 · 3 comments
Labels
kind:meta High-level information important to the community

Comments

@potiuk
Copy link
Member

potiuk commented Dec 24, 2023

Body

We have quite a few cases where .pyi and .py files we have get desynchronized (for example:

We should find a way to keep them synchronized as changes are applied to either .py or .pyi

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.
@potiuk potiuk added the kind:meta High-level information important to the community label Dec 24, 2023
@potiuk
Copy link
Member Author

potiuk commented Dec 24, 2023

cc: @Taragolis

@Taragolis
Copy link
Contributor

For provider's decorators it might be a good point to make it as part of some release management commands rather than pre-commit, because such of decorators is a part of providers and stub is part of core.

I've added this lines into the DockerOperator:

# !!! Changes in DockerOperator's arguments should be also reflected in !!!
# - docs/apache-airflow-providers-docker/decorators/docker.rst
# - airflow/decorators/__init__.pyi (by a separate PR)

I hope this reduce number of inconsistency but still easy to miss this comment

@potiuk
Copy link
Member Author

potiuk commented Dec 24, 2023

We could for example use stubgen from mypy and compare the generated .pyi files AST (while we automatically remove the things we want to remove from .pyI). That would force whoever addss stuff to .py files to do something when new methods are added or signatures are modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:meta High-level information important to the community
Projects
None yet
Development

No branches or pull requests

2 participants