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

Fix mypy ci #1167

Merged
merged 1 commit into from
Nov 8, 2022
Merged

Fix mypy ci #1167

merged 1 commit into from
Nov 8, 2022

Conversation

nateraw
Copy link
Contributor

@nateraw nateraw commented Nov 8, 2022

Seeing if pinning version of mypy to previous version fixes CI

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 8, 2022

The documentation is not available anymore as the PR was closed or merged.

@nateraw nateraw marked this pull request as ready for review November 8, 2022 02:00
@nateraw nateraw requested a review from Wauplin November 8, 2022 02:00
@nateraw
Copy link
Contributor Author

nateraw commented Nov 8, 2022

Oh by the way, I did find that by changing these two signatures in _deprecation.py, you can get mypy to pass as well on latest version...

# added 'list'
class DeprecateListMetaclass(type, list):
# added 'type'
class DeprecatedList(list, type, metaclass=DeprecateListMetaclass):

Though I have no idea what I'm doing here or if this is OK 😅

@nateraw
Copy link
Contributor Author

nateraw commented Nov 8, 2022

the other option is to just ignore the errors for that class or file

@Wauplin
Copy link
Contributor

Wauplin commented Nov 8, 2022

Thanks @nateraw for having a look at it :) I just played locally with mypy and doesn't really understand the class DeprecatedList(list, type, metaclass=DeprecateListMetaclass): solution either. Since it's very specific (and will be removed in a few versions), I would keep it as it is now. Besides, I already check in the metaclass init if the base is a subtype of list (which mypy would guarantee) so really not necessary to think too much about it IMO.

Let's pin the mypy version, it's good practice anyway :)

@Wauplin Wauplin merged commit b4003b8 into main Nov 8, 2022
@Wauplin Wauplin deleted the fix-mypy-ci branch November 8, 2022 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants