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

Custom MyPy binary #66

Closed
jonathanberthias opened this issue Mar 2, 2023 · 4 comments · Fixed by #69
Closed

Custom MyPy binary #66

jonathanberthias opened this issue Mar 2, 2023 · 4 comments · Fixed by #69
Assignees
Labels
enhancement New feature or request

Comments

@jonathanberthias
Copy link

When installing dependencies with Poetry, the mypy ... command is not available and instead one should use poetry run mypy ....

It would be nice to be able to add an option for the binary used for the mypy invocation (and potentially an option to skip installing mypy without checking if it is installed).

@tsuyoshicho tsuyoshicho self-assigned this Mar 2, 2023
@tsuyoshicho

This comment was marked as resolved.

@tsuyoshicho
Copy link
Owner

@jonathanberthias san,

Fix action-mypy for using "Poetry".
https://github.com/tsuyoshicho/action-mypy/tree/feature/adaptivesetup

Could you please test this branch?

      - uses: tsuyoshicho/action-mypy@feature/adaptivesetup
        with:
          # your settings
          # ...
          # Poetry support
          execute_command: 'poetry run mypy'
          setup_method: 'nothing'

(Also check the README.)

@tsuyoshicho tsuyoshicho added the enhancement New feature or request label Mar 4, 2023
@jonathanberthias
Copy link
Author

@tsuyoshicho

Thanks for being so quick to reply!

I just tested the branch, and it works exactly as expected! Actually, I didn't need the setup_method change since the poetry run mypy --version command succeeds, and installation is skipped even with the "adaptive" method.

Also, FYI, I can't run poetry shell in GitHub workflows:

Run poetry shell
Spawning shell within /home/runner/work/test-stuff/test-stuff/.venv

(25, 'Inappropriate ioctl for device')
Error: Process completed with exit code 1.

that's why I have to run poetry run mypy explicitly.

@tsuyoshicho
Copy link
Owner

Hi, @jonathanberthias,

Thanks for the report.

I have added setup_method for future use.
I presented the setup for safety, but I'm glad it works with adaptive as well.

I did not know that the poetry shell did not work in Github workflow.
Thanks for letting me know.

I will release it in a minor VerUp.

Regard.
Cho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants