Skip to content

Commit

Permalink
Release 3.8.2 (#230)
Browse files Browse the repository at this point in the history
* Add config_overrides argument to initializer of MergerConfig (#225)

Fix #223

* Update tests for pytest changes

* Release preparation for 3.8.2

* Drop formal support for Python 3.6

* Mention Python 3.12 support is pending a dateutil release

* Update GitHub Actions due to deprecation warnings

* Update ruby gem path for new GH Action vers

* Newer Ruby bin path requires more than just a version bump

* Remove restriction on eyaml version (#231)

* Fix version of gh-actions-pypi-publish

* Split Coveralls.IO publication to resolve throttling

* Fix coveralls workflow name

* EYAML 2.x->3.x key incompatibility has been resolved

---------

Co-authored-by: Levi Muniz <levi.muniz17@gmail.com>
  • Loading branch information
wwkimball and leviem1 committed Feb 11, 2024
1 parent a80a36c commit ddeab3b
Show file tree
Hide file tree
Showing 21 changed files with 823 additions and 480 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# This workflow will install dependencies, EYAML (from Ruby), and run all tests
# and linting tools with every supported version of Python.
# @see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: build

Expand All @@ -12,23 +13,23 @@ on:
jobs:
build:

runs-on: ubuntu-20.04 # Use ubuntu-latest when https://github.com/actions/setup-python/issues/544 is fixed
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set Environment Variables
run: |
echo "${HOME}/.gem/ruby/2.7.0/bin" >> $GITHUB_PATH
echo "${HOME}/.local/share/gem/ruby/3.0.0/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
gem install --user-install hiera-eyaml -v 2.1.0
gem install --user-install hiera-eyaml
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade wheel
Expand All @@ -46,8 +47,3 @@ jobs:
- name: Unit Test with pytest
run: |
pytest --verbose --cov=yamlpath --cov-report=term-missing --cov-fail-under=100 --script-launch-mode=subprocess tests
- name: Publish coveralls Report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
34 changes: 34 additions & 0 deletions .github/workflows/python-publish-to-coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow runs the full sweep of tests for the yamlpath package and publishes the coverage report to coveralls.io
name: Publish Coverage Report to Coveralls.IO

on:
push:
branches: [ master, development ]
pull_request:
branches: [ master, development ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Set Environment Variables
run: |
echo "${HOME}/.local/share/gem/ruby/3.0.0/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
gem install --user-install hiera-eyaml
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade pytest pytest-cov pytest-console-scripts coveralls
python -m pip install --editable .
- name: Unit Test with pytest
run: |
pytest --verbose --cov=yamlpath --cov-report=term-missing --cov-fail-under=100 --script-launch-mode=subprocess tests
- name: Publish coveralls Report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
11 changes: 6 additions & 5 deletions .github/workflows/python-publish-to-prod-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SOURCE: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
# Manually publish to production PyPI
# @ssee: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
name: Upload PRODUCTION Python Package

on:
Expand All @@ -7,13 +8,13 @@ on:
jobs:
publish:
name: Publish to Production PyPI
runs-on: ubuntu-20.04 # Use ubuntu-latest when https://github.com/actions/setup-python/issues/544 is fixed
runs-on: ubuntu-latest
environment: 'PyPI: Production'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Build Tools
Expand All @@ -24,7 +25,7 @@ jobs:
run: |
python setup.py sdist bdist_wheel
- name: Publish Artifacts
uses: pypa/gh-action-pypi-publish@v1.4.2
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
21 changes: 11 additions & 10 deletions .github/workflows/python-publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SOURCE: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
# Test publishing to PyPI.
# @see: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
name: Upload Python TEST Package

on:
Expand All @@ -13,23 +14,23 @@ on:
jobs:
validate:
name: Code Quality Assessment
runs-on: ubuntu-20.04 # Use ubuntu-latest when https://github.com/actions/setup-python/issues/544 is fixed
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set Environment Variables
run: |
echo "${HOME}/.gem/ruby/2.7.0/bin" >> $GITHUB_PATH
echo "${HOME}/.local/share/gem/ruby/3.0.0/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
gem install --user-install hiera-eyaml -v 2.1.0
gem install --user-install hiera-eyaml
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade wheel
Expand All @@ -56,9 +57,9 @@ jobs:
needs: validate

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Build Tools
Expand All @@ -70,7 +71,7 @@ jobs:
sed -i -r -e "s/(^__version__[[:space:]]*=[[:space:]]*)("'"'"[[:digit:]](\.[[:digit:]])+)"'"'"/\1\2.RC$(date "+%Y%m%d%H%M%S")"'"'"/" yamlpath/__init__.py
python setup.py sdist bdist_wheel
- name: Publish Artifacts
uses: pypa/gh-action-pypi-publish@v1.4.2
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -500,5 +500,5 @@ min-public-methods=2

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception
# overgeneral-exceptions=BaseException,
# Exception
16 changes: 16 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
3.8.2
Enhancements:
* The MergerConfig class now accepts overrides for config values as "keys" and
"rules" keyword arguments to the constructor.
Credit and my thanks go to https://github.com/leviem1!

BREAKING CHANGES:
* Support for Python 3.6 has been dropped. This is forced by incompatibilities
discovered with the latest version of pytest and because dependencies like
dateutil and ruamel-yaml-clib no longer support Python 3.6. Support for
Python 3.7 is tepid. While pytest is still working with Python 3.7, other
dependencies are no longer supporting Python 3.7; however, the extensive
tests for yamlpath show no issues with them, so far. For now, Python 3.12
support is pending, waiting for the dateutil library to resolve a
DeprecationWarning regarding its use of datetime.datetime.utcfromtimestamp().

3.8.1
Bug Fixes:
* Fixed issue #220 reported by https://github.com/abramov-oleg wherein novel
Expand Down
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,11 @@ ephemeral or longer-lasting virtual Python environments.
### Requirements

This project requires [Python](https://www.python.org/) 3. It is rigorously
tested against Pythons 3.6 through 3.11. Most operating systems and
distributions have access to Python 3 even if only Python 2 -- or no Python, at
all -- came pre-installed. It is generally safe to have more than one version
of Python on your system at the same time, especially when using
tested against Pythons 3.7 through 3.11 (support for Python 3.6 was dropped
10 FEB 2024). Most operating systems and distributions have access to Python
3 even if only Python 2 -- or no Python, at all -- came pre-installed. It is
generally safe to have more than one version of Python on your system at the
same time, especially when using
[virtual Python environments](https://docs.python.org/3/library/venv.html).

*yamlpath* depends on *ruamel.yaml* (derived from and greatly extending PyYAML)
Expand Down Expand Up @@ -914,19 +915,6 @@ eyaml-rotate-keys \
You could combine this with `find` and `xargs` if your E/YAML file are
dispersed through a directory hierarchy, as with Hiera data.

##### EYAML Compatibility Alert

The maintainers of the hiera-eyaml project have released version 3.x and it is
*not backward compatible* with encryption certificates generated for
hiera-eyaml version 2.x. This has nothing to do with YAML Path and is alerted
here only as a courtesy to YAML Path users. **If you upgrade your
installation of hiera-eyaml without first updating your encryption
certificates and using a tool like eyaml-rotate-keys (provided here) to
re-encrypt your data with the replacement certificates, hiera-eyaml 3.x will
fail to decrypt your data!** This is *not* a problem with YAML Path.
hiera-eyaml certificate compatibility is well outside the purview of YAML Path
and its tools.

#### Get the Differences Between Two Documents

For routine use:
Expand Down
7 changes: 5 additions & 2 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if ! [ -d tests -a -d yamlpath ]; then
fi

if [ 1 -gt "$#" ]; then
echo "You must specify at least one Python version. Space-delimit multiples like: $0 3.6 3.7 3.8" >&2
echo "You must specify at least one Python version. Space-delimit multiples like: $0 3.7 3.8 3.9 3.10 3.11" >&2
exit 2
fi

Expand All @@ -19,7 +19,10 @@ rm -rf /tmp/yamlpath-python-coverage-data
rm -f .coverage

for pythonVersion in "${@}"; do
which deactivate &>/dev/null && deactivate &>/dev/null
if which deactivate &>/dev/null; then
echo "Deactivating Python $(python --version). If this dumps you right back to the shell prompt, you were running Microsoft's VSCode-embedded Python and were just put into a sub-shell; just exit to resume tests."
deactivate
fi

pyCommand=python${pythonVersion}
if ! which "$pyCommand" &>/dev/null; then
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: ISC License (ISCL)",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand Down Expand Up @@ -43,7 +42,7 @@
"yaml-diff = yamlpath.commands.yaml_diff:main",
]
},
python_requires=">3.6.0",
python_requires=">3.7.0",
install_requires=[
"ruamel.yaml>0.17.5,!=0.17.18,<=0.17.21",
"python-dateutil<=3"
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def old_eyaml_keys(tmp_path_factory):

return (old_private_key_file, old_public_key_file)

@requireseyaml
@pytest.fixture(scope="session")
def new_eyaml_keys(tmp_path_factory):
"""Creates temporary keys for encryption/decryption tests."""
Expand Down
Loading

0 comments on commit ddeab3b

Please sign in to comment.