diff --git a/LumiBlock/LumiBlockComps/CMakeLists.txt b/LumiBlock/LumiBlockComps/CMakeLists.txt
index b9701ec08cc7c31d8ed9c9d5605efd13451ed16b..425aefec94bd0e654961f2e6bb03e19c755a389a 100644
--- a/LumiBlock/LumiBlockComps/CMakeLists.txt
+++ b/LumiBlock/LumiBlockComps/CMakeLists.txt
@@ -1,7 +1,4 @@
-# $Id: CMakeLists.txt 789876 2016-12-15 13:57:55Z krasznaa $
-################################################################################
-# Package: LumiBlockComps
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( LumiBlockComps )
@@ -79,7 +76,6 @@ atlas_add_test( LumiBlockMuWriterConfig_test
                 SCRIPT python -m LumiBlockComps.LumiBlockMuWriterConfig
                 LOG_SELECT_PATTERN "ComponentAccumulator|^---|^IOVDbSvc" )
 
-
 atlas_add_test( BunchCrossingCondAlg 
                 SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/BunchCrossingCondAlgTest.py
                 POST_EXEC_SCRIPT " /usr/bin/diff BCData.txt ${CMAKE_CURRENT_SOURCE_DIR}/share/BCData.txt.ref > BC_diff.log " )
