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

ruamel.yaml 0.17.32 version buggy for 0.1.22 singularity-hpc release #655

Open
audreystott opened this issue Jun 30, 2023 · 8 comments
Open

Comments

@audreystott
Copy link
Contributor

When installing -b 0.1.22 on Ubuntu 22.04, shpc appears to install successfully (lines have been omitted):

git clone -b 0.1.22 https://github.com/singularityhub/singularity-hpc.git
cd singularity-hpc
sudo python3 setup.py install
sudo pip3 install .
.
.
.
Searching for ruamel.yaml
Reading https://pypi.org/simple/ruamel.yaml/
Downloading https://files.pythonhosted.org/packages/d9/0e/2a05efa11ea33513fbdf4a2e2576fe94fd8fa5ad226dbb9c660886390974/ruamel.yaml-0.17.32-py3-none-any.whl#sha256=23cd2ed620231677564646b0c6a89d138b6822a0d78656df7abda5879ec4f447
Best match: ruamel.yaml 0.17.32
Processing ruamel.yaml-0.17.32-py3-none-any.whl
Installing ruamel.yaml-0.17.32-py3-none-any.whl to /usr/local/lib/python3.8/dist-packages
Adding ruamel.yaml 0.17.32 to easy-install.pth file

Installed /usr/local/lib/python3.8/dist-packages/ruamel.yaml-0.17.32-py3.8.egg
.
.
.
Successfully installed singularity-hpc-0.1.22

However, it seems the new ruamel version (0.17.32) causes an error when running the shpc config edit command (shpc --help is fine):

shpc config edit

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/shpc/utils/fileio.py", line 17, in <module>
    from ruamel_yaml import YAML
ModuleNotFoundError: No module named 'ruamel_yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/shpc", line 8, in <module>
    sys.exit(run_shpc())
  File "/usr/local/lib/python3.8/dist-packages/shpc/client/__init__.py", line 519, in run_shpc
    from .config import main
  File "/usr/local/lib/python3.8/dist-packages/shpc/client/config.py", line 7, in <module>
    import shpc.defaults as defaults
  File "/usr/local/lib/python3.8/dist-packages/shpc/defaults.py", line 7, in <module>
    import shpc.utils as utils
  File "/usr/local/lib/python3.8/dist-packages/shpc/utils/__init__.py", line 1, in <module>
    from .fileio import (
  File "/usr/local/lib/python3.8/dist-packages/shpc/utils/fileio.py", line 19, in <module>
    from ruamel.yaml import YAML
ImportError: cannot import name 'YAML' from 'ruamel.yaml' (/usr/local/lib/python3.8/dist-packages/ruamel.yaml.clib-0.2.7-py3.8-linux-x86_64.egg/ruamel/yaml/__init__.py)

After installing ruamel.yaml 0.17.21 as follows, I can successfully run the shpc config edit command and also other shpc commands:

sudo pip3 install ruamel.yaml==0.17.21

Am I doing something wrong with my initial install commands?

@vsoch
Copy link
Member

vsoch commented Jun 30, 2023

I don't think so, and I think for the time being we should pin this version in the shpc/version.py. Would you like to submit a PR for that?

@audreystott
Copy link
Contributor Author

Sure I can do that. ruamel.yaml==0.17.21 for shpc v0.1.22?

@vsoch
Copy link
Member

vsoch commented Jul 2, 2023

Yep let’s do that for now - thank you! 🙏

@audreystott
Copy link
Contributor Author

Can you open a new branch for me to do a PR to? I can't do a PR to the 0.1.22 tag.

@vsoch
Copy link
Member

vsoch commented Jul 2, 2023

the tags are releases, so you wouldn’t do a PR against a release, but rather the current main branch.

To do that you can fork the repository, clone your fork, checkout a branch, do the changes, commit and push, and then open the PR from your fork against main. It’s not typical to allow write access when contributing to a repository. Let me know if you have any questions along the way - happy to help!

@audreystott
Copy link
Contributor Author

Ok PR created - #657

@vsoch vsoch reopened this Sep 19, 2023
@vsoch
Copy link
Member

vsoch commented Sep 19, 2023

@vsoch
Copy link
Member

vsoch commented Sep 19, 2023

@audreystott is this something you might be able to work on? Note that we would want to import ruamel.yaml, and there are examples here: https://yaml.readthedocs.io/en/latest/example.html

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

No branches or pull requests

2 participants