-
Notifications
You must be signed in to change notification settings - Fork 376
Delete python dependency installation code #2224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c7eea24
9ba21c3
d829366
6ab7733
e0bc6b7
f0a5e52
4e8e343
e6b2c0d
fcdff8b
bcb5e6e
e94a917
d33e751
3f0cb87
1401586
1f8d877
746a1af
7c23a5e
3d026bc
dd2106d
218c52e
33e3a7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
I've left a few warning logging cases, but overall this feature is no longer supported.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,11 @@ import { EnvVar } from "./environment"; | |
import { | ||
Feature, | ||
Features, | ||
isPythonDependencyInstallationDisabled, | ||
} from "./feature-flags"; | ||
import { | ||
checkInstallPython311, | ||
initCodeQL, | ||
initConfig, | ||
installPythonDeps, | ||
runInit, | ||
} from "./init"; | ||
import { Language } from "./languages"; | ||
|
@@ -294,24 +292,6 @@ async function run() { | |
); | ||
|
||
await checkInstallPython311(config.languages, codeql); | ||
|
||
if ( | ||
config.languages.includes(Language.python) && | ||
getRequiredInput("setup-python-dependencies") === "true" | ||
) { | ||
if (await isPythonDependencyInstallationDisabled(codeql, features)) { | ||
logger.info("Skipping python dependency installation"); | ||
} else { | ||
try { | ||
await installPythonDeps(codeql, logger); | ||
} catch (unwrappedError) { | ||
const error = wrapError(unwrappedError); | ||
logger.warning( | ||
`${error.message} You can call this action with 'setup-python-dependencies: false' to disable this process`, | ||
); | ||
} | ||
} | ||
} | ||
} catch (unwrappedError) { | ||
const error = wrapError(unwrappedError); | ||
core.setFailed(error.message); | ||
|
@@ -462,18 +442,21 @@ async function run() { | |
} | ||
} | ||
|
||
// Disable Python dependency extraction if feature flag set | ||
if (await isPythonDependencyInstallationDisabled(codeql, features)) { | ||
// Disable Python dependency extraction if feature flag set From 2.16.0 the default | ||
// for the python extractor is to not perform any library extraction. For versions | ||
// before that, you needed to set this flag to enable this behavior (supported since | ||
// 2.13.1). Since dependency installation is no longer supported in the action, we | ||
|
||
if (await codeQlVersionAbove(codeql, "2.16.0")) { | ||
// do nothing | ||
} else if (await codeQlVersionAbove(codeql, "2.13.1")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this a separate case to 2.16.0? Does the CLI generally expect that dependency extraction is enabled for CodeQL 2.13.1 and later but not 2.16.0 and later? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, spot on! From 2.16.0 until 2.17.1, if the enrivonment variable is not set, the extractor will print a warning about this (which I wanted to suppress in codeql-action logs). I guess my thinking was that once we drop support for the last |
||
core.exportVariable( | ||
"CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION", | ||
"true", | ||
); | ||
} else { | ||
// From 2.16.0 the default for the python extractor is to not perform any library | ||
// extraction, so we need to set this flag to enable it. | ||
core.exportVariable( | ||
"CODEQL_EXTRACTOR_PYTHON_FORCE_ENABLE_LIBRARY_EXTRACTION_UNTIL_2_17_0", | ||
"true", | ||
logger.warning( | ||
"codeql-action no longer installs Python dependencies. We recommend upgrading to at least CodeQL 2.16.0 to avoid any potential problems due to this.", | ||
); | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.