Merge remote-tracking branch 'origin/GP-6744_Dan_addTypeCheckPyPackageTask--SQUASHED'

This commit is contained in:
Ryan Kurtz
2026-04-22 12:45:36 -04:00
6 changed files with 56 additions and 20 deletions

View File

@@ -41,6 +41,10 @@ tasks.assemblePyPackage {
}
}
tasks.typeCheckPyPackage {
environment("PYTHONPATH", project(":Debugger-rmi-trace").file("build/pypkg/src"))
}
task buildTlb(type: Exec) {
def tmpBatch = file("build/buildTlb.bat")

View File

@@ -26,3 +26,7 @@ dependencies {
// Only for Help :/
api project(':Debugger-rmi-trace')
}
tasks.typeCheckPyPackage {
environment("PYTHONPATH", project(":Debugger-rmi-trace").file("build/pypkg/src"))
}

View File

@@ -26,3 +26,7 @@ dependencies {
// Only for Help :/
api project(':Debugger-rmi-trace')
}
tasks.typeCheckPyPackage {
environment("PYTHONPATH", project(":Debugger-rmi-trace").file("build/pypkg/src"))
}

View File

@@ -27,3 +27,7 @@ dependencies {
api project(':Debugger-rmi-trace')
api project(':Debugger-agent-gdb')
}
tasks.typeCheckPyPackage {
environment("PYTHONPATH", project(":Debugger-rmi-trace").file("build/pypkg/src"))
}

View File

@@ -28,6 +28,6 @@ dependencies {
api project(':Debugger-rmi-trace')
}
tasks.assemblePyPackage {
tasks.typeCheckPyPackage {
environment("PYTHONPATH", project(":Debugger-rmi-trace").file("build/pypkg/src"))
}

View File

@@ -24,16 +24,16 @@ eclipse.project {
}
ext.findPyDep = { name ->
File inDeps = file("${DEPS_DIR}/${project.name}/${name}")
File inRepo = file("${BIN_REPO}/ExternalPyWheels/${name}")
if (inDeps.exists()) {
return inDeps
}
if (inRepo.exists()) {
return inRepo
}
println("Warning: Could not find '${name}' for ${project.name}")
return inDeps
File inDeps = file("${DEPS_DIR}/${project.name}/${name}")
File inRepo = file("${BIN_REPO}/ExternalPyWheels/${name}")
if (inDeps.exists()) {
return inDeps
}
if (inRepo.exists()) {
return inRepo
}
println("Warning: Could not find '${name}' for ${project.name}")
return inDeps
}
task assemblePyPackage(type: Copy) {
@@ -41,6 +41,26 @@ task assemblePyPackage(type: Copy) {
into "build/pypkg/"
}
task typeCheckPyPackage(type: Exec) {
dependsOn assemblePyPackage
inputs.files(assemblePyPackage)
doFirst {
if (rootProject.PYTHON3 == null) {
throw new GradleException("A supported version of Python [${PYTHON_SUPPORTED}] was not found!")
}
file("build/pypkg/src").listFiles().each { pkg ->
if (pkg.isDirectory() && new File(pkg, "__init__.py").isFile()) {
args "-p", pkg.name
}
}
}
workingDir { file("build/pypkg/src") }
commandLine rootProject.PYTHON3
args "-m", "mypy"
}
task buildPyPackage {
dependsOn assemblePyPackage
ext.dist = { file("build/pypkg/dist") }
@@ -95,12 +115,12 @@ ext.distributePyDep = { name ->
wheelFiles = new HashSet<>()
PYTHON_DEPS.put(project, wheelFiles)
}
File dep = findPyDep(name)
wheelFiles.add(dep)
def zipPath = getZipPath(project)
rootProject.assembleDistribution {
into ("${zipPath}/pypkg/dist") {
from dep
}
}
File dep = findPyDep(name)
wheelFiles.add(dep)
def zipPath = getZipPath(project)
rootProject.assembleDistribution {
into ("${zipPath}/pypkg/dist") {
from dep
}
}
}