Skip to content

Commit

Permalink
Merge pull request #104 from wwkimball/development
Browse files Browse the repository at this point in the history
Prep release 3.4.0
  • Loading branch information
wwkimball committed Nov 11, 2020
2 parents 93a4a93 + ebd1faa commit 748a7dc
Show file tree
Hide file tree
Showing 41 changed files with 3,619 additions and 1,334 deletions.
1 change: 1 addition & 0 deletions .codacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ exclude_paths:
- '**/*.md'
- '**/__init__.py'
- 'README.md'
- 'yamlpath/func.py' # Deprecated; the entire file is just relays
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ python:
- 3.6
- 3.7
- 3.8
# - 3.9 pylint will not support Python 3.9 until https://github.com/PyCQA/pylint/issues/3882 is resolved

os: linux
dist: xenial
Expand Down
122 changes: 122 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,125 @@
3.4.0:
Bug Fixes:
* For the yaml-diff command-line tool, custom identity keys for specific
records in AoHs of the RHS document were not being considered for comparison.
Any identity key set for the whole AoH was being applied to every record in
the set.

Enhancements:
* The yaml-get command-line tool -- and the underlying Processor::get_nodes
method -- now retrives nodes with `null` values. Non-JSON null results from
yaml-get are printed using the ASCII NULL control-character (Hexadecimal 00)
wherever encountered. While most terminals and shells won't visibly print
this character, it is there and can be picked up by downstream parsers of
STDOUT. When the output is rendered as JSON, the unquoted "null" identifier
is used.
* The yaml-set command-line tool now enables assigning null values using a new
--null|-N input option.
* The yaml-set command-line tool now supports assigning YAML Aliases to target
--change|-g nodes, referencing any other node via --aliasof|-A whether it is
already Anchored, or not. Should the Anchor not already exist, a unique name
will be automatically assigned. This automatic name can controlled via
--anchor|-H. Setting --change|-g and --aliasof|-A to the same node along
with a new --anchor|-H explicitly renames an existing Anchor and its Aliases.
The same is implicitly possible by specifying --change|-g and --anchor|-H
without --aliasof|-A. Using these against non-YAML files merely duplicates
the target value to the indicated --change|-g nodes.
* With a new --tag|-T auxilliary option, the yaml-set command-line tool now
supports assigning custom YAML tags (data-type specifiers) to nodes created
or updated during the operation.
* The yaml-merge and yaml-diff command-line tools now also handle YAML tags.
* The single-star wildcard segment translation was changed from [.!=""] to
[.=~/.*/] which enables it to match any key or value (including empty-string
and null).

API Changes:
* The yamlpath.func library is too big and some very useful general code has
become attached to special-purpose classes. As such, it's time for
refactoring before this becomes untennable. New, better-organized static
classes were created under a new yamlpath.common namespace. Since this
would be destructive to other Python code which depends on the old
organization, this is a heads-up. Your existing code will continue to work
without any changes, but only until 4.x (which is not yet planned). Until
then, you must update your own code to use the new static classes for the
following functions and methods so as to avoid fatal errors down the road:
- yamlpath.func.append_list_element
-> yamlpath.common.Nodes.append_list_element

- yamlpath.func.build_next_node
-> yamlpath.common.Nodes.build_next_node

- yamlpath.func.clone_node
-> yamlpath.common.Nodes.clone_node

- yamlpath.func.create_searchterms_from_pathattributes
-> yamlpath.common.Searches.create_searchterms_from_pathattributes

- yamlpath.func.ensure_escaped
-> yamlpath.YAMLPath.ensure_escaped

- yamlpath.func.escape_path_section
-> yamlpath.YAMLPath.escape_path_section

- yamlpath.func.get_node_anchor
-> yamlpath.common.Anchors.get_node_anchor

- yamlpath.func.get_yaml_data
-> yamlpath.common.Parsers.get_yaml_data

- yamlpath.func.get_yaml_editor
-> yamlpath.common.Parsers.get_yaml_editor

- yamlpath.func.get_yaml_multidoc_data
-> yamlpath.common.Parsers.get_yaml_multidoc_data

- yamlpath.func.make_float_node
-> yamlpath.common.Nodes.make_float_node

