Skip to content

Commit

Permalink
GA
Browse files Browse the repository at this point in the history
  • Loading branch information
FI-Mihej committed Apr 1, 2024
1 parent b03fb62 commit e2c0425
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 25 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/test_app_dir_path_finder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ 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__cpython:
name: Build Cengal Shell wheels on ${{ matrix.os }} for CPython ${{ matrix.python-version }}
name: Test App Dir Path Finder on ${{ matrix.os }} for CPython ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -60,11 +61,12 @@ 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_x64__pypy:
# name: Build Cengal Shell wheels on ${{ matrix.os }} for PyPy ${{ matrix.python-version }}
# name: Test App Dir Path Finder on ${{ matrix.os }} for PyPy ${{ matrix.python-version }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
Expand Down Expand Up @@ -92,7 +94,7 @@ jobs:
# python ./cengal/file_system/app_fs_structure/app_dir_path/versions/v_0/development/print_app_dirs.py

# test_wheels__macos_arm64__pypy:
# name: Build Cengal Shell wheels on ${{ matrix.os }} for PyPy ${{ matrix.python-version }}
# name: Test App Dir Path Finder on ${{ matrix.os }} for PyPy ${{ matrix.python-version }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
Expand Down Expand Up @@ -145,6 +147,7 @@ jobs:
- name: Run tests
run: |
python -m pip install --upgrade pywin32
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
shell: cmd
Expand Down Expand Up @@ -205,6 +208,7 @@ jobs:
- name: Run tests
run: |
python -m pip install --upgrade pywin32
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
shell: cmd
Expand All @@ -219,19 +223,15 @@ jobs:
- image: "quay.io/pypa/manylinux2014_x86_64"
package-manager: "yum"
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
container: ${{ matrix.image }}
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 }}
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
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,52 @@
# __status__ = "Production"


from cengal.file_system.app_fs_structure.app_dir_path import AppDirectoryType, AppDirPath


def main():
for dir_type in AppDirectoryType:
adp: AppDirPath = AppDirPath()
print(f'<<< {dir_type.name} >>>')
print(adp(dir_type, with_structure=False, ensure_dir=False))
print(adp(dir_type, with_structure=True, ensure_dir=False))
print(adp(dir_type, 'test_app', with_structure=False, ensure_dir=False))
print(adp(dir_type, 'test_app', with_structure=True, ensure_dir=False))
print()

print('Done.')
from cengal.system import OS_TYPE

if 'Darwin' == OS_TYPE:
from Foundation import NSSearchPathForDirectoriesInDomains
from Foundation import NSDocumentDirectory, NSUserDomainMask

def get_documents_directory():
# Perform the search
paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, True)
if paths:
# Typically, you're interested in the first result
return paths[0]
else:
return None

# Example usage
documents_path = get_documents_directory()
print("Documents Directory:", documents_path)

def get_caches_directory():
# Perform the search
paths = NSSearchPathForDirectoriesInDomains(13, 1, True)
if paths:
# Typically, you're interested in the first result
return paths[0]
else:
return None

# Example usage
caches_path = get_caches_directory()
print("Caches Directory:", caches_path)
else:
from cengal.file_system.app_fs_structure.app_dir_path import AppDirectoryType, AppDirPath


def main():
for dir_type in AppDirectoryType:
adp: AppDirPath = AppDirPath()
print(f'<<< {dir_type.name} >>>')
print(adp(dir_type, with_structure=False, ensure_dir=False))
print(adp(dir_type, with_structure=True, ensure_dir=False))
print(adp(dir_type, 'test_app', with_structure=False, ensure_dir=False))
print(adp(dir_type, 'test_app', with_structure=True, ensure_dir=False))
print()

print('Done.')


if '__main__' == __name__:
Expand Down

0 comments on commit e2c0425

Please sign in to comment.