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

CI: mypy: Fix missing stubs for third-party libs #315

Closed

Conversation

rafaellehmkuhl
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl commented Jun 8, 2021

Mypy doesn't install stubs for third-party libraries anymore by default, like explained on the following article:

https://mypy-lang.blogspot.com/2021/05/the-upcoming-switch-to-modular-typeshed.html

Fix #315

@rafaellehmkuhl
Copy link
Member Author

rafaellehmkuhl commented Jun 8, 2021

I don't have a clue on what's happening. This is the recommended argument. It's also giving segfault on my computer.

Directly installing types-requests is a option, but I want to avoid it so we don't need to maintain it for every single lib.

Tracking here.

@rafaellehmkuhl
Copy link
Member Author

Ok, wheels are broken.

@rafaellehmkuhl
Copy link
Member Author

New problem: --install-types demands user-input. Issue opened on mypy repo. Will take time to be implemented, anyway, so we need an alternative path.

@rafaellehmkuhl rafaellehmkuhl changed the title CI: mypy: Add --install-types argument to fix missing stubs CI: mypy: Fix missing stubs for third-party libs Jun 8, 2021
@@ -31,6 +31,9 @@ jobs:
pip install pyfakefs pytest-cov pytest-timeout pylint mypy isort black asyncmock
find . -type f -name "setup.py" | xargs --max-lines=1 --replace=% python % install --user

# Install necessary typesheds for mypy tests
pip install types-requests
Copy link
Member

Choose a reason for hiding this comment

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

It feels that such package should be in the setup.py and not here..
Otherwise we are going to loose track in where the packages come from and if we are still using it.
@Williangalvani what you think ?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can introduce a extra_require section on the setup.py.

extras_require={
        'dev': [
            'types_requests'
        ]
    }

Copy link
Member

Choose a reason for hiding this comment

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

I'm ok with the original solution.

Having it as a dev dependecy sounds nice, but then we need to install each service in this script

@rafaellehmkuhl rafaellehmkuhl force-pushed the fix-mypy-stubs branch 8 times, most recently from 2cb7abf to 5d30ad8 Compare June 9, 2021 17:07
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@rafaellehmkuhl
Copy link
Member Author

Closed in favor of #316

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