codemagic-ci-cd / cli-tools

Various utilities to managing Android and iOS app builds, code signing, and deployment.
https://codemagic.io/start/
GNU General Public License v3.0
244 stars 42 forks source link

Crash in keychain initialize on Python 3.11 #294

Closed adgeg closed 1 year ago

adgeg commented 1 year ago

Hi,

First, thanks for your great job! This issue seems equivalent to this one.

On Python 3.11, the output of keychain initialize is the following:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/Current/bin/keychain", line 5, in <module>
    from codemagic.tools import Keychain
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/codemagic/tools/__init__.py", line 1, in <module>
    from .android_app_bundle import AndroidAppBundle
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/codemagic/tools/android_app_bundle.py", line 35, in <module>
    class AndroidAppBundleArgument(cli.Argument):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/codemagic/tools/android_app_bundle.py", line 65, in AndroidAppBundleArgument
    KEYSTORE_PATH_REQUIRED = KEYSTORE_PATH.duplicate(argparse_kwargs={'required': True})
                             ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'duplicate'

Steps to reproduce on a Github action:

on:
  pull_request:

jobs:
  ko-on-python-11:
    runs-on: macos-11
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.11'

      - name: Install Codemagic CLI tools
        shell: bash
        run: |
          pip3 install codemagic-cli-tools
          xcrun xcodebuild -version

      - name: Set up a temporary keychain for code signing
        shell: bash
        run: |
          keychain initialize

  ok-on-python-10:
    runs-on: macos-11
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.10'

      - name: Install Codemagic CLI tools
        shell: bash
        run: |
          pip3 install codemagic-cli-tools
          xcrun xcodebuild -version

      - name: Set up a temporary keychain for code signing
        shell: bash
        run: |
          keychain initialize

Thanks for your support :)

priitlatt commented 1 year ago

Duplicate of #293.