[python] Add the ability to set a Python version for PyCharm Debugger Test

Add Python 3.13.
Fix splitting by Python version

Merge-request: IJ-MR-157990
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>
(cherry picked from commit def8af789fa93a19fc694afaa882cfb5c70e4025)

GitOrigin-RevId: 921b068aa3df0c5d8707a9edfa3b807a3ffb1be2
This commit is contained in:
Egor Eliseev
2025-04-04 17:53:06 +00:00
committed by intellij-monorepo-bot
parent b98b6a2be6
commit d0935cb505
3 changed files with 18 additions and 13 deletions
@@ -42,6 +42,7 @@ val pythonVersionMapping = mapOf(
"3.10" to "3.10.8",
"3.11" to "3.11.0",
"3.12" to "3.12.0",
"3.13" to "3.13.0"
)
val defaultPackages = listOf("virtualenv")
@@ -191,3 +192,7 @@ createPython("python3.12", "3.12",
// set CONDA_PATH to conda binary location to be able to run tests
createPython("conda", "Miniconda3-py312_25.1.1-0", listOf(), listOf("conda"), type = PythonType.CONDA)
createPython("python3.13", "3.13",
listOf(),
listOf("python3.13", "python3"))
@@ -33,13 +33,13 @@ data class PyEnvTestSettings(
@TestOnly
@get:JvmName("getPythons")
internal val pythons: List<File> = foldersWithPythons
.asSequence()
.filter { if (PyTestEnvVars.PYCHARM_PY_VERSION.isSet()) it.name.endsWith(PyTestEnvVars.PYCHARM_PY_VERSION.getValue()!!) else true }
.filter(File::exists)
.flatMap { it.listFiles()?.toList() ?: emptyList() }
.plus(additionalInterpreters)
.filter { it.isDirectory && !it.name.startsWith('.') }
.toList()
.asSequence()
.filter(File::exists)
.flatMap { it.listFiles()?.toList() ?: emptyList() }
.plus(additionalInterpreters)
.filter { if (PyTestEnvVars.PYCHARM_PY_VERSION.isSet()) it.path.contains(PyTestEnvVars.PYCHARM_PY_VERSION.getValue()!!) else true }
.filter { it.isDirectory && !it.name.startsWith('.') }
.toList()
/**
* Configuration in readable format
+6 -6
View File
@@ -131,12 +131,12 @@ public class PyEnvTaskRunner {
}
if (!wasExecuted) {
throw new RuntimeException("test " +
testName +
" was not executed.\n" +
formatCollectionToString(myRoots, "All roots") +
"\n" +
formatCollectionToString(requiredTags, "Required tags in tags.txt in root"));
LOG.warn("test " +
testName +
" was not executed.\n" +
formatCollectionToString(myRoots, "All roots") +
"\n" +
formatCollectionToString(requiredTags, "Required tags in tags.txt in root"));
}
}