diff --git a/.github/workflows/test_app_dir_path_finder.yaml b/.github/workflows/test_app_dir_path_finder.yaml index 0cc5250b5..7d5f65773 100644 --- a/.github/workflows/test_app_dir_path_finder.yaml +++ b/.github/workflows/test_app_dir_path_finder.yaml @@ -7,72 +7,14 @@ on: branches: [ master ] jobs: - macos_x64__cpython: - name: macos_x64__cpython. Test App Dir Path Finder on ${{ matrix.os }} for CPython ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - # macos-13 is an intel runner, macos-14 is apple silicon - os: [macos-13] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install basic Python dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install --upgrade wheel - - - name: Run tests - run: | - python -m pip install --upgrade pyobjc - python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] - python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py - - macos_arm64__cpython: - name: macos_arm64__cpython. Test App Dir Path Finder on ${{ matrix.os }} for CPython ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - # macos-13 is an intel runner, macos-14 is apple silicon - os: [macos-14] - python-version: ['3.10', '3.11', '3.12'] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install basic Python dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install --upgrade wheel - - - name: Run tests - run: | - python -m pip install --upgrade pyobjc - python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] - python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py - - # test_wheels__macos_x64__pypy: - # name: Test App Dir Path Finder on ${{ matrix.os }} for PyPy ${{ matrix.python-version }} + # macos_x64__cpython: + # name: macos_x64__cpython. Test App Dir Path Finder on ${{ matrix.os }} for CPython ${{ matrix.python-version }} # runs-on: ${{ matrix.os }} # strategy: # matrix: # # macos-13 is an intel runner, macos-14 is apple silicon # os: [macos-13] - # python-version: ['pypy-3.8', 'pypy-3.9', 'pypy-3.10'] + # python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # steps: # - uses: actions/checkout@v4 @@ -90,17 +32,18 @@ jobs: # - name: Run tests # run: | + # python -m pip install --upgrade pyobjc # python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] # python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py - # test_wheels__macos_arm64__pypy: - # name: Test App Dir Path Finder on ${{ matrix.os }} for PyPy ${{ matrix.python-version }} + # macos_arm64__cpython: + # name: macos_arm64__cpython. Test App Dir Path Finder on ${{ matrix.os }} for CPython ${{ matrix.python-version }} # runs-on: ${{ matrix.os }} # strategy: # matrix: # # macos-13 is an intel runner, macos-14 is apple silicon # os: [macos-14] - # python-version: ['pypy-3.8', 'pypy-3.9', 'pypy-3.10'] + # python-version: ['3.10', '3.11', '3.12'] # steps: # - uses: actions/checkout@v4 @@ -118,9 +61,66 @@ jobs: # - name: Run tests # run: | + # python -m pip install --upgrade pyobjc # python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] # python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py + # # macos_x64__pypy: + # # name: Test App Dir Path Finder on ${{ matrix.os }} for PyPy ${{ matrix.python-version }} + # # runs-on: ${{ matrix.os }} + # # strategy: + # # matrix: + # # # macos-13 is an intel runner, macos-14 is apple silicon + # # os: [macos-13] + # # python-version: ['pypy-3.8', 'pypy-3.9', 'pypy-3.10'] + + # # steps: + # # - uses: actions/checkout@v4 + + # # - name: Set up Python ${{ matrix.python-version }} + # # uses: actions/setup-python@v2 + # # with: + # # python-version: ${{ matrix.python-version }} + + # # - name: Install basic Python dependencies + # # run: | + # # python -m pip install --upgrade pip + # # python -m pip install --upgrade setuptools + # # python -m pip install --upgrade wheel + + # # - name: Run tests + # # run: | + # # python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] + # # python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py + + # # macos_arm64__pypy: + # # name: Test App Dir Path Finder on ${{ matrix.os }} for PyPy ${{ matrix.python-version }} + # # runs-on: ${{ matrix.os }} + # # strategy: + # # matrix: + # # # macos-13 is an intel runner, macos-14 is apple silicon + # # os: [macos-14] + # # python-version: ['pypy-3.8', 'pypy-3.9', 'pypy-3.10'] + + # # steps: + # # - uses: actions/checkout@v4 + + # # - name: Set up Python ${{ matrix.python-version }} + # # uses: actions/setup-python@v2 + # # with: + # # python-version: ${{ matrix.python-version }} + + # # - name: Install basic Python dependencies + # # run: | + # # python -m pip install --upgrade pip + # # python -m pip install --upgrade setuptools + # # python -m pip install --upgrade wheel + + # # - name: Run tests + # # run: | + # # python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] + # # python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py + windows_2019_x64__cpython: name: windows_2019_x64__cpython. Test App Dir Path Finder on ${{ matrix.os }} for CPython ${{ matrix.python-version }} runs-on: ${{ matrix.os }} @@ -223,27 +223,45 @@ jobs: - image: "quay.io/pypa/manylinux2014_x86_64" package-manager: "yum" python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - container: - image: ${{ matrix.image }} - options: -v ${{ github.workspace }}:/github/workspace --workdir /github/workspace + steps: - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} + + # Prepare the Docker container without starting it + - name: Create Docker container + id: create-container run: | - yum install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-pip - python -m pip install --upgrade pip setuptools wheel - - - name: Install basic Python dependencies + CONTAINER_ID=$(docker create -w /github/workspace --entrypoint /bin/bash ${{ matrix.image }}) + echo "::set-output name=id::$CONTAINER_ID" + shell: bash + + # Copy the checked-out repository into the Docker container + - name: Copy workspace to container run: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install --upgrade wheel - - - name: Run tests + docker cp . ${{ steps.create-container.outputs.id }}:/github/workspace + + # Start the container and keep it running so subsequent commands can execute within it + - name: Start container run: | - python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] - python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py + docker start ${{ steps.create-container.outputs.id }} + + # Execute commands within the Docker container + - name: Set up Python in the Docker container + run: | + docker exec ${{ steps.create-container.outputs.id }} yum install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-pip + docker exec ${{ steps.create-container.outputs.id }} python -m pip install --upgrade pip setuptools wheel + + # Continue with your setup and test execution steps + - name: Install basic Python dependencies in the Docker container + run: | + docker exec ${{ steps.create-container.outputs.id }} python -m pip install --upgrade pip + docker exec ${{ steps.create-container.outputs.id }} python -m pip install --upgrade setuptools + docker exec ${{ steps.create-container.outputs.id }} python -m pip install --upgrade wheel + + - name: Run tests in the Docker container + run: | + docker exec ${{ steps.create-container.outputs.id }} python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] + docker exec ${{ steps.create-container.outputs.id }} python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py # test_wheels__linux_manylinux2014_x86_64__pypy: # name: Test on Docker ${{ matrix.image }} for CPython ${{ matrix.python-version }} @@ -281,74 +299,74 @@ jobs: # python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] # python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py - musllinux_1_1_x86_64__cpython: - name: musllinux_1_1_x86_64__cpython. Test on Docker ${{ matrix.image }} for CPython ${{ matrix.python-version }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - image: "quay.io/pypa/musllinux_1_1_x86_64" - package-manager: "apk" - python-version: ['3.8', '3.9', '3.10'] - container: ${{ matrix.image }} - steps: - - uses: actions/checkout@v4 + # musllinux_1_1_x86_64__cpython: + # name: musllinux_1_1_x86_64__cpython. Test on Docker ${{ matrix.image }} for CPython ${{ matrix.python-version }} + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # include: + # - image: "quay.io/pypa/musllinux_1_1_x86_64" + # package-manager: "apk" + # python-version: ['3.8', '3.9', '3.10'] + # container: ${{ matrix.image }} + # steps: + # - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - run: | - if [ "${{ matrix.package-manager }}" = "yum" ]; then - yum install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-pip - elif [ "${{ matrix.package-manager }}" = "apk" ]; then - apk add --update python3 - ln -sf python3 /usr/bin/python - python -m ensurepip - fi - python -m pip install --upgrade pip setuptools wheel + # - name: Set up Python ${{ matrix.python-version }} + # run: | + # if [ "${{ matrix.package-manager }}" = "yum" ]; then + # yum install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-pip + # elif [ "${{ matrix.package-manager }}" = "apk" ]; then + # apk add --update python3 + # ln -sf python3 /usr/bin/python + # python -m ensurepip + # fi + # python -m pip install --upgrade pip setuptools wheel - - name: Install basic Python dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install --upgrade wheel + # - name: Install basic Python dependencies + # run: | + # python -m pip install --upgrade pip + # python -m pip install --upgrade setuptools + # python -m pip install --upgrade wheel - - name: Run tests - run: | - python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] - python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py + # - name: Run tests + # run: | + # python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] + # python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py - musllinux_1_2_x86_64__cpython: - name: musllinux_1_2_x86_64__cpython. Test on Docker ${{ matrix.image }} for CPython ${{ matrix.python-version }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - image: "quay.io/pypa/musllinux_1_2_x86_64" - package-manager: "apk" - python-version: ['3.11', '3.12'] - container: ${{ matrix.image }} - steps: - - uses: actions/checkout@v4 + # musllinux_1_2_x86_64__cpython: + # name: musllinux_1_2_x86_64__cpython. Test on Docker ${{ matrix.image }} for CPython ${{ matrix.python-version }} + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # include: + # - image: "quay.io/pypa/musllinux_1_2_x86_64" + # package-manager: "apk" + # python-version: ['3.11', '3.12'] + # container: ${{ matrix.image }} + # steps: + # - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - run: | - if [ "${{ matrix.package-manager }}" = "yum" ]; then - yum install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-pip - elif [ "${{ matrix.package-manager }}" = "apk" ]; then - apk add --update python3 - ln -sf python3 /usr/bin/python - python -m ensurepip - fi - python -m pip install --upgrade pip setuptools wheel + # - name: Set up Python ${{ matrix.python-version }} + # run: | + # if [ "${{ matrix.package-manager }}" = "yum" ]; then + # yum install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-pip + # elif [ "${{ matrix.package-manager }}" = "apk" ]; then + # apk add --update python3 + # ln -sf python3 /usr/bin/python + # python -m ensurepip + # fi + # python -m pip install --upgrade pip setuptools wheel - - name: Install basic Python dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install --upgrade wheel + # - name: Install basic Python dependencies + # run: | + # python -m pip install --upgrade pip + # python -m pip install --upgrade setuptools + # python -m pip install --upgrade wheel - - name: Run tests - run: | - python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] - python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py + # - name: Run tests + # run: | + # python -m pip install --upgrade cengal_light[cengal__file_system__app_fs_structure__app_dir_path] + # python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py diff --git a/cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py b/cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py index 4a7fb207f..a66432625 100644 --- a/cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py +++ b/cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py @@ -68,12 +68,16 @@ def get_caches_directory(): def main(): from ctypes import POINTER, byref, c_wchar_p from cengal.ctypes_tools.types import GUID + from cengal.ctypes_tools.constants import KnownfolderidConstants, S_OK + from cengal.ctypes_tools.function_prototypes import SHGetKnownFolderPath as proto_SHGetKnownFolderPath, CoTaskMemFree + from cengal.file_system.directory_manager import ensure_dir as ensure_dir_exists from cengal.ctypes_tools.tools import cwfunc_def + from typing import Union, Sequence, Any from ctypes import POINTER, byref, windll, WinError - from ctypes.wintypes import HRESULT, DWORD, HANDLE + from ctypes.wintypes import DWORD, HANDLE + from ctypes import HRESULT, byref, pointer, wintypes, windll, WINFUNCTYPE from ctypes import c_wchar_p from uuid import UUID - from typing import Union, Sequence, Any # Assuming cwfunc_def is defined as before and shell32 is loaded appropriately # Also assuming GUID is defined correctly elsewhere, for example: