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

Read mypy arguments from config file #9

Closed
vnmabus opened this issue Dec 21, 2020 · 11 comments
Closed

Read mypy arguments from config file #9

vnmabus opened this issue Dec 21, 2020 · 11 comments
Assignees

Comments

@vnmabus
Copy link

vnmabus commented Dec 21, 2020

It appears that mypy arguments in setup.cfg are not read. As a result, the action reports different errors than executing mypy locally.

@tsuyoshicho
Copy link
Owner

Thanks report.

I inv. it.

@tsuyoshicho
Copy link
Owner

Mr @vnmabus ,

Create test branchs.

Test code as same.

setup.cfg see below:

[mypy]
warn_no_return = False

with setup.cfg test do no report Missing return statement.
That's fine.

As far as the results are concerned, it reads setup.cfg and works correctly.

Please your action-mypy setting (filter-mode, mypy_flags...) to check in workflow what you needed.

@vnmabus
Copy link
Author

vnmabus commented Dec 21, 2020

I still do not get what I am doing wrong.

I have this PR: GAA-UAM/scikit-fda#296
In the setup.cfg I have set the option implicit_reexport for mypy, and it works locally.
However action-mypy is still reporting Module '...' has no attribute '...' errors.

The code for the workflow is

name: Mypy

on:
  pull_request:

jobs:
  build:
    runs-on: ubuntu-latest
    name: Mypy
    steps:
    - uses: actions/checkout@v2
    - uses: tsuyoshicho/action-mypy@v1
      with:
        github_token: ${{ secrets.github_token }}
        # Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
        reporter: github-pr-review
        # Change reporter level if you need.
        # GitHub Status Check won't become failure with warning.
        level: warning

@tsuyoshicho
Copy link
Owner

@vnmabus
Copy link
Author

vnmabus commented Dec 21, 2020

But it IS written like that... The mypy section is

[mypy]
strict = True
strict_equality = True
implicit_reexport = True

@tsuyoshicho
Copy link
Owner

Thanks, I tried your repo in local... now

@tsuyoshicho
Copy link
Owner

Tried local, get below:

skfda\representation\_functional_data.py:25:1: error: Module 'skfda._utils' has no attribute '_evaluate_grid'

same as https://github.com/GAA-UAM/scikit-fda/pull/296/files#r546687283

run as mypy --show-column-numbers --strict --strict-equality skfda\_utils\_utils.py

mypy installed global, no-plugin / standalone.

This result seem to be correct.

munnn...

@vnmabus
Copy link
Author

vnmabus commented Dec 21, 2020

I think that I know what is happening here... Your action is calling mypy with flags by default, and the -strict flag takes precedence over the implicit_reexport in the config.

@vnmabus
Copy link
Author

vnmabus commented Dec 21, 2020

I guess that I could change mypy_flags to the empty string and it should work. I am not sure if invoking the tool with arguments by default is the wisest option, since as we have already seen it creates differences between local and repo errors.

@vnmabus
Copy link
Author

vnmabus commented Dec 21, 2020

Changing mypy_flags to the empty string seems to work, you can close this if you want.

@tsuyoshicho
Copy link
Owner

Okay, I understand everything.

  • This issue was closed
  • Rethink the default arguments.

Regards.

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

No branches or pull requests

2 participants