Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure pre-commit runs on main branch #528

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: pre-commit
on:
pull_request:
push:
branches: [release]
branches: [main]

jobs:
pre-commit:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion packages/k4projecttemplate/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion packages/k4simdelphes/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 8 additions & 2 deletions packages/key4hep-stack-test/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *


Expand Down Expand Up @@ -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])

Expand Down
18 changes: 11 additions & 7 deletions packages/key4hep-stack/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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"]

Expand Down
7 changes: 5 additions & 2 deletions packages/key4hep-stack/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")