Skip to content

Conversation

@RMeli
Copy link
Member

@RMeli RMeli commented Oct 15, 2025

No description provided.

@RMeli
Copy link
Member Author

RMeli commented Oct 15, 2025

@spackbot fix style

@spackbot-app
Copy link

spackbot-app bot commented Oct 15, 2025

Let me see if I can fix that for you!

@spackbot-app
Copy link

spackbot-app bot commented Oct 15, 2025

I was able to run spack style --fix for you!

spack style --fix
repos/spack_repo/builtin/packages/dd4hep/package.py
repos/spack_repo/builtin/packages/graphviz/package.py
repos/spack_repo/builtin/packages/mapl/package.py
repos/spack_repo/builtin/packages/petaca/package.py
repos/spack_repo/builtin/packages/plumed/package.py
repos/spack_repo/builtin/packages/podio/package.py
repos/spack_repo/builtin/packages/py_cartopy/package.py
repos/spack_repo/builtin/packages/py_pygobject/package.py
repos/spack_repo/builtin/packages/py_torch/package.py
repos/spack_repo/builtin/packages/seacas/package.py
repos/spack_repo/builtin/packages/truchas/package.py
�[1;34m==> �[0mrunning flake8
repos/spack_repo/builtin/packages/plumed/package.py:273: [W293] blank line contains whitespace
repos/spack_repo/builtin/packages/plumed/package.py:286: [E501] line too long (106 > 99 characters)
repos/spack_repo/builtin/packages/plumed/package.py:304: [E741] ambiguous variable name 'l'
repos/spack_repo/builtin/packages/plumed/package.py:335: [E303] too many blank lines (2)
repos/spack_repo/builtin/packages/py_torch/package.py:809: [E501] line too long (110 > 99 characters)
�[1;34m==> �[0mrunning isort
Fixing /tmp/tmpvornvl89/fork/repos/spack_repo/builtin/packages/plumed/package.py
�[1;34m==> �[0mrunning black
Keep in mind that I cannot fix your flake8 or mypy errors, so if you have any you'll need to fix them and update the pull request. If I was able to push to your branch, if you make further changes you will need to pull from your updated branch before pushing again.

I've updated the branch with style fixes.

depends_on("py-cython", type="build")

depends_on("py-torch", when="+pytorch")
conflicts("+metatomic ~pytorch", msg="metatomic support requires PyTorch")
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way to automatically enable pytorch when the user request metatomic, and only error if the user explicitly disable pytorch?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is what this conflicts does. It allows +pytorch ~metatomic (which is valid, as far as I understand), but disallows ~pytorch +metatomic. If you select only +metatomic then the pytorch variant automatically needs to be +pytorch if not specified in order to satisfy the constraint. However, if a user explicitly requires +metatomic ~pytorch, then an error is triggered.

This is essentially because the conflicts is stronger than the variant default value, see https://spack.readthedocs.io/en/latest/frequently_asked_questions.html#why-does-spack-pick-particular-versions-and-variants

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants