Damien Martin-guillerez has uploaded this change for review.
Remove --experimental_python_import_all_repositories The flag is no longer in use. We do not even put it in a graveyard, just kill it ungracefully. Scheduled for 0.5.1 Change-Id: If5594510aa6fee66cbae530acf8c28b2c0df281b --- M src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java M src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java M src/main/java/com/google/devtools/build/lib/bazel/rules/python/stub_template.txt 3 files changed, 3 insertions(+), 25 deletions(-)
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java
index 69023fe..fa5e219 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java
@@ -48,13 +48,6 @@
category = "version",
help = "Local path to the Python3 executable.")
public String python3Path;
-
- @Option(name = "experimental_python_import_all_repositories",
- defaultValue = "false",
- category = "undocumented",
- help = "Do not use.",
- deprecationWarning = "This flag is going to have no effect is the next release, do not use.")
- public boolean experimentalPythonImportAllRepositories;
}
/**
@@ -91,9 +84,5 @@
public String getPython3Path() {
return options.python3Path;
- }
-
- public boolean getImportAllRepositories() {
- return options.experimentalPythonImportAllRepositories;
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
index a913927..06fe867 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
@@ -144,9 +144,7 @@
Substitution.of("%python_binary%", pythonBinary),
Substitution.of("%imports%", Joiner.on(":").join(imports)),
Substitution.of("%workspace_name%", ruleContext.getWorkspaceName()),
- Substitution.of("%is_zipfile%", "False"),
- Substitution.of("%import_all%",
- config.getImportAllRepositories() ? "True" : "False")),
+ Substitution.of("%is_zipfile%", "False")),
true));
} else {
Artifact zipFile = getPythonZipArtifact(ruleContext, executable);
@@ -162,9 +160,7 @@
Substitution.of("%python_binary%", pythonBinary),
Substitution.of("%imports%", Joiner.on(":").join(imports)),
Substitution.of("%workspace_name%", ruleContext.getWorkspaceName()),
- Substitution.of("%is_zipfile%", "True"),
- Substitution.of("%import_all%",
- config.getImportAllRepositories() ? "True" : "False")),
+ Substitution.of("%is_zipfile%", "True")),
true));
ruleContext.registerAction(
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/stub_template.txt
index 0e28ce1..936e35d 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/stub_template.txt
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/stub_template.txt
@@ -99,13 +99,6 @@
zf.extractall(temp_dir)
return os.path.join(temp_dir, ZIP_RUNFILES_DIRECTORY_NAME)
-# Returns repository roots to add to the import path.
-def GetRepositoriesImports(module_space, import_all):
- if import_all:
- repo_dirs = [os.path.join(module_space, d) for d in os.listdir(module_space)]
- return [d for d in repo_dirs if os.path.isdir(d)]
- return [os.path.join(module_space, "%workspace_name%")]
-
def Main():
args = sys.argv[1:]
@@ -118,7 +111,7 @@
python_imports = '%imports%'
python_path_entries = CreatePythonPathEntries(python_imports, module_space)
- python_path_entries += GetRepositoriesImports(module_space, %import_all%)
+ python_path_entries.append(os.path.join(module_space, "%workspace_name%"))
old_python_path = os.environ.get('PYTHONPATH')
python_path = os.pathsep.join(python_path_entries)
To view, visit change 9212. To unsubscribe, visit settings.
Damien Martin-guillerez uploaded patch set #4 to this change.
Remove --experimental_python_import_all_repositories
The flag is no longer in use. We do not even put it in
a graveyard, just kill it ungracefully.
Scheduled for 0.5.1
Fixes #2636.
Change-Id: If5594510aa6fee66cbae530acf8c28b2c0df281b
---
M src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java
M src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
M src/main/java/com/google/devtools/build/lib/bazel/rules/python/stub_template.txt
3 files changed, 3 insertions(+), 25 deletions(-)
To view, visit change 9212. To unsubscribe, visit settings.