Support for mypy
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 603
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
I have a Python 3 project which uses type annotations. I wanted to be able to run mypy over my code as a standard code quality check. @ethankhall and @zvezdan helped me add some code to my build.gradle file to make this happen, and I've been happy with it so far. I'm not sure of the best way to integrated this into pygradle by default, so for now I'll open this ticket and include the code inline.
class MyPy extends com.linkedin.gradle.python.tasks.AbstractPythonMainSourceDefaultTask {
void preExecution() {
args(pythonDetails.virtualEnvironment.findExecutable('mypy').absolutePath)
args('--ignore-missing-imports', 'src')
}
void processResults(org.gradle.process.ExecResult results) {
}
}
// We want the check task to always run mypy too.
task mypy(type: MyPy)
check.dependsOn(mypy)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the inline build.gradle example and inspect how pygradle currently defines Python tasks and the standard check task. Determine how mypy should be integrated by default without requiring project-local task code. Done means a documented default integration runs mypy as part of the standard check workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100