diff --git a/FWCore/ParameterSet/bin/edmWriteConfigs.cpp b/FWCore/ParameterSet/bin/edmWriteConfigs.cpp index b056ed9074eb1..a961cb90eddf4 100644 --- a/FWCore/ParameterSet/bin/edmWriteConfigs.cpp +++ b/FWCore/ParameterSet/bin/edmWriteConfigs.cpp @@ -135,20 +135,6 @@ namespace { pluginNames.push_back(nameAndType.first); } } - - void writeModulesFile() { - if (std::filesystem::exists(std::filesystem::current_path() / "modules.py")) - return; - std::array buffer; - std::tmpnam(buffer.data()); - std::ofstream file{buffer.data()}; - - file << "from FWCore.ParameterSet.ModulesProxy import _setupProxies\n" - "locals().update(_setupProxies(__file__))\n"; - file.close(); - std::filesystem::copy(buffer.data(), "modules.py"); - std::filesystem::remove(buffer.data()); - } } // namespace int main(int argc, char** argv) try { @@ -303,9 +289,6 @@ int main(int argc, char** argv) try { std::set usedCfiFileNames; edm::for_all(pluginNames, std::bind(&writeCfisForPlugin, _1, factory, std::ref(usedCfiFileNames))); - if (not pluginNames.empty()) { - writeModulesFile(); - } }); } catch (cms::Exception& iException) { if (!library.empty()) { diff --git a/FWCore/ParameterSet/templates/modules.py b/FWCore/ParameterSet/templates/modules.py new file mode 100644 index 0000000000000..216a370e0839b --- /dev/null +++ b/FWCore/ParameterSet/templates/modules.py @@ -0,0 +1,2 @@ +from FWCore.ParameterSet.ModulesProxy import _setupProxies +locals().update(_setupProxies(__file__)) \ No newline at end of file