From b178fe043c6dbb1b50db00509f2dd59ac50425ff Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Mon, 11 Sep 2023 14:43:39 +0200 Subject: [PATCH] Make sure pre-commit runs on main branch (#528) --- .github/workflows/pre-commit.yml | 2 +- README.md | 2 +- packages/k4projecttemplate/package.py | 2 +- packages/k4simdelphes/package.py | 2 +- packages/key4hep-stack-test/package.py | 10 ++++++++-- packages/key4hep-stack/common.py | 18 +++++++++++------- packages/key4hep-stack/package.py | 7 +++++-- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 7f9f70b7..759ab4ae 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -3,7 +3,7 @@ name: pre-commit on: pull_request: push: - branches: [release] + branches: [main] jobs: pre-commit: diff --git a/README.md b/README.md index 14f1a15d..6ea4eb44 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ OpenGL implementation that can be installed: ``` bash yum install -y mesa-libGL mesa-libGL-devel mesa-libGLU mesa-libGLU-devel # Centos 7 -apt install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa libglu1-mesa-dev # Ubuntu +apt install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa libglu1-mesa-dev # Ubuntu dnf install -y mesa-libGL mesa-libGL-devel mesa-libGLU mesa-libGLU-devel # AlmaLinux 9 ``` diff --git a/packages/k4projecttemplate/package.py b/packages/k4projecttemplate/package.py index a25e5e67..b321bfc7 100644 --- a/packages/k4projecttemplate/package.py +++ b/packages/k4projecttemplate/package.py @@ -45,4 +45,4 @@ def setup_run_environment(self, env): env.set("K4PROJECTTEMPLATE", self.prefix.share.k4ProjectTemplate) # def setup_build_environment(self, env): - # k4_setup_env_for_framework_tests(self.spec, env) + # k4_setup_env_for_framework_tests(self.spec, env) diff --git a/packages/k4simdelphes/package.py b/packages/k4simdelphes/package.py index d9f999a1..d8e93862 100644 --- a/packages/k4simdelphes/package.py +++ b/packages/k4simdelphes/package.py @@ -107,4 +107,4 @@ def setup_run_environment(self, env): env.prepend_path("PYTHONPATH", self.prefix.python) # def setup_build_environment(self, env): - # k4_setup_env_for_framework_tests(self.spec, env) + # k4_setup_env_for_framework_tests(self.spec, env) diff --git a/packages/key4hep-stack-test/package.py b/packages/key4hep-stack-test/package.py index 02255afc..d6f9172a 100644 --- a/packages/key4hep-stack-test/package.py +++ b/packages/key4hep-stack-test/package.py @@ -7,7 +7,11 @@ # without creation of a new module import sys -sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'key4hep-stack')) +sys.path.append( + os.path.join( + os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "key4hep-stack" + ) +) from common import * @@ -62,7 +66,9 @@ def setup_run_environment(self, env): if "podio" in self.spec: env.prepend_path("LD_LIBRARY_PATH", self.spec["podio"].libs.directories[0]) if "edm4hep" in self.spec: - env.prepend_path("LD_LIBRARY_PATH", self.spec["edm4hep"].libs.directories[0]) + env.prepend_path( + "LD_LIBRARY_PATH", self.spec["edm4hep"].libs.directories[0] + ) if "lcio" in self.spec: env.prepend_path("LD_LIBRARY_PATH", self.spec["lcio"].libs.directories[0]) diff --git a/packages/key4hep-stack/common.py b/packages/key4hep-stack/common.py index 3130bd97..dd970dce 100644 --- a/packages/key4hep-stack/common.py +++ b/packages/key4hep-stack/common.py @@ -31,13 +31,16 @@ from shlex import quote as cmd_quote # List of env variables that will NOT be set -IGNORE_VARS = set([ - # Fix CMP0144 warnings: https://github.com/key4hep/key4hep-spack/issues/525 - "BOOST_ROOT", - "SPACK_LOADED_HASHES", - # this fixes loading the local emacs: https://github.com/key4hep/key4hep-spack/issues/486 - "XDG_DATA_DIRS", -]) +IGNORE_VARS = set( + [ + # Fix CMP0144 warnings: https://github.com/key4hep/key4hep-spack/issues/525 + "BOOST_ROOT", + "SPACK_LOADED_HASHES", + # this fixes loading the local emacs: https://github.com/key4hep/key4hep-spack/issues/486 + "XDG_DATA_DIRS", + ] +) + def k4_setup_env_for_framework_tests(spec, env): """Setup for tests that need the run environment.""" @@ -169,6 +172,7 @@ def install_setup_script(self, spec, prefix, env_var): with open(os.path.join(prefix, "setup.sh"), "w") as f: f.write(cmds) + class Key4hepPackage(PackageBase): tags = ["hep", "key4hep"] diff --git a/packages/key4hep-stack/package.py b/packages/key4hep-stack/package.py index 36e1e3a1..6b2b93dd 100644 --- a/packages/key4hep-stack/package.py +++ b/packages/key4hep-stack/package.py @@ -94,7 +94,7 @@ class Key4hepStack(BundlePackage, Key4hepPackage): depends_on("cepcsw") - depends_on('opendatadetector') + depends_on("opendatadetector") depends_on("catch2@3:", when="+devtools") depends_on("cmake", when="+devtools") @@ -163,7 +163,10 @@ def setup_run_environment(self, env): # env variable for OpenDataDetector, see # https://github.com/key4hep/key4hep-spack/issues/526 if "opendatadetector" in self.spec: - env.set("OPENDATADETECTOR", self.spec["opendatadetector"].prefix.share + "/OpenDataDetector") + env.set( + "OPENDATADETECTOR", + self.spec["opendatadetector"].prefix.share + "/OpenDataDetector", + ) def install(self, spec, prefix): return install_setup_script(self, spec, prefix, "K4_LATEST_SETUP_PATH")