From 7c0bc39eb5b1cf51e364662217bb5fffb088787e Mon Sep 17 00:00:00 2001 From: Emma Lautz Date: Tue, 3 Dec 2019 09:43:18 -0800 Subject: [PATCH] Build configuration again extends from flake8 configuration For backwards compatability, we need to continue to have the build configuration extend from the flake8 configuration. Without this, any dependencies declared as part of the flake8 configuration will be excluded from the build requirements and thus excluded from the activatable virtual environment. --- .../com/linkedin/gradle/python/plugin/PythonPlugin.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/plugin/PythonPlugin.java b/pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/plugin/PythonPlugin.java index db345d0a..3ad544d5 100644 --- a/pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/plugin/PythonPlugin.java +++ b/pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/plugin/PythonPlugin.java @@ -155,13 +155,16 @@ private static void createConfigurations(Project project) { project.getConfigurations().create(CONFIGURATION_BOOTSTRAP_REQS.getValue()); project.getConfigurations().create(CONFIGURATION_SETUP_REQS.getValue()); - project.getConfigurations().create(CONFIGURATION_BUILD_REQS.getValue()); + Configuration buildReq = project.getConfigurations().create(CONFIGURATION_BUILD_REQS.getValue()); project.getConfigurations().create(CONFIGURATION_PYDOCS.getValue()); project.getConfigurations().create(CONFIGURATION_TEST.getValue()); project.getConfigurations().create(CONFIGURATION_VENV.getValue()); project.getConfigurations().create(CONFIGURATION_WHEEL.getValue()); - // TODO: Kept for compatibility. Remove when not needed (very soon). - project.getConfigurations().create("flake8"); + // TODO: Kept for backwards compatibility. Remove when not needed (very soon). + // Even though flake8 is no longer in its own virtual env, users may still be adding libraries through the + // flake8 configuration, which still needs to be added to the build config so those libraries exist in the venv. + Configuration flake8 = project.getConfigurations().create("flake8"); + buildReq.extendsFrom(flake8); } /*