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

Incompatibility with new ruamel yaml #376

Closed
peci1 opened this issue Oct 25, 2023 · 2 comments
Closed

Incompatibility with new ruamel yaml #376

peci1 opened this issue Oct 25, 2023 · 2 comments

Comments

@peci1
Copy link

peci1 commented Oct 25, 2023

I see this error in build https://github.com/RoboStack/ros-noetic/actions/runs/6637741537/job/18032667271#step:16:69 :

TEST START: /home/runner/micromamba/envs/testpr_env/conda-bld/linux-aarch64/ros-distro-mutex-0.4.0-noetic.tar.bz2
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/runner/micromamba/envs/testpr_env/lib/python3.9/site-packages/boa/core │
│ /run_build.py:398 in build_recipe                                            │
│                                                                              │
│   395 │   │   │   if final_outputs is not None:                              │
│   396 │   │   │   │   for final_out in final_outputs:                        │
│   397 │   │   │   │   │   if not notest:                                     │
│ ❱ 398 │   │   │   │   │   │   run_test(                                      │
│   399 │   │   │   │   │   │   │   final_out,                                 │
│   400 │   │   │   │   │   │   │   o.config,                                  │
│   401 │   │   │   │   │   │   │   stats,                                     │
│                                                                              │
│ /home/runner/micromamba/envs/testpr_env/lib/python3.9/site-packages/boa/core │
│ /test.py:699 in run_test                                                     │
│                                                                              │
│   696 │   │   metadata = recipedir_or_package_or_metadata                    │
│   697 │   │   utils.rm_rf(metadata.config.test_dir)                          │
│   698 │   else:                                                              │
│ ❱ 699 │   │   metadata, hash_input = construct_metadata_for_test(            │
│   700 │   │   │   recipedir_or_package_or_metadata, config                   │
│   701 │   │   )                                                              │
│   702                                                                        │
│                                                                              │
│ /home/runner/micromamba/envs/testpr_env/lib/python3.9/site-packages/boa/core │
│ /test.py:381 in construct_metadata_for_test                                  │
│                                                                              │
│   378 │   │   #     recipedir_or_package, config                             │
│   379 │   │   # )                                                            │
│   380 │   else:                                                              │
│ ❱ 381 │   │   m, hash_input = _construct_metadata_for_test_from_package(     │
│   382 │   │   │   recipedir_or_package, config                               │
│   383 │   │   )                                                              │
│   384 │   return m, hash_input                                               │
│                                                                              │
│ /home/runner/micromamba/envs/testpr_env/lib/python3.9/site-packages/boa/core │
│ /test.py:321 in _construct_metadata_for_test_from_package                    │
│                                                                              │
│   318 │   │   # )[0][0]                                                      │
│   319 │   │                                                                  │
│   320 │   │   try:                                                           │
│ ❱ 321 │   │   │   metadata = get_metadata(recipe_path, config)               │
│   322 │   │   │   # with open(os.path.join(info_dir, "recipe", "recipe.yaml" │
│   323 │   │   │   # metadata = yaml.load(fi)                                 │
│   324 │   │   except (SystemExit, FileNotFoundError):                        │
│                                                                              │
│ /home/runner/micromamba/envs/testpr_env/lib/python3.9/site-packages/boa/core │
│ /test.py:67 in get_metadata                                                  │
│                                                                              │
│    64 │   │   │   │                                                          │
│    65 │   │   │   │   d = toml.load(fi)["tool"]["boa"]                       │
│    66 │   │   else:                                                          │
│ ❱  67 │   │   │   d = ruamel.yaml.safe_load(fi)                              │
│    68 │   o = Output(d, config)                                              │
│    69 │   return MetaData(os.path.dirname(yml), o)                           │
│    70                                                                        │
│                                                                              │
│ /home/runner/micromamba/envs/testpr_env/lib/python3.9/site-packages/ruamel/y │
│ aml/main.py:1091 in safe_load                                                │
│                                                                              │
│   1088 │   and produce the corresponding Python object.                      │
│   1089 │   Resolve only basic YAML tags.                                     │
│   1090 │   """                                                               │
│ ❱ 1091 │   error_deprecation('safe_load', 'load', arg="typ='safe', pure=True │
│   1092                                                                       │
│   1093                                                                       │
│   1094 def safe_load_all(stream: StreamTextType, version: Optional[VersionTy │
│                                                                              │
│ /home/runner/micromamba/envs/testpr_env/lib/python3.9/site-packages/ruamel/y │
│ aml/main.py:1023 in error_deprecation                                        │
│                                                                              │
│   1020 │   │   _ = e                                                         │
│   1021 │   s += '\n'                                                         │
│   1022 │   if sys.version_info < (3, 10):                                    │
│ ❱ 1023 │   │   raise AttributeError(s)                                       │
│   1024 │   else:                                                             │
│   1025 │   │   raise AttributeError(s, name=None)                            │
│   1026                                                                       │
╰──────────────────────────────────────────────────────────────────────────────╯
AttributeError: 
"safe_load()" has been removed, use

  yaml = YAML(typ='safe', pure=True)
  yaml.load(...)

instead of file 
"/home/runner/micromamba/envs/testpr_env/lib/python3.9/site-packages/boa/core/te
st.py", line 67

            d = ruamel.yaml.safe_load(fi)

It is apparent boa needs to be rewritten using the new API.

@joverlee521
Copy link

Potentially fixed by #380

tsibley added a commit to nextstrain/conda-base that referenced this issue Oct 30, 2023
Boa uses a previously deprecated and now removed API in ruamel.yaml,
safe_load().  0.18.0 was the first version with its removal.

See <mamba-org/boa#376>.

Resolves <#44>.
@victorlin
Copy link

I just confirmed that this is fixed by #380 which is included in boa 0.16.0. @peci1 or a maintainer: could you close this issue?

@peci1 peci1 closed this as completed Dec 5, 2023
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

3 participants