Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class PythonInspectorFunTest : StringSpec({
definitionFile = definitionFile,
pythonVersion = "27",
operatingSystem = "linux",
analyzeSetupPyInsecurely = true
analyzeSetupPyInsecurely = true,
verbose = false
)
} finally {
workingDir.resolve(".cache").safeDeleteRecursively()
Expand All @@ -70,7 +71,8 @@ class PythonInspectorFunTest : StringSpec({
definitionFile = definitionFile,
pythonVersion = "311",
operatingSystem = "linux",
analyzeSetupPyInsecurely = false
analyzeSetupPyInsecurely = false,
verbose = false
)
} finally {
workingDir.resolve(".cache").safeDeleteRecursively()
Expand Down
11 changes: 9 additions & 2 deletions plugins/package-managers/python/src/main/kotlin/Pip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ data class PipConfig(
* The Python version to resolve dependencies for. If not set, the version is detected from the environment and if
* that fails, the default version is used.
*/
val pythonVersion: String?
val pythonVersion: String?,

/**
* If "true", enables verbose logging in `python-inspector`.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the KDoc warn about the plaintext passwords being logged?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a section in the commit message to be cautions when enabling this option, especially until python-inspector does do no masking of the password.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add it to this code comment. It's too hidden in the commit message for such an important note.

@OrtPluginOption(defaultValue = "false")
val pythonInspectorVerbose: Boolean
)

/**
Expand Down Expand Up @@ -125,7 +131,8 @@ class Pip internal constructor(
definitionFile = definitionFile,
pythonVersion = pythonVersion.split('.', limit = 3).take(2).joinToString(""),
operatingSystem = config.operatingSystem,
analyzeSetupPyInsecurely = config.analyzeSetupPyInsecurely
analyzeSetupPyInsecurely = config.analyzeSetupPyInsecurely,
verbose = config.pythonInspectorVerbose
)
} finally {
workingDir.resolve(".cache").safeDeleteRecursively()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ internal object PythonInspector : CommandLineTool {
definitionFile: File,
pythonVersion: String,
operatingSystem: String,
analyzeSetupPyInsecurely: Boolean
analyzeSetupPyInsecurely: Boolean,
verbose: Boolean
): Result {
val outputFile = createOrtTempFile(prefix = "python-inspector", suffix = ".json")

Expand All @@ -81,6 +82,10 @@ internal object PythonInspector : CommandLineTool {
add("--analyze-setup-py-insecurely")
}

if (verbose) {
add("--verbose")
}

if (definitionFile.name == "setup.py") {
add("--setup-py")
} else {
Expand Down
Loading