Skip to content

Commit d6f33fa

Browse files
committed
attempt to fix package
1 parent cc7bd27 commit d6f33fa

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/spack.yml

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ jobs:
4949
sudo apt-get update
5050
sudo apt-get install -yq ccache
5151
52+
- name: Check out repo
53+
if: always()
54+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
55+
5256
- name: Get ccache config dir
5357
if: always()
5458
run: ccache --show-config
@@ -64,6 +68,7 @@ jobs:
6468
- name: Install PyNucleus
6569
shell: spack-bash {0}
6670
run: |
71+
pushd spack && git apply ../0001-py-pynucleus-Set-paths.patch && popd
6772
spack config add config:ccache:true
6873
spack env create pynucleus
6974
spack env activate pynucleus

0001-py-pynucleus-Set-paths.patch

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From 2dda84b99b5b409cad68191668e6f0b2b0c66aa6 Mon Sep 17 00:00:00 2001
2+
From: Christian Glusa <[email protected]>
3+
Date: Wed, 2 Apr 2025 19:12:23 -0600
4+
Subject: [PATCH] py-pynucleus: Set paths
5+
6+
Signed-off-by: Christian Glusa <[email protected]>
7+
---
8+
.../repos/builtin/packages/py-pynucleus/package.py | 11 ++++++++++-
9+
1 file changed, 10 insertions(+), 1 deletion(-)
10+
11+
diff --git a/var/spack/repos/builtin/packages/py-pynucleus/package.py b/var/spack/repos/builtin/packages/py-pynucleus/package.py
12+
index 97387177e6..c1fe39690a 100644
13+
--- a/var/spack/repos/builtin/packages/py-pynucleus/package.py
14+
+++ b/var/spack/repos/builtin/packages/py-pynucleus/package.py
15+
@@ -4,7 +4,8 @@
16+
17+
from spack.build_systems.python import PythonPipBuilder
18+
from spack.package import *
19+
-
20+
+from pathlib import Path
21+
+import os
22+
23+
class PyPynucleus(PythonPackage):
24+
"""PyNucleus is a finite element code that specifically targets nonlocal operators."""
25+
@@ -56,6 +57,7 @@ class PyPynucleus(PythonPackage):
26+
27+
def setup_build_environment(self, env):
28+
env.set("PYNUCLEUS_BUILD_PARALLELISM", make_jobs)
29+
+ env.prepend_path("PYTHONPATH", self.prefix)
30+
31+
@run_before("install")
32+
def install_python(self):
33+
@@ -63,6 +65,13 @@ def install_python(self):
34+
with working_dir(subpackage):
35+
pip(*PythonPipBuilder.std_args(self), f"--prefix={self.prefix}", ".")
36+
37+
+ # os.environ['PYTHONPATH'] = os.getcwd()+':'+os.environ["PYTHONPATH"]
38+
+
39+
+ d = list((Path(os.getcwd())/'build').glob("lib.*"))
40+
+ if len(d) > 0:
41+
+ p = d[0]
42+
+ os.environ['PYTHONPATH'] = str(p)+':'+os.environ["PYTHONPATH"]
43+
+
44+
@run_after("install")
45+
def install_additional_files(self):
46+
spec = self.spec
47+
--
48+
2.49.0
49+

0 commit comments

Comments
 (0)