Skip to content

Commit

Permalink
fix modulenotfound #748 (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyNikiforov authored Dec 22, 2023
1 parent 5594317 commit a34adb9
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 22 deletions.
148 changes: 144 additions & 4 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
scripts/lint
type_check:
runs-on: ubuntu-20.04
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
Expand All @@ -52,7 +52,7 @@ jobs:
scripts/type_check
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
icloudpd_changelog: ${{steps.get_version.outputs.icloudpd_changelog}}

build_src:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_version]
defaults:
run:
Expand Down Expand Up @@ -125,6 +125,8 @@ jobs:
dist/icloud*.whl
build_linux:
# run on earliest possible linux for better compatibility
# ubuntu 20.04 has glibc 2.31 -> manylinux_2_31
runs-on: ubuntu-20.04
needs: [get_version]
defaults:
Expand Down Expand Up @@ -160,6 +162,7 @@ jobs:
dist/icloud*
build_macos:
# earliest possible mac for better compatibility
runs-on: macos-11
needs: [get_version]
defaults:
Expand Down Expand Up @@ -195,6 +198,7 @@ jobs:
dist/icloud*
build_windows:
# earliest possible mac for better compatibility
runs-on: windows-2019
needs: [get_version]
defaults:
Expand Down Expand Up @@ -261,7 +265,7 @@ jobs:
build_npm:
runs-on: ubuntu-22.04
needs: [get_version,build_src,build_linux,build_macos,build_windows]
needs: [get_version,build_linux,build_macos,build_windows]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -292,3 +296,139 @@ jobs:
npm publish dist/npm/icloudpd --access public --dry-run=true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

validate_linux_bin_whl:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
needs: [get_version,build_linux]

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
path: |
dist
- name: Install Python Binary Wheel
run: |
pip install dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-py2.py3-none-manylinux_2_31_x86_64.whl
- name: Run icloud
run: |
icloud --help
- name: Run icloudpd
run: |
icloudpd --version
validate_macos_bin_whl:
strategy:
matrix:
os: [macos-11, macos-12]
runs-on: ${{ matrix.os }}
needs: [get_version,build_macos]

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
path: |
dist
- name: Install Python Binary Wheel
run: |
pip install dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-py2.py3-none-macosx_11_0_x86_64.macosx_11_0_arm64.whl
- name: Run icloud
run: |
icloud --help
- name: Run icloudpd
run: |
icloudpd --version
validate_windows_bin_whl:
strategy:
matrix:
os: [windows-2019, windows-2022]
runs-on: ${{ matrix.os }}
needs: [get_version,build_windows]

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
path: |
dist
- name: Install Python Binary Wheel
run: |
pip install dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-py2.py3-none-win_amd64.whl
- name: Run icloud
run: |
icloud --help
- name: Run icloudpd
run: |
icloudpd --version
validate_src_whl:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022]
runs-on: ${{ matrix.os }}
needs: [get_version,build_src]

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
path: |
dist
- name: Install Python Source Wheel
run: |
pip install dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-py3-none-any.whl
- name: Run icloud
run: |
icloud --help
- name: Run icloudpd
run: |
icloudpd --version
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- fix: module not found [#748](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/748)

## 1.17.1 (2023-12-20)

- fix: main macos binary failing [#668](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/668) [#700](https://github.com/icloud-photos-downloader/icloud_photos_downloader/issues/700)
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ test = [
Homepage="https://github.com/icloud-photos-downloader/icloud_photos_downloader"

[project.scripts]
icloudpd = "starters.icloudpd:main"
icloud = "starters.icloud:main"
icloudpd_ex = "starters.icloudpd_ex:main"
icloudpd = "icloudpd.base:main"
icloud = "pyicloud_ipd.cmdline:main"

[tool.pytest.ini_options]
log_format = "%(levelname)-8s %(message)s"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_bin_linux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

# prepare npm packages in dist
# expects dist to have comipled binary versions
# required param: version
# required params: version arch

pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd.py src/starters/icloud.py --name icloudpd-$1-linux-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloud.py --name icloud-$1-linux-$2
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_bin_macos
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

# prepare npm packages in dist
# expects dist to have comipled binary versions
# required param: version
# required params: version arch

pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd.py src/starters/icloud.py --name icloudpd-$1-macos-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloud.py --name icloud-$1-macos-$2
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_bin_windows
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

# prepare bin packages in dist
# expects python with installed dependencies
# required param: version
# required param: version arch

pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloudpd.py src/starters/icloud.py --name icloudpd-$1-windows-$2
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile src/starters/icloud.py --name icloud-$1-windows-$2
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_binary_dist_linux
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cp dist/icloudpd-$1-linux-amd64 dist/binary_dist/src/icloudpd/icloudpd
cp dist/icloud-$1-linux-amd64 dist/binary_dist/src/icloud/icloud
python3 -m pip wheel dist/binary_dist/ -w dist/binary_dist --no-deps --no-build-isolation

mv -f dist/binary_dist/icloudpd-$1-py2.py3-none-any.whl dist/icloudpd-$1-py2.py3-none-manylinux_2_17_x86_64.whl
mv -f dist/binary_dist/icloudpd-$1-py2.py3-none-any.whl dist/icloudpd-$1-py2.py3-none-manylinux_2_31_x86_64.whl

#audit manylinux
python3 -m auditwheel show dist/icloudpd-$1-py2.py3-none-manylinux_2_17_x86_64.whl
python3 -m auditwheel show dist/icloudpd-$1-py2.py3-none-manylinux_2_31_x86_64.whl
2 changes: 1 addition & 1 deletion scripts/build_binary_dist_windows
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

# prepare binary wheels in dist
# expects dist to have comipled binary versions
# required param: version
# required params: version
# https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#platform-compatibility-tags

# clean start
Expand Down
3 changes: 3 additions & 0 deletions src/icloudpd/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python
"""Main script that uses Click to parse command-line arguments"""
from __future__ import print_function
from multiprocessing import freeze_support
freeze_support() # fixing tqdm on macos

import os
import sys
import time
Expand Down
15 changes: 6 additions & 9 deletions src/starters/icloudpd.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env python

from multiprocessing import freeze_support
freeze_support() # fixing tqdm on macos

from icloudpd.base import main

if __name__ == "__main__":
main()
#!/usr/bin/env python

from icloudpd.base import main

if __name__ == "__main__":
main()

0 comments on commit a34adb9

Please sign in to comment.