From ab359547e23707825e4c34fd1e9fd59b5766bcba Mon Sep 17 00:00:00 2001 From: Jeremy Frasier Date: Wed, 7 May 2025 14:10:21 -0400 Subject: [PATCH 1/6] Upgrade to the latest version of the ansible-lint pre-commit hook Version 25.4.0 is the first version to support Fedora 42 in the Ansible YAML metadata schema. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c165bde..0760b36 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -165,7 +165,7 @@ repos: # Ansible hooks - repo: https://github.com/ansible/ansible-lint - rev: v25.1.3 + rev: v25.4.0 hooks: - id: ansible-lint additional_dependencies: From 4abc8aba31deb0cd334fb0df9887776174b43480 Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Fri, 23 May 2025 10:28:05 -0400 Subject: [PATCH 2/6] Test across more platforms Update the two testing jobs in the build workflow to test across these additional platforms (we are currently limited to only free offerings): - Linux on ARM64 - macOS on ARM64 - Windows on AMD64 --- .github/workflows/build.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8c4c62..5d2bd15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -201,16 +201,21 @@ jobs: uses: mxschmitt/action-tmate@v3 if: env.RUN_TMATE test: - name: test source - py${{ matrix.python-version }} + name: test source - py${{ matrix.python-version }} - ${{ matrix.platform }} needs: - diagnostics permissions: # actions/checkout needs this to fetch code contents: read - runs-on: ubuntu-latest + runs-on: ${{ matrix.platform }} strategy: fail-fast: false matrix: + platform: + - macos-latest + - ubuntu-24.04-arm + - ubuntu-latest + - windows-latest python-version: - "3.9" - "3.10" @@ -251,7 +256,8 @@ jobs: python-version: ${{ matrix.python-version }} - uses: actions/cache@v4 env: - BASE_CACHE_KEY: ${{ github.job }}-${{ runner.os }}-\ + BASE_CACHE_KEY: ${{ github.job }}-\ + ${{ runner.os }}-${{ runner.arch }}-\ py${{ steps.setup-python.outputs.python-version }}- with: path: ${{ env.PIP_CACHE_DIR }} @@ -404,17 +410,22 @@ jobs: uses: mxschmitt/action-tmate@v3 if: env.RUN_TMATE test-build: - name: test built wheel - py${{ matrix.python-version }} + name: test built wheel - py${{ matrix.python-version }} - ${{ matrix.platform }} needs: - diagnostics - build permissions: # actions/checkout needs this to fetch code contents: read - runs-on: ubuntu-latest + runs-on: ${{ matrix.platform }} strategy: fail-fast: false matrix: + platform: + - macos-latest + - ubuntu-24.04-arm + - ubuntu-latest + - windows-latest python-version: - "3.9" - "3.10" @@ -455,7 +466,8 @@ jobs: python-version: ${{ matrix.python-version }} - uses: actions/cache@v4 env: - BASE_CACHE_KEY: ${{ github.job }}-${{ runner.os }}-\ + BASE_CACHE_KEY: ${{ github.job }}-\ + ${{ runner.os }}-${{ runner.arch }}-\ py${{ steps.setup-python.outputs.python-version }}- with: path: ${{ env.PIP_CACHE_DIR }} From 7221c7f252d17e0c77a90293585b5653a9246d0e Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Fri, 13 Jun 2025 19:09:43 -0400 Subject: [PATCH 3/6] Explain platform selection in the `build` workflow Add a short comment that explains why we use the platforms we do in the `test` and `test-build` jobs in the `build` workflow. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d2bd15..728a0d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -211,6 +211,8 @@ jobs: strategy: fail-fast: false matrix: + # We test on all of the latest platforms available to use with GitHub- + # hosted runners for public repositories. platform: - macos-latest - ubuntu-24.04-arm @@ -421,6 +423,8 @@ jobs: strategy: fail-fast: false matrix: + # We test on all of the latest platforms available to use with GitHub- + # hosted runners for public repositories. platform: - macos-latest - ubuntu-24.04-arm From 7d338772b4bd86706c3bc5bb0e2f430ea5302a8e Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Fri, 23 May 2025 11:57:16 -0400 Subject: [PATCH 4/6] Adjust how package data is accessed Instead of creating a sub-package just to act as a file container we instead adjust the resource being accessed. This will prevent namespace cluttering while still providing access to the package data that is needed. This also follows logically with how the filesystem is organized where `data/secret.txt` is a resource of the `example` package. --- src/example/data/__init__.py | 5 ----- src/example/example.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 src/example/data/__init__.py diff --git a/src/example/data/__init__.py b/src/example/data/__init__.py deleted file mode 100644 index 7f11534..0000000 --- a/src/example/data/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""The example.data package.""" - -# This is necessary for the secret_message line using importlib to correctly -# work with Python 3.9. See here for more details: -# https://setuptools.pypa.io/en/latest/userguide/datafiles.html?utm_source=chatgpt.com#namespace-support diff --git a/src/example/example.py b/src/example/example.py index 7df5bac..d4d8af9 100644 --- a/src/example/example.py +++ b/src/example/example.py @@ -96,7 +96,7 @@ def main() -> None: # Access some data from our package data (see the setup.py) secret_message: str = ( - files(f"{__package__}.data").joinpath("secret.txt").read_text().strip() + files(__package__).joinpath("data/secret.txt").read_text().strip() ) logging.info('Secret="%s"', secret_message) From dc51c81c90e1db028c55abdb089e5036cbf88ddf Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Fri, 23 May 2025 12:11:13 -0400 Subject: [PATCH 5/6] Bump version from 0.2.1 to 0.2.2 --- src/example/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/example/_version.py b/src/example/_version.py index 3252c71..a0fb112 100644 --- a/src/example/_version.py +++ b/src/example/_version.py @@ -1,3 +1,3 @@ """This file defines the version of this module.""" -__version__ = "0.2.1" +__version__ = "0.2.2" From 9bdefe391c65f9ce94ecf8d6a783d0edb8816e99 Mon Sep 17 00:00:00 2001 From: Nick <50747025+mcdonnnj@users.noreply.github.com> Date: Fri, 23 May 2025 14:28:41 -0400 Subject: [PATCH 6/6] Separate the resource path argument to `joinpath` Breaking the resource path components into separate arguments will provide a cleaner approach to constructing the resource path. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/example/example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/example/example.py b/src/example/example.py index d4d8af9..b8edfd3 100644 --- a/src/example/example.py +++ b/src/example/example.py @@ -96,7 +96,7 @@ def main() -> None: # Access some data from our package data (see the setup.py) secret_message: str = ( - files(__package__).joinpath("data/secret.txt").read_text().strip() + files(__package__).joinpath("data", "secret.txt").read_text().strip() ) logging.info('Secret="%s"', secret_message)