diff --git a/LumiBlock/LumiBlockData/CMakeLists.txt b/LumiBlock/LumiBlockData/CMakeLists.txt
index 2780e1a0d0d0ec386adf77ad015e58f03b0047d8..6a2ce737d4b33378b961b98fde97bcff57ac8f7f 100644
--- a/LumiBlock/LumiBlockData/CMakeLists.txt
+++ b/LumiBlock/LumiBlockData/CMakeLists.txt
@@ -1,32 +1,20 @@
-################################################################################
-# Package: LumiBlockData
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( LumiBlockData )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/AthenaKernel
-                          Control/AthContainers )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_library( LumiBlockData
                    src/*.cxx
                    PUBLIC_HEADERS LumiBlockData
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES AthenaKernel AthContainers
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
+                   LINK_LIBRARIES AthenaKernel AthContainers )
 
 atlas_add_dictionary( LumiBlockDataDict
                       LumiBlockData/LumiBlockDataDict.h
                       LumiBlockData/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel AthContainers LumiBlockData )
+                      LINK_LIBRARIES LumiBlockData )
 
+# Tests in the package:
 atlas_add_test( LBDurationCondData_test
   SOURCES test/LBDurationCondData_test.cxx
   LINK_LIBRARIES LumiBlockData )
@@ -38,4 +26,3 @@ atlas_add_test( LuminosityCondData_test
 atlas_add_test( TrigLiveFractionCondData_test
   SOURCES test/TrigLiveFractionCondData_test.cxx
   LINK_LIBRARIES LumiBlockData )
-
diff --git a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/CMakeLists.txt b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/CMakeLists.txt
index 74c4af4064ba708ba722748658c726cc013f702a..e78f30137050afba1da2525b72823d9cc9b4de43 100644
--- a/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/CMakeLists.txt
+++ b/LumiBlock/LumiBlockPers/LumiBlockAthenaPool/CMakeLists.txt
@@ -1,21 +1,10 @@
-################################################################################
-# Package: LumiBlockAthenaPool
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( LumiBlockAthenaPool )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Database/AthenaPOOL/AthenaPoolUtilities
-                          PRIVATE
-                          Database/AthenaPOOL/AthenaPoolCnvSvc
-                          LumiBlock/LumiBlockData
-                          LumiBlock/LumiBlockPers/LumiBlockTPCnv )
-
 # Component(s) in the package:
 atlas_add_poolcnv_library( LumiBlockAthenaPoolPoolCnv
                            src/*.cxx
                            FILES LumiBlockData/LumiBlockCollection.h
-                           LINK_LIBRARIES AthenaPoolUtilities AthenaPoolCnvSvcLib LumiBlockData LumiBlockTPCnv )
-
+                           LINK_LIBRARIES AthenaPoolCnvSvcLib LumiBlockData LumiBlockTPCnv )
diff --git a/LumiBlock/LumiBlockPers/LumiBlockTPCnv/CMakeLists.txt b/LumiBlock/LumiBlockPers/LumiBlockTPCnv/CMakeLists.txt
index d3149bdcaadd14aea3d13624ceafd8de563fd566..f10c12a5cae2a90e302836334ee04185943f7334 100644
--- a/LumiBlock/LumiBlockPers/LumiBlockTPCnv/CMakeLists.txt
+++ b/LumiBlock/LumiBlockPers/LumiBlockTPCnv/CMakeLists.txt
@@ -1,44 +1,27 @@
-################################################################################
-# Package: LumiBlockTPCnv
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( LumiBlockTPCnv )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Database/AthenaPOOL/AthenaPoolCnvSvc
-                          LumiBlock/LumiBlockData
-                          PRIVATE
-                          AtlasTest/TestTools
-                          Control/AthenaKernel
-                          GaudiKernel )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
 # Component(s) in the package:
 atlas_add_tpcnv_library( LumiBlockTPCnv
                          src/*.cxx
                          PUBLIC_HEADERS LumiBlockTPCnv
-                         PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                         LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LumiBlockData TestTools AthenaKernel GaudiKernel )
+                         LINK_LIBRARIES AthenaPoolCnvSvcLib LumiBlockData
+                         PRIVATE_LINK_LIBRARIES AthenaKernel )
 
 atlas_add_dictionary( LumiBlockTPCnvDict
                       LumiBlockTPCnv/LumiBlockTPCnvDict.h
                       LumiBlockTPCnv/selection.xml
-                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LumiBlockData TestTools AthenaKernel GaudiKernel LumiBlockTPCnv )
+                      LINK_LIBRARIES LumiBlockTPCnv )
 
+# Tests in the package:
 atlas_add_test( LumiBlockRangeCnv_p1_test
                 SOURCES
                 test/LumiBlockRangeCnv_p1_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LumiBlockData TestTools AthenaKernel GaudiKernel LumiBlockTPCnv )
+                LINK_LIBRARIES GaudiKernel TestTools LumiBlockTPCnv )
 
 atlas_add_test( LumiBlockRangeCnv_p2_test
                 SOURCES
                 test/LumiBlockRangeCnv_p2_test.cxx
-                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib LumiBlockData TestTools AthenaKernel GaudiKernel LumiBlockTPCnv )
-
+                LINK_LIBRARIES GaudiKernel TestTools LumiBlockTPCnv )
diff --git a/LumiBlock/LumiBlockPers/LumiBlockTPCnv/LumiBlockTPCnv/ATLAS_CHECK_THREAD_SAFETY b/LumiBlock/LumiBlockPers/LumiBlockTPCnv/LumiBlockTPCnv/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..a65d0161f5c143a254c890d8bfddf1ca52de4012
--- /dev/null
+++ b/LumiBlock/LumiBlockPers/LumiBlockTPCnv/LumiBlockTPCnv/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+LumiBlock/LumiBlockPers/LumiBlockTPCnv
diff --git a/LumiBlock/LumiCalc/CMakeLists.txt b/LumiBlock/LumiCalc/CMakeLists.txt
index 1584f11bae745defb28d5cb39b9dc28a5c22dad6..ed5dec99e7e1399cec274cec877cf5b4c1885369 100644
--- a/LumiBlock/LumiCalc/CMakeLists.txt
+++ b/LumiBlock/LumiCalc/CMakeLists.txt
@@ -1,27 +1,10 @@
-################################################################################
-# Package: LumiCalc
-################################################################################
+# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 
 # Declare the package name:
 atlas_subdir( LumiCalc )
 
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Control/CxxUtils
-                          Control/AthenaKernel
-                          DataQuality/GoodRunsLists
-                          Event/xAOD/xAODLuminosity
-                          LumiBlock/LumiBlockData
-                          PRIVATE
-                          Control/DataModelRoot
-                          Database/APR/CollectionBase
-                          Database/AthenaPOOL/DBDataModel
-                          Database/CoolConvUtilities
-                          Database/CoraCool )
-
 # External dependencies:
 find_package( COOL COMPONENTS CoolKernel )
-find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
@@ -33,8 +16,7 @@ atlas_add_library( LumiBlockCoolQuery
                    src/LumiBlockCollectionConverter.cxx
                    PUBLIC_HEADERS LumiCalc
                    INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaKernel xAODLuminosity LumiBlockData GoodRunsListsLib
-                   PRIVATE_LINK_LIBRARIES DataModelRoot CollectionBase DBDataModel )
+                   LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} AthenaKernel GoodRunsListsLib LumiBlockData xAODLuminosity )
 
 atlas_add_executable( iLumiCalc
                       src/iLumiCalc.cxx
@@ -43,10 +25,9 @@ atlas_add_executable( iLumiCalc
                       src/LumiBlockRangeContainerConverter.cxx
                       src/LumiCalculator.cxx
                       src/ReplicaSorter.cxx
-                      INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${COOL_LIBRARIES} ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} AthenaKernel GoodRunsListsLib xAODLuminosity LumiBlockData DataModelRoot CollectionBase DBDataModel LumiBlockCoolQuery )
+                      LINK_LIBRARIES LINK_LIBRARIES CollectionBase CxxUtils DBDataModel DataModelRoot LumiBlockCoolQuery )
 
 # Install files from the package:
-atlas_install_python_modules( python/*.py )
+atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
 atlas_install_scripts( share/*.py )
 
diff --git a/LumiBlock/LumiCalc/python/LumiCalcHtml.py b/LumiBlock/LumiCalc/python/LumiCalcHtml.py
index 6f5bf2e68586e190a9102b886241eeccdc58060d..c54e3be9fcad2a119ddac8d69eeb0e680abb7d69 100755
--- a/LumiBlock/LumiCalc/python/LumiCalcHtml.py
+++ b/LumiBlock/LumiCalc/python/LumiCalcHtml.py
@@ -151,7 +151,7 @@ class LumiCalc:
         if self.fileitem.filename:
 
             # strip any leading C: from windows
-            if self.fileitem.filename[0:2] is 'C:':
+            if self.fileitem.filename[0:2] == 'C:':
                 self.fileitem.filename = self.fileitem.filename[2:]
             # strip leading path from file name to avoid directory traversal attacks
             self.grlfn = os.path.basename(self.fileitem.filename)
@@ -226,23 +226,23 @@ class LumiCalc:
 #
     def parseOutput(self):
         
-        matchrun = re.compile('Run ([0-9]+) LB \[([0-9]+)-([0-9]+)\]')
-        matchlumidel = re.compile(': IntL delivered \(ub\^-1\) : ([0-9\.e+]+)')
-        matchlumipre = re.compile(': IntL after livefraction \(ub\^-1\):  ([0-9\.\e\+\-]+)')
-        matchlumilar = re.compile(': IntL after LAr fraction \(ub\^-1\):  ([0-9\.\e\+\-]+)')
-        matchlumirec = re.compile(': IntL recorded after prescale \(ub\^-1\) : ([0-9\.\e\+\-]+)')
-        matchgoodlb = re.compile(': Good LBs     : ([0-9]+)')
-        matchbadlb = re.compile(': Bad LBs      : ([0-9]+)')
-
-        matchtotlumidel = re.compile(': Total IntL delivered \(ub\^-1\) : ([0-9\.\e\+\-]+)')
-        matchtotlumipre = re.compile(': Total IntL after livefraction \(ub\^-1\):  ([0-9\.\e\+\-]+)')
-        matchtotlumilar = re.compile(': Total IntL after LAr fraction \(ub\^-1\):  ([0-9\.\e\+\-]+)')
-        matchtotlumirec = re.compile(': Total IntL recorded \(ub\^-1\) : ([0-9\.\e\+\-]+)')
-        matchtotgoodlb = re.compile(': Total Good LBs     : ([0-9]+)')
-        matchtotbadlb = re.compile(': Total Bad LBs     : ([0-9]+)')
-
-        matchrealtime = re.compile(': Real time: ([0-9\.\e\+\-]+)')
-        matchcputime = re.compile(': CPU time:  ([0-9\.\e\+\-]+)')
+        matchrun = re.compile(r'Run ([0-9]+) LB \[([0-9]+)-([0-9]+)\]')
+        matchlumidel = re.compile(r': IntL delivered \(ub\^-1\) : ([0-9\.e+]+)')
+        matchlumipre = re.compile(r': IntL after livefraction \(ub\^-1\):  ([0-9\.\e\+\-]+)')
+        matchlumilar = re.compile(r': IntL after LAr fraction \(ub\^-1\):  ([0-9\.\e\+\-]+)')
+        matchlumirec = re.compile(r': IntL recorded after prescale \(ub\^-1\) : ([0-9\.\e\+\-]+)')
+        matchgoodlb = re.compile(r': Good LBs     : ([0-9]+)')
+        matchbadlb = re.compile(r': Bad LBs      : ([0-9]+)')
+
+        matchtotlumidel = re.compile(r': Total IntL delivered \(ub\^-1\) : ([0-9\.\e\+\-]+)')
+        matchtotlumipre = re.compile(r': Total IntL after livefraction \(ub\^-1\):  ([0-9\.\e\+\-]+)')
+        matchtotlumilar = re.compile(r': Total IntL after LAr fraction \(ub\^-1\):  ([0-9\.\e\+\-]+)')
+        matchtotlumirec = re.compile(r': Total IntL recorded \(ub\^-1\) : ([0-9\.\e\+\-]+)')
+        matchtotgoodlb = re.compile(r': Total Good LBs     : ([0-9]+)')
+        matchtotbadlb = re.compile(r': Total Bad LBs     : ([0-9]+)')
+
+        matchrealtime = re.compile(r': Real time: ([0-9\.\e\+\-]+)')
+        matchcputime = re.compile(r': CPU time:  ([0-9\.\e\+\-]+)')
 
         self.runset = set()
         self.lumidel = dict()
diff --git a/LumiBlock/LumiCalc/python/LumiCalcRecover.py b/LumiBlock/LumiCalc/python/LumiCalcRecover.py
index f494c80ca99b0679d74f82c256d404416013692e..1b2e7048e24b8ef3b73ce2a1b9b0b3fe92d32778 100755
--- a/LumiBlock/LumiCalc/python/LumiCalcRecover.py
+++ b/LumiBlock/LumiCalc/python/LumiCalcRecover.py
@@ -20,7 +20,7 @@ lc.workdir = os.getcwd()
 lc.subdir = os.path.basename(os.path.normpath(lc.workdir))
 try:
     lc.grlfn = os.path.basename(glob.glob(lc.workdir+'/*.xml')[0])
-except:
+except Exception:
     lc.grlfn = ''
 
 lc.f = open(lc.workdir+'/working.html', 'a')
diff --git a/LumiBlock/LumiCalc/python/LumiCalcWorking.py b/LumiBlock/LumiCalc/python/LumiCalcWorking.py
index 59f89221c630b0ce987c572dccd921bf0cbea1d8..a2b1f9214135c82f390ae082717c3ea5e53c2436 100755
--- a/LumiBlock/LumiCalc/python/LumiCalcWorking.py
+++ b/LumiBlock/LumiCalc/python/LumiCalcWorking.py
@@ -4,7 +4,6 @@
 
 from __future__ import print_function
 
-import cgi, os, sys
 import glob
 import cgitb
 import subprocess