Skip to content

Commit

Permalink
Upgrade python to 3.12 and upgrade workflow runner (#712)
Browse files Browse the repository at this point in the history
  • Loading branch information
harryzcy authored Nov 21, 2023
1 parent 9097cb8 commit 4bf4f5e
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/python/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:0-3.11"
"image": "mcr.microsoft.com/devcontainers/python:0-3.12"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Create Release

jobs:
get_version:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

Expand All @@ -30,7 +30,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 All @@ -39,10 +39,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand All @@ -61,7 +61,7 @@ jobs:
dist/icloud*.whl
build_linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_version]
defaults:
run:
Expand All @@ -70,10 +70,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand Down Expand Up @@ -105,10 +105,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand Down Expand Up @@ -140,10 +140,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand All @@ -166,7 +166,7 @@ jobs:
dist/icloud*
build_publish_docker:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_version]

steps:
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
short-description: ${{ github.event.repository.description }}

build_publish_npm:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_version,build_src,build_linux,build_macos,build_windows]
steps:
- name: Checkout code
Expand Down Expand Up @@ -245,16 +245,16 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish_pypi:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_version,build_src,build_linux,build_macos,build_windows]
steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand All @@ -276,7 +276,7 @@ jobs:
release:
needs: [get_version,build_src,build_linux,build_macos,build_windows]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:

get_version:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

Expand All @@ -35,7 +35,7 @@ jobs:
icloudpd_changelog: ${{steps.get_version.outputs.icloudpd_changelog}}

build_docker:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: [get_version]

steps:
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ on:
jobs:

lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -33,10 +33,10 @@ jobs:
scripts/lint
type_check:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -52,10 +52,10 @@ jobs:
scripts/type_check
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -72,7 +72,7 @@ jobs:
scripts/test
get_version:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

Expand All @@ -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 All @@ -103,10 +103,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand All @@ -125,7 +125,7 @@ jobs:
dist/icloud*.whl
build_linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_version]
defaults:
run:
Expand All @@ -134,10 +134,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand Down Expand Up @@ -169,10 +169,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand Down Expand Up @@ -204,10 +204,10 @@ jobs:
steps:
- uses: actions/checkout@v3

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

- name: Install Dev dependencies
run: |
Expand All @@ -230,7 +230,7 @@ jobs:
dist/icloud*
build_docker:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_version]

steps:
Expand Down Expand Up @@ -260,7 +260,7 @@ jobs:
icloudpd/icloudpd:${{needs.get_version.outputs.icloudpd_version}}
build_npm:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [get_version,build_src,build_linux,build_macos,build_windows]
steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-alpine3.17 as build
FROM python:3.12-alpine3.18 as build

WORKDIR /app

Expand All @@ -17,7 +17,7 @@ RUN pip3 install -e .[dev]

RUN pyinstaller -y --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata src/starters/exec.py

FROM alpine:3.17 as runtime
FROM alpine:3.18 as runtime

WORKDIR /app

Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version="1.16.2"
name = "icloudpd"
description = "icloudpd is a command-line tool to download photos and videos from iCloud."
readme = "README_PYPI.md"
requires-python = ">=3.8,<3.12"
requires-python = ">=3.8,<=3.12"
keywords = ["icloud", "photo"]
license = {file="LICENSE.md"}
authors=[
Expand All @@ -35,7 +35,6 @@ dependencies = [
"tzlocal==4.3.1",
"pytz==2022.7.1",
"certifi==2022.12.7",
"future==0.18.3",
"keyring==23.13.1",
"keyrings-alt==4.2.0"
]
Expand Down Expand Up @@ -93,5 +92,5 @@ where = ["src"] # list of folders that contain the packages (["."] by default)
exclude = ["starters"]

[[tool.mypy.overrides]]
module = ['piexif.*', 'future.*', 'vcr.*']
module = ['piexif.*', 'vcr.*']
ignore_missing_imports = true
2 changes: 1 addition & 1 deletion src/pyicloud_ipd/services/photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import pytz

from future.moves.urllib.parse import urlencode
from urllib.parse import urlencode

logger = logging.getLogger(__name__)

Expand Down
1 change: 0 additions & 1 deletion tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from icloudpd.base import main
from icloudpd.authentication import authenticator, TwoStepAuthRequiredError
import inspect
import shutil
import glob

from tests.helpers import path_from_project_root, recreate_path
Expand Down

0 comments on commit 4bf4f5e

Please sign in to comment.