Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions developer/upgrade_pyyaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ def remove_pyyaml_folder(self):

def copy_new_pyyaml_files(self):
print("Copy new pyyaml package files")
source = os.path.join("lib3", "yaml")
source = os.path.join("lib", "yaml")
target = os.path.join(self.pyyaml_dir)
shutil.copytree(source, target)

for source in ["README", "LICENSE", "CHANGES"]:
for source in ["README.md", "LICENSE", "CHANGES"]:
target = os.path.join(self.pyyaml_dir, source)
shutil.copy(source, target)

Expand Down
26 changes: 25 additions & 1 deletion python/tank_vendor/yaml/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,31 @@
For a complete changelog, see:

* https://github.com/yaml/pyyaml/commits/
* https://bitbucket.org/xi/pyyaml/commits/

6.0.3 (2025-09-25)

* https://github.com/yaml/pyyaml/pull/864 -- Support for Python 3.14 and free-threading (experimental)
Comment on lines +6 to +8
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you sure this version still works with Python 3.7?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Initial testing worked fine to me, but we should fully test it.


6.0.2 (2024-08-06)

* https://github.com/yaml/pyyaml/pull/808 -- Support for Cython 3.x and Python 3.13

6.0.1 (2023-07-18)

* https://github.com/yaml/pyyaml/pull/702 -- pin Cython build dep to < 3.0

6.0 (2021-10-13)

* https://github.com/yaml/pyyaml/pull/327 -- Change README format to Markdown
* https://github.com/yaml/pyyaml/pull/483 -- Add a test for YAML 1.1 types
* https://github.com/yaml/pyyaml/pull/497 -- fix float resolver to ignore `.` and `._`
* https://github.com/yaml/pyyaml/pull/550 -- drop Python 2.7
* https://github.com/yaml/pyyaml/pull/553 -- Fix spelling of “hexadecimal”
* https://github.com/yaml/pyyaml/pull/556 -- fix representation of Enum subclasses
* https://github.com/yaml/pyyaml/pull/557 -- fix libyaml extension compiler warnings
* https://github.com/yaml/pyyaml/pull/560 -- fix ResourceWarning on leaked file descriptors
* https://github.com/yaml/pyyaml/pull/561 -- always require `Loader` arg to `yaml.load()`
* https://github.com/yaml/pyyaml/pull/564 -- remove remaining direct distutils usage

5.4.1 (2021-01-20)

Expand Down
43 changes: 0 additions & 43 deletions python/tank_vendor/yaml/README

This file was deleted.

53 changes: 53 additions & 0 deletions python/tank_vendor/yaml/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
PyYAML
======

A full-featured YAML processing framework for Python

## Installation

To install, type `python setup.py install`.

By default, the `setup.py` script checks whether LibYAML is installed and if
so, builds and installs LibYAML bindings.
To skip the check and force installation of LibYAML bindings, use the option
`--with-libyaml`: `python setup.py --with-libyaml install`.
To disable the check and skip building and installing LibYAML bindings, use
`--without-libyaml`: `python setup.py --without-libyaml install`.

When LibYAML bindings are installed, you may use fast LibYAML-based parser and
emitter as follows:

>>> yaml.load(stream, Loader=yaml.CLoader)
>>> yaml.dump(data, Dumper=yaml.CDumper)

If you don't trust the input YAML stream, you should use:

>>> yaml.safe_load(stream)

## Testing

PyYAML includes a comprehensive test suite.
To run the tests, type `python setup.py test`.

## Further Information

* For more information, check the
[PyYAML homepage](https://github.com/yaml/pyyaml).

* [PyYAML tutorial and reference](http://pyyaml.org/wiki/PyYAMLDocumentation).

* Discuss PyYAML with the maintainers on
Matrix at https://matrix.to/#/#pyyaml:yaml.io or
IRC #pyyaml irc.libera.chat

* Submit bug reports and feature requests to the
[PyYAML bug tracker](https://github.com/yaml/pyyaml/issues).

## License

The PyYAML module was written by Kirill Simonov <xi@resolvent.net>.
It is currently maintained by the YAML and Python communities.

PyYAML is released under the MIT license.

See the file LICENSE for more details.
49 changes: 6 additions & 43 deletions python/tank_vendor/yaml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .loader import *
from .dumper import *

__version__ = '5.4.1'
__version__ = '6.0.3'
try:
from .cyaml import *
__with_libyaml__ = True
Expand All @@ -18,41 +18,12 @@
import io

#------------------------------------------------------------------------------
# Warnings control
# XXX "Warnings control" is now deprecated. Leaving in the API function to not
# break code that uses it.
#------------------------------------------------------------------------------

# 'Global' warnings state:
_warnings_enabled = {
'YAMLLoadWarning': True,
}

# Get or set global warnings' state
def warnings(settings=None):
if settings is None:
return _warnings_enabled

if type(settings) is dict:
for key in settings:
if key in _warnings_enabled:
_warnings_enabled[key] = settings[key]

# Warn when load() is called without Loader=...
class YAMLLoadWarning(RuntimeWarning):
pass

def load_warning(method):
if _warnings_enabled['YAMLLoadWarning'] is False:
return

import warnings

message = (
"calling yaml.%s() without Loader=... is deprecated, as the "
"default Loader is unsafe. Please read "
"https://msg.pyyaml.org/load for full details."
) % method

warnings.warn(message, YAMLLoadWarning, stacklevel=3)
return {}

#------------------------------------------------------------------------------
def scan(stream, Loader=Loader):
Expand Down Expand Up @@ -100,30 +71,22 @@ def compose_all(stream, Loader=Loader):
finally:
loader.dispose()

def load(stream, Loader=None):
def load(stream, Loader):
"""
Parse the first YAML document in a stream
and produce the corresponding Python object.
"""
if Loader is None:
load_warning('load')
Loader = FullLoader

loader = Loader(stream)
try:
return loader.get_single_data()
finally:
loader.dispose()

def load_all(stream, Loader=None):
def load_all(stream, Loader):
"""
Parse all YAML documents in a stream
and produce corresponding Python objects.
"""
if Loader is None:
load_warning('load_all')
Loader = FullLoader

loader = Loader(stream)
try:
while loader.check_data():
Expand Down
2 changes: 1 addition & 1 deletion python/tank_vendor/yaml/representer.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def represent_ordered_dict(self, data):
Representer.add_representer(tuple,
Representer.represent_tuple)

Representer.add_representer(type,
Representer.add_multi_representer(type,
Representer.represent_name)

Representer.add_representer(collections.OrderedDict,
Expand Down
2 changes: 1 addition & 1 deletion python/tank_vendor/yaml/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class Resolver(BaseResolver):
Resolver.add_implicit_resolver(
'tag:yaml.org,2002:float',
re.compile(r'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)?
|\.[0-9_]+(?:[eE][-+][0-9]+)?
|\.[0-9][0-9_]*(?:[eE][-+][0-9]+)?
|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*
|[-+]?\.(?:inf|Inf|INF)
|\.(?:nan|NaN|NAN))$''', re.X),
Expand Down
4 changes: 2 additions & 2 deletions python/tank_vendor/yaml/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ def scan_flow_scalar_non_spaces(self, double, start_mark):
for k in range(length):
if self.peek(k) not in '0123456789ABCDEFabcdef':
raise ScannerError("while scanning a double-quoted scalar", start_mark,
"expected escape sequence of %d hexdecimal numbers, but found %r" %
"expected escape sequence of %d hexadecimal numbers, but found %r" %
(length, self.peek(k)), self.get_mark())
code = int(self.prefix(length), 16)
chunks.append(chr(code))
Expand Down Expand Up @@ -1403,7 +1403,7 @@ def scan_uri_escapes(self, name, start_mark):
for k in range(2):
if self.peek(k) not in '0123456789ABCDEFabcdef':
raise ScannerError("while scanning a %s" % name, start_mark,
"expected URI escape sequence of 2 hexdecimal numbers, but found %r"
"expected URI escape sequence of 2 hexadecimal numbers, but found %r"
% self.peek(k), self.get_mark())
codes.append(int(self.prefix(2), 16))
self.forward(2)
Expand Down
Loading