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

introduce task handle base class #479

Merged
merged 4 commits into from Jun 3, 2022
Merged

Conversation

bagel897
Copy link
Contributor

@bagel897 bagel897 commented May 29, 2022

Description

Introduces a base task handle (and job set) class. I noticed that NullTaskHandle and TaskHandle did not provide identical APIs so I used ABC base classes to do so. I also created a method to increment the count of a job set for autoimport and used that.
This will break any jobsets which didn't match the TaskHandle API.
Since the increment method is abstract, it will break jobsets without it as well. I can make it non-abstract but that seems like bad practice.

Checklist (delete if not relevant):

  • I have updated CHANGELOG.md

class TaskHandle:
class BaseJobSet(ABC):
@abstractmethod
def started_job(self, name: Optional[str]) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Should this really be Optional[str]? The job name should always be passed in, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@lieryan lieryan merged commit bad3bd2 into python-rope:master Jun 3, 2022
@lieryan lieryan added this to the 1.2.0 milestone Jun 3, 2022
@lieryan
Copy link
Member

lieryan commented Jun 3, 2022

Thank you for making this improvement

@lieryan lieryan added the api-change New features that requires changes to editor integrations to make use of label Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change New features that requires changes to editor integrations to make use of
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants