Skip to content

Conversation

@potiuk
Copy link
Member

@potiuk potiuk commented Mar 6, 2025

This is the next stage of refactoring of airflow packages, after moving providers to standalone dstribution and separating devel-common as a common distribution.

The task_sdk has been renamed to task-sdk - this way we will never import anything in task_sdk accidentally starting from content root. Some changes have been needed to make it works:

  • autouse fixture was added to pytest plugin to add task-sdk/tests to PYTHONPATH to make it root import
  • all tests were moved to task_sdk package inside the tests folder
  • all imports for tests are now from task_sdk
  • common tools for task_sdk has been moved to devel-common/src/test_utils/task_sdk.py in order to allow importing them before task-sdk/tests is added to pythonpath

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@potiuk
Copy link
Member Author

potiuk commented Mar 6, 2025

This is still not fully complete - some tests are failing but it proposes how we can move task_sdk to standalone task-sdk distribution.

@potiuk potiuk force-pushed the move-task-sdk branch 3 times, most recently from 3f94c4c to 05ff95e Compare March 6, 2025 15:29
@potiuk
Copy link
Member Author

potiuk commented Mar 6, 2025

Looks good, green and straightforward :)

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

LGTM

@potiuk potiuk force-pushed the move-task-sdk branch 2 times, most recently from 4bd9c6e to 131a167 Compare March 6, 2025 17:41
@potiuk
Copy link
Member Author

potiuk commented Mar 6, 2025

I moved the make_client stuff to task_sdk/__init_,py

This is the next stage of refactoring of airflow packages, after
moving providers to standalone dstribution and separating devel-common
as a common distribution.

The `task_sdk` has been renamed to `task-sdk` - this way we will
never import anything in task_sdk accidentally starting from content
root. Some changes have been needed to make it works:

* autouse fixture was added to pytest plugin to add `task-sdk/tests`
  to PYTHONPATH to make it root import
* all tests were moved to `task_sdk` package inside the tests folder
* all imports for tests are now `from task_sdk`
* common tools for task_sdk has been moved to
  `devel-common/src/test_utils/task_sdk.py` in order to allow importing
  them before `task-sdk/tests` is added to pythonpath
@potiuk potiuk merged commit fbe3fc9 into apache:main Mar 6, 2025
89 checks passed
@potiuk potiuk deleted the move-task-sdk branch March 6, 2025 20:38
Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

Late here, but good work!

nailo2c pushed a commit to nailo2c/airflow that referenced this pull request Apr 4, 2025
This is the next stage of refactoring of airflow packages, after
moving providers to standalone dstribution and separating devel-common
as a common distribution.

The `task_sdk` has been renamed to `task-sdk` - this way we will
never import anything in task_sdk accidentally starting from content
root. Some changes have been needed to make it works:

* autouse fixture was added to pytest plugin to add `task-sdk/tests`
  to PYTHONPATH to make it root import
* all tests were moved to `task_sdk` package inside the tests folder
* all imports for tests are now `from task_sdk`
* common tools for task_sdk has been moved to
  `devel-common/src/test_utils/task_sdk.py` in order to allow importing
  them before `task-sdk/tests` is added to pythonpath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants