Skip to content

Commit 8c2d3c5

Browse files
committed
rename python.envVars to more common python.environment
1 parent db998b2 commit 8c2d3c5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/groovy/ru/vyarus/gradle/plugin/python/PythonExtension.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PythonExtension {
3232
* System environment variables for executed python process (variables specified in gradle's
3333
* {@link org.gradle.process.ExecSpec#environment(java.util.Map)} during python process execution).
3434
*/
35-
Map<String, Object> envVars = [:]
35+
Map<String, Object> environment = [:]
3636

3737
/**
3838
* Minimal required python version. Full format: "major.minor.micro". Any precision could be used, for example:
@@ -218,8 +218,8 @@ class PythonExtension {
218218
* @param var variable name
219219
* @param value variable value
220220
*/
221-
void envVar(String var, Object value) {
222-
envVars.put(var, value)
221+
void environment(String var, Object value) {
222+
environment.put(var, value)
223223
}
224224

225225
/**

src/main/groovy/ru/vyarus/gradle/plugin/python/PythonPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class PythonPlugin implements Plugin<Project> {
8181
pythonPath = { extension.pythonPath }
8282
pythonBinary = { extension.pythonBinary }
8383
// important to copy map because each task must have independent instance
84-
environment = { extension.envVars ? new HashMap<>(extension.envVars) : null }
84+
environment = { extension.environment ? new HashMap<>(extension.environment) : null }
8585
}
8686
// all python tasks must be executed after check task to use correct environment (switch to virtualenv)
8787
if (task.taskIdentity.type != CheckPythonTask) {

src/test/groovy/ru/vyarus/gradle/plugin/python/task/PythonTaskEnvironmentKitTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class PythonTaskEnvironmentKitTest extends AbstractKitTest {
9494
id 'ru.vyarus.use-python'
9595
}
9696
97-
python.envVar 'some', 1
97+
python.environment 'some', 1
9898
9999
task sample(type: PythonTask) {
100100
command = "-c \\"import os;print('variables: '+os.getenv('some', 'null')+' '+os.getenv('foo', 'null'))\\""

0 commit comments

Comments
 (0)