Skip to content

Updated package.py for singularity-eos to avoid spack.* constructs #492

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

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

leowerneck
Copy link
Contributor

PR Summary

I ran the following commands to install singularity-eos on macOS and Linux, but encountered an error:

cd
git clone https://github.com/spack/spack.git
source ~/spack/share/spack/setup-env.sh
spack compiler find
spack external find --not-buildable
git clone --recursive [email protected]:lanl/singularity-eos.git
spack repo add singularity-eos/spack-repo
spack install singularity-eos
==> Error: cannot load package 'singularity-eos' from the 'singularity_eos' repository: name 'spack' is not defined

After researching online a bit, the problem seems to boil down to this offending line in spack-repo/packages/singularity-eos/package.py:

if spack.version.Version(spack.spack_version) >= spack.version.Version("0.17"):

Note that the spack module is not imported in the script. This PR fixes this by changing this line to:

if Version(spack_version) >= Version("0.17"):

and adding the appropriate imports:

from spack import spack_version
from spack.error import SpackError
from spack.package import *
from spack.directives import directive
from spack.version import Version

PR Checklist

I tried figuring out how to check if the code is properly formatted, but failed. I'd be happy to do it if you can provide me with instructions.

  • Adds a test for any bugs fixed. Adds tests for new features.
  • Format your changes by using the make format command after configuring with cmake.
  • Document any new features, update documentation for changes made.
  • Make sure the copyright notice on any files you modified is up to date.
  • After creating a pull request, note it in the CHANGELOG.md file.
  • LANL employees: make sure tests pass both on the github CI and on the Darwin CI

If preparing for a new release, in addition please check the following:

  • Update the version in cmake.
  • Move the changes in the CHANGELOG.md file under a new header for the new release, and reset the categories.
  • Ensure that any when='@main' dependencies are updated to the release version in the package.py

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@Yurlungur Yurlungur merged commit 4ed61e8 into lanl:main Apr 11, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants