Closed abbeycode closed 2 years ago
As I'm continuing to debug, it looks like the reason is applaud
requires Python ≥ 3.9, while Xcode 13.3 is shipping with 3.8.9. I'm hesitant to install a new Python version on it, since that will likely require Homebrew, which as mentioned in the original posting, I'm trying hard to avoid. I'll continue to update with what I find.
applaud
uses very limited type hints features in Python 3.9, it's very easy to replace these code, for example:
# Python 3.9:
list[Union[App, Build, BetaTester]]]
# 3.8 counterpart
from typing import List
List[Union[App, Build, BetaTester]]]
The same is true for Dict
and other types. You can fork applaudgen and make slight modifications to generate your own package in case you insist Python 3.8.
Yang
Thanks so much for that amazing suggestion. I got it working! This is my fork:
https://github.com/abbeycode/applaudgen.git (the python-3.8
branch).
To use it instead of the pip module, this is how I modified my ci_scripts/ci_pre_xcodebuild.sh script:
# All Xcode Cloud scripts run in Bash, but the is-at-least command from zsh is perfect for this
/bin/zsh <<'EOF'
autoload is-at-least
# Fail if Xcode Cloud ever gets upgraded to Python 3.9, so I can remove the hack
if is-at-least 3.9 $(cut -d' ' -f2 <<< "$(python3 --version)"); then
echo "No more need to manually install Applaud fork. Update script to call 'pip3 install applaud'"
exit 1
else
echo "Installing Applaud from a custom fork (instead of Pip) because Python is < 3.9"
fi
EOF
CLONEDIR=$(mktemp -d)/applaudgen
echo "Cloning applaud fork to ${CLONEDIR}"
git clone -b python-3.8 https://github.com/abbeycode/applaudgen.git --single-branch $CLONEDIR
echo "Installing Applaudgen's dependencies"
pip3 install jinja2
echo "Running Applaudgen"
$CLONEDIR/applaudgen.py -o applaud
rm -rf $CLONEDIR
echo "Installing Applaud's dependencies"
pip3 install requests
pip3 install deprecated
pip3 install pydantic
pip3 install email_validator
pip3 install --upgrade "pip>=20.3" # authlib needs Rust
pip3 install authlib
This is working now, using various calls (including multi-part screenshot uploads).
Hi! I want to interact with App Store Connect from my Xcode Cloud builds, and wrote a script using Applaud to do so. I can't successfully get Applaud installed there, though. Here's what I have:
ci_scripts/ci_pre_xcodebuild.sh
my_script.py
When running
pip3 install applaud --user
I get these errors (full output further below):Installing Requests works fine (
pip3 install requests --user
).Full output
I have tried many different ways of upgrading pip, and even installing pyenv (which I've ruled out because the Python installation for pyenv uses Homebrew which is incredibly slow in Xcode Cloud, and didn't work besides). What am I doing wrong, and how is installing Applaud different from installing Requests?