Skip to content

Commit ddeab3b

Browse files
wwkimballleviem1
andauthored
Release 3.8.2 (#230)
* 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>
1 parent a80a36c commit ddeab3b

21 files changed

+823
-480
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
# This workflow will install dependencies, EYAML (from Ruby), and run all tests
2+
# and linting tools with every supported version of Python.
3+
# @see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
34

45
name: build
56

@@ -12,23 +13,23 @@ on:
1213
jobs:
1314
build:
1415

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

2021
steps:
21-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2223
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v5
2425
with:
2526
python-version: ${{ matrix.python-version }}
2627
- name: Set Environment Variables
2728
run: |
28-
echo "${HOME}/.gem/ruby/2.7.0/bin" >> $GITHUB_PATH
29+
echo "${HOME}/.local/share/gem/ruby/3.0.0/bin" >> $GITHUB_PATH
2930
- name: Install dependencies
3031
run: |
31-
gem install --user-install hiera-eyaml -v 2.1.0
32+
gem install --user-install hiera-eyaml
3233
python -m pip install --upgrade pip
3334
python -m pip install --upgrade setuptools
3435
python -m pip install --upgrade wheel
@@ -46,8 +47,3 @@ jobs:
4647
- name: Unit Test with pytest
4748
run: |
4849
pytest --verbose --cov=yamlpath --cov-report=term-missing --cov-fail-under=100 --script-launch-mode=subprocess tests
49-
- name: Publish coveralls Report
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
run: |
53-
coveralls --service=github
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow runs the full sweep of tests for the yamlpath package and publishes the coverage report to coveralls.io
2+
name: Publish Coverage Report to Coveralls.IO
3+
4+
on:
5+
push:
6+
branches: [ master, development ]
7+
pull_request:
8+
branches: [ master, development ]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
- name: Set Environment Variables
18+
run: |
19+
echo "${HOME}/.local/share/gem/ruby/3.0.0/bin" >> $GITHUB_PATH
20+
- name: Install dependencies
21+
run: |
22+
gem install --user-install hiera-eyaml
23+
python -m pip install --upgrade pip
24+
python -m pip install --upgrade setuptools
25+
python -m pip install --upgrade pytest pytest-cov pytest-console-scripts coveralls
26+
python -m pip install --editable .
27+
- name: Unit Test with pytest
28+
run: |
29+
pytest --verbose --cov=yamlpath --cov-report=term-missing --cov-fail-under=100 --script-launch-mode=subprocess tests
30+
- name: Publish coveralls Report
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
coveralls --service=github
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# SOURCE: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
1+
# Manually publish to production PyPI
2+
# @ssee: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
23
name: Upload PRODUCTION Python Package
34

45
on:
@@ -7,13 +8,13 @@ on:
78
jobs:
89
publish:
910
name: Publish to Production PyPI
10-
runs-on: ubuntu-20.04 # Use ubuntu-latest when https://github.com/actions/setup-python/issues/544 is fixed
11+
runs-on: ubuntu-latest
1112
environment: 'PyPI: Production'
1213

1314
steps:
14-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1516
- name: Set up Python 3.9
16-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v5
1718
with:
1819
python-version: '3.9'
1920
- name: Install Build Tools
@@ -24,7 +25,7 @@ jobs:
2425
run: |
2526
python setup.py sdist bdist_wheel
2627
- name: Publish Artifacts
27-
uses: pypa/gh-action-pypi-publish@v1.4.2
28+
uses: pypa/gh-action-pypi-publish@release/v1
2829
with:
2930
user: __token__
3031
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-publish-to-test-pypi.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# SOURCE: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
1+
# Test publishing to PyPI.
2+
# @see: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
23
name: Upload Python TEST Package
34

45
on:
@@ -13,23 +14,23 @@ on:
1314
jobs:
1415
validate:
1516
name: Code Quality Assessment
16-
runs-on: ubuntu-20.04 # Use ubuntu-latest when https://github.com/actions/setup-python/issues/544 is fixed
17+
runs-on: ubuntu-latest
1718
strategy:
1819
matrix:
19-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
20+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
2021

2122
steps:
22-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2324
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
25+
uses: actions/setup-python@v5
2526
with:
2627
python-version: ${{ matrix.python-version }}
2728
- name: Set Environment Variables
2829
run: |
29-
echo "${HOME}/.gem/ruby/2.7.0/bin" >> $GITHUB_PATH
30+
echo "${HOME}/.local/share/gem/ruby/3.0.0/bin" >> $GITHUB_PATH
3031
- name: Install dependencies
3132
run: |
32-
gem install --user-install hiera-eyaml -v 2.1.0
33+
gem install --user-install hiera-eyaml
3334
python -m pip install --upgrade pip
3435
python -m pip install --upgrade setuptools
3536
python -m pip install --upgrade wheel
@@ -56,9 +57,9 @@ jobs:
5657
needs: validate
5758

5859
steps:
59-
- uses: actions/checkout@v2
60+
- uses: actions/checkout@v4
6061
- name: Set up Python 3.9
61-
uses: actions/setup-python@v2
62+
uses: actions/setup-python@v5
6263
with:
6364
python-version: '3.9'
6465
- name: Install Build Tools
@@ -70,7 +71,7 @@ jobs:
7071
sed -i -r -e "s/(^__version__[[:space:]]*=[[:space:]]*)("'"'"[[:digit:]](\.[[:digit:]])+)"'"'"/\1\2.RC$(date "+%Y%m%d%H%M%S")"'"'"/" yamlpath/__init__.py
7172
python setup.py sdist bdist_wheel
7273
- name: Publish Artifacts
73-
uses: pypa/gh-action-pypi-publish@v1.4.2
74+
uses: pypa/gh-action-pypi-publish@release/v1
7475
with:
7576
user: __token__
7677
password: ${{ secrets.TEST_PYPI_API_TOKEN }}

.pylintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,5 +500,5 @@ min-public-methods=2
500500

501501
# Exceptions that will emit a warning when being caught. Defaults to
502502
# "BaseException, Exception".
503-
overgeneral-exceptions=BaseException,
504-
Exception
503+
# overgeneral-exceptions=BaseException,
504+
# Exception

CHANGES

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
3.8.2
2+
Enhancements:
3+
* The MergerConfig class now accepts overrides for config values as "keys" and
4+
"rules" keyword arguments to the constructor.
5+
Credit and my thanks go to https://github.com/leviem1!
6+
7+
BREAKING CHANGES:
8+
* Support for Python 3.6 has been dropped. This is forced by incompatibilities
9+
discovered with the latest version of pytest and because dependencies like
10+
dateutil and ruamel-yaml-clib no longer support Python 3.6. Support for
11+
Python 3.7 is tepid. While pytest is still working with Python 3.7, other
12+
dependencies are no longer supporting Python 3.7; however, the extensive
13+
tests for yamlpath show no issues with them, so far. For now, Python 3.12
14+
support is pending, waiting for the dateutil library to resolve a
15+
DeprecationWarning regarding its use of datetime.datetime.utcfromtimestamp().
16+
117
3.8.1
218
Bug Fixes:
319
* Fixed issue #220 reported by https://github.com/abramov-oleg wherein novel

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,11 @@ ephemeral or longer-lasting virtual Python environments.
271271
### Requirements
272272

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

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

917-
##### EYAML Compatibility Alert
918-
919-
The maintainers of the hiera-eyaml project have released version 3.x and it is
920-
*not backward compatible* with encryption certificates generated for
921-
hiera-eyaml version 2.x. This has nothing to do with YAML Path and is alerted
922-
here only as a courtesy to YAML Path users. **If you upgrade your
923-
installation of hiera-eyaml without first updating your encryption
924-
certificates and using a tool like eyaml-rotate-keys (provided here) to
925-
re-encrypt your data with the replacement certificates, hiera-eyaml 3.x will
926-
fail to decrypt your data!** This is *not* a problem with YAML Path.
927-
hiera-eyaml certificate compatibility is well outside the purview of YAML Path
928-
and its tools.
929-
930918
#### Get the Differences Between Two Documents
931919

932920
For routine use:

run-tests.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if ! [ -d tests -a -d yamlpath ]; then
88
fi
99

1010
if [ 1 -gt "$#" ]; then
11-
echo "You must specify at least one Python version. Space-delimit multiples like: $0 3.6 3.7 3.8" >&2
11+
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
1212
exit 2
1313
fi
1414

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

2121
for pythonVersion in "${@}"; do
22-
which deactivate &>/dev/null && deactivate &>/dev/null
22+
if which deactivate &>/dev/null; then
23+
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."
24+
deactivate
25+
fi
2326

2427
pyCommand=python${pythonVersion}
2528
if ! which "$pyCommand" &>/dev/null; then

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
classifiers=[
1616
"Development Status :: 5 - Production/Stable",
1717
"License :: OSI Approved :: ISC License (ISCL)",
18-
"Programming Language :: Python :: 3.6",
1918
"Programming Language :: Python :: 3.7",
2019
"Programming Language :: Python :: 3.8",
2120
"Programming Language :: Python :: 3.9",
@@ -43,7 +42,7 @@
4342
"yaml-diff = yamlpath.commands.yaml_diff:main",
4443
]
4544
},
46-
python_requires=">3.6.0",
45+
python_requires=">3.7.0",
4746
install_requires=[
4847
"ruamel.yaml>0.17.5,!=0.17.18,<=0.17.21",
4948
"python-dateutil<=3"

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def old_eyaml_keys(tmp_path_factory):
9696

9797
return (old_private_key_file, old_public_key_file)
9898

99-
@requireseyaml
10099
@pytest.fixture(scope="session")
101100
def new_eyaml_keys(tmp_path_factory):
102101
"""Creates temporary keys for encryption/decryption tests."""

0 commit comments

Comments
 (0)