Fix import/read verification when encountering glob wildcards (#1559)

Fixes an issue where the import verifier can possibly throw when
packaging on Windows due to `*` being an invalid filename.
This commit is contained in:
Daniel Chao
2026-04-29 20:20:49 -07:00
committed by GitHub
parent df063f17f3
commit 4a25320995
2 changed files with 45 additions and 7 deletions
@@ -763,6 +763,43 @@ class CliProjectPackagerTest {
)
}
@Test
fun `import path verification with glob imports`(@TempDir tempDir: Path) {
tempDir.writeFile(
"main.pkl",
"""
import* "**.pkl" as foo
res = foo
"""
.trimIndent(),
)
tempDir.writeFile(
"PklProject",
"""
amends "pkl:Project"
package {
name = "mypackage"
version = "1.0.0"
baseUri = "package://example.com/mypackage"
packageZipUrl = "https://foo.com"
}
"""
.trimIndent(),
)
CliProjectPackager(
CliBaseOptions(workingDir = tempDir),
listOf(tempDir),
CliTestOptions(),
".out/%{name}@%{version}",
skipPublishCheck = true,
consoleWriter = StringWriter(),
)
.run()
}
@Test
@DisabledOnOs(OS.WINDOWS)
fun `import path verification -- absolute read from root dir`(@TempDir tempDir: Path) {