Skip to content

Commit 600955e

Browse files
authored
Update vendored ruamel.yaml to v0.17.21 (spack#37008)
* Vendor ruamel.yaml v0.17.21 * Add unit test for whitespace regression * Add an abstraction layer in Spack to wrap ruamel.yaml All YAML operations are routed through spack.util.spack_yaml The custom classes have been adapted to the new ruamel.yaml class hierarchy. Fixed line annotation issue in "spack config blame"
1 parent 95e61f2 commit 600955e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+15044
-8601
lines changed

lib/spack/external/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@
101101
* Usage: Used for config files. Ruamel is based on PyYAML but is more
102102
actively maintained and has more features, including round-tripping
103103
comments read from config files.
104-
* Version: 0.11.15 (last version supporting Python 2.6)
105-
* Note: This package has been slightly modified to improve Python 2.6
106-
compatibility -- some ``{}`` format strings were replaced, and the
107-
import for ``OrderedDict`` was tweaked.
104+
* Version: 0.17.21
108105
109106
six
110107
---
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from ruamel import *
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
21
The MIT License (MIT)
32

3+
Copyright (c) 2014-2022 Anthon van der Neut, Ruamel bvba
4+
45
Permission is hereby granted, free of charge, to any person obtaining a copy
56
of this software and associated documentation files (the "Software"), to deal
67
in the Software without restriction, including without limitation the rights
78
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
89
copies of the Software, and to permit persons to whom the Software is
910
furnished to do so, subject to the following conditions:
10-
11+
1112
The above copyright notice and this permission notice shall be included in
1213
all copies or substantial portions of the Software.
13-
14+
1415
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1516
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1617
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1718
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1819
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20-
THE SOFTWARE.
21-
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# coding: utf-8
2+
3+
if False: # MYPY
4+
from typing import Dict, Any # NOQA
5+
6+
_package_data = dict(
7+
full_package_name='ruamel.yaml',
8+
version_info=(0, 17, 21),
9+
__version__='0.17.21',
10+
version_timestamp='2022-02-12 09:49:22',
11+
author='Anthon van der Neut',
12+
author_email='[email protected]',
13+
description='ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order', # NOQA
14+
entry_points=None,
15+
since=2014,
16+
extras_require={
17+
':platform_python_implementation=="CPython" and python_version<"3.11"': ['ruamel.yaml.clib>=0.2.6'], # NOQA
18+
'jinja2': ['ruamel.yaml.jinja2>=0.2'],
19+
'docs': ['ryd'],
20+
},
21+
classifiers=[
22+
'Programming Language :: Python :: 3 :: Only',
23+
'Programming Language :: Python :: 3.5',
24+
'Programming Language :: Python :: 3.6',
25+
'Programming Language :: Python :: 3.7',
26+
'Programming Language :: Python :: 3.8',
27+
'Programming Language :: Python :: 3.9',
28+
'Programming Language :: Python :: 3.10',
29+
'Programming Language :: Python :: Implementation :: CPython',
30+
'Topic :: Software Development :: Libraries :: Python Modules',
31+
'Topic :: Text Processing :: Markup',
32+
'Typing :: Typed',
33+
],
34+
keywords='yaml 1.2 parser round-trip preserve quotes order config',
35+
read_the_docs='yaml',
36+
supported=[(3, 5)], # minimum
37+
tox=dict(
38+
env='*f', # f for 3.5
39+
fl8excl='_test/lib',
40+
),
41+
# universal=True,
42+
python_requires='>=3',
43+
rtfd='yaml',
44+
) # type: Dict[Any, Any]
45+
46+
47+
version_info = _package_data['version_info']
48+
__version__ = _package_data['__version__']
49+
50+
try:
51+
from .cyaml import * # NOQA
52+
53+
__with_libyaml__ = True
54+
except (ImportError, ValueError): # for Jython
55+
__with_libyaml__ = False
56+
57+
from ruamel.yaml.main import * # NOQA
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# coding: utf-8
2+
if False: # MYPY
3+
from typing import Any, Dict, Optional, List, Union, Optional, Iterator # NOQA
4+
5+
anchor_attrib = '_yaml_anchor'
6+
7+
8+
class Anchor:
9+
__slots__ = 'value', 'always_dump'
10+
attrib = anchor_attrib
11+
12+
def __init__(self):
13+
# type: () -> None
14+
self.value = None
15+
self.always_dump = False
16+
17+
def __repr__(self):
18+
# type: () -> Any
19+
ad = ', (always dump)' if self.always_dump else ""
20+
return 'Anchor({!r}{})'.format(self.value, ad)

0 commit comments

Comments
 (0)