mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
PY-60410 fix hatch cli tests (Hatch has changed own outputs in the latest release)
GitOrigin-RevId: fba9e2ee1afeded13044e7a08602eb71270d9ab9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
198ad2af6f
commit
b1b1d701bc
@@ -15,6 +15,7 @@ import com.jetbrains.python.errorProcessing.PyResult
|
||||
import io.github.z4kn4fein.semver.Version
|
||||
import io.github.z4kn4fein.semver.VersionFormatException
|
||||
import java.io.IOException
|
||||
import java.nio.file.InvalidPathException
|
||||
import java.nio.file.Path
|
||||
|
||||
/**
|
||||
@@ -189,7 +190,7 @@ class HatchCli(private val runtime: HatchRuntime) {
|
||||
try {
|
||||
Result.success(HatchStatus(project, Path.of(location), Path.of(config)))
|
||||
}
|
||||
catch (e: Exception) {
|
||||
catch (e: InvalidPathException) {
|
||||
Result.failure(e.localizedMessage)
|
||||
}
|
||||
}
|
||||
@@ -224,7 +225,7 @@ class HatchCli(private val runtime: HatchRuntime) {
|
||||
* @return OldVersion to NewVersion as Pair
|
||||
*/
|
||||
suspend fun setVersion(desiredVersion: String): PyResult<Pair<Version, Version>> {
|
||||
val expectedOutput = """^Old: (.*)\nNew: (.*)\n$""".toRegex()
|
||||
val expectedOutput = """^(?:.*\n)*Old: (.*)\nNew: (.*)\n?$""".toRegex()
|
||||
|
||||
return runtime.executeAndMatch("version", desiredVersion, expectedOutput = expectedOutput, outputContentSupplier = { it.stderrString }) { matchResult ->
|
||||
val (oldVersion, newVersion) = matchResult.destructured
|
||||
|
||||
@@ -116,7 +116,7 @@ const val ENV_TYPE_VIRTUAL: String = "virtual"
|
||||
*/
|
||||
class HatchEnv(runtime: HatchRuntime) : HatchCommand("env", runtime) {
|
||||
companion object {
|
||||
private val SHOW_RESPONSE_REGEX = """^\s+Standalone\s*\n((?:[+|].*[+|]\n)+)(?:\s+Matrices\s*\n((?:[+|].*[+|]\n)+))?$""".toRegex()
|
||||
private val SHOW_RESPONSE_REGEX = """^\s*Standalone\s*\n((?:[+|].*[+|]\n)+)(?:\s+Matrices\s*\n((?:[+|].*[+|]\n)+))?$""".toRegex()
|
||||
}
|
||||
|
||||
enum class CreateResult {
|
||||
|
||||
Reference in New Issue
Block a user