- yamlpath.func.make_new_node
-> yamlpath.common.Nodes.make_new_node

- yamlpath.func.search_anchor
-> yamlpath.common.Searches.search_anchor

- yamlpath.func.search_matches
-> yamlpath.common.Searches.search_matches

- yamlpath.func.stringify_dates
-> yamlpath.common.Parsers.stringify_dates
NOTE that this method is deprecated and will be eliminated in favor of
using its more comprehensive replacement,
yamlpath.common.Parsers.jsonify_yaml_data

- yamlpath.func.unwrap_node_coords
-> yamlpath.wrappers.nodecoords.NodeCoords.unwrap_node_coords

- yamlpath.func.wrap_type
-> yamlpath.common.Nodes.wrap_type

- yamlpath.merger.Merger.combine_merge_anchors
-> yamlpath.common.Anchors.combine_merge_anchors

- yamlpath.merger.Merger.delete_all_comments
-> yamlpath.common.Anchors.delete_all_comments

- yamlpath.merger.Merger.rename_anchor
-> yamlpath.common.Anchors.rename_anchor

- yamlpath.merger.Merger.replace_anchor
-> yamlpath.common.Anchors.replace_anchor

- yamlpath.merger.Merger.scan_for_anchors
-> yamlpath.common.Anchors.scan_for_anchors

- yamlpath.merger.Merger.set_flow_style
-> yamlpath.common.Anchors.set_flow_style

Until you update your code, a deprecation warning will be printed to STDERR
every time the yamlpath.func file is imported and the first time one of the
relocated Merger static methods is called. To be rid of the message, update
your code to use the new sources of the deprecated functions/methods and
remove every import of and from yamlpath.func.

3.3.0:
Bug Fixes:
* It was impossible to install yamlpath 3.x without first installing
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ YAML Path understands these segment types:
`/warriors/power_level[.>9000]` all yield only the power_level from *all*
warriors with power_levels over 9,000 within the same array of warrior hashes.
* Wildcard Searches: The `*` symbol can be used as shorthand for the `[]`
search operator against text keys and values: `/warriors/name/Go*`
search operator against text keys and values: `/warriors/name/Go*`; it also
returns every immediate child, regardless its key or value.
* Deep Traversals: The `**` symbol pair deeply traverses the document:
* When it is the last or only segment of a YAML Path, it selects every leaf
node from the remainder of the document's tree: `/shows/**`
Expand Down
7 changes: 5 additions & 2 deletions run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function New-TemporaryDirectory {
return $Item
}

$EnvDirs = Get-ChildItem -Directory -Filter "env*"
$EnvDirs = Get-ChildItem -Directory -Filter "venv*"
ForEach ($EnvDir in $EnvDirs) {
& "$($EnvDir.FullName)\Scripts\Activate.ps1"
if (!$?) {
Expand Down Expand Up @@ -53,8 +53,11 @@ ForEach ($EnvDir in $EnvDirs) {
Write-Output "...upgrading setuptools"
pip install --upgrade setuptools

Write-Output "...upgrading wheel"
pip install --upgrade wheel

Write-Output "...installing self"
pip install -e .
pip install --editable .
if (!$?) {
& deactivate
Remove-Item -Recurse -Force $TmpVEnv
Expand Down
5 changes: 4 additions & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [ 1 -gt "$#" ]; then
fi

# Delete all cached data
find ./ -name '__pycache__' -type d -print0 | xargs -r0 -- rm -rf || exit $?
find ./ -name '__pycache__' -type d -print0 | xargs -0 rm -rf || exit $?
rm -rf yamlpath.egg-info
rm -rf /tmp/yamlpath-python-coverage-data
rm -f .coverage
Expand Down Expand Up @@ -54,6 +54,9 @@ EOF
echo "...upgrading setuptools"
pip install --upgrade setuptools >/dev/null

echo "...upgrading wheel"
pip install --upgrade wheel >/dev/null

echo "...installing self (editable because without it, pytest-cov cannot trace code execution!)"
if ! pip install --editable . >/dev/null; then
deactivate
Expand Down
Loading

0 comments on commit 748a7dc

Please sign in to comment.