Skip to content

Commit

Permalink
Merge pull request spyder-ide#22424 from mrclary/6.0.0_1
Browse files Browse the repository at this point in the history
PR: Prioritize conda-forge channel so that stable releases are pulled above unstable ones (Installers)
  • Loading branch information
dalthviz authored Sep 17, 2024
2 parents 2a9515b + 5b7dbd5 commit be3c654
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 10 deletions.
24 changes: 19 additions & 5 deletions .github/scripts/installer_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ check_prefix() {
fi

if [[ -d "$base_prefix" ]]; then
echo "\nContents of ${base_prefix}:"
echo -e "\nContents of ${base_prefix}:"
ls -al $base_prefix
else
echo "Base prefix does not exist!"
Expand All @@ -49,15 +49,16 @@ check_shortcut() {
shortcut=$($pythonexe $menuinst shortcut --mode=user)
if [[ -e "${shortcut}" ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "\n${shortcut}/Contents/MacOS contents:"
echo -e "\nContents of ${shortcut}/Contents/MacOS:"
ls -al "${shortcut}/Contents/MacOS"
echo -e "\n$shortcut/Contents/Info.plist contents:"
echo -e "\nContents of $shortcut/Contents/Info.plist:"
cat "${shortcut}/Contents/Info.plist"
script=$(compgen -G "${shortcut}/Contents/MacOS/spyder"*-script)
echo -e "\n${script} contents:"
echo -e "\nContents of ${script}:"
cat "${script}"
echo ""
elif [[ "$OSTYPE" == "linux"* ]]; then
echo -e "\n${shortcut} contents:"
echo -e "\nContents of ${shortcut}:"
cat $shortcut
fi
else
Expand All @@ -66,10 +67,23 @@ check_shortcut() {
fi
}

check_spyder_version() {
runtime_python=${base_prefix}/envs/spyder-runtime/bin/python
actual_version=$(${runtime_python} -c "import spyder; print(spyder.__version__)")
echo -e "\nExpected version = ${SPYVER}"
echo "Actual version = ${actual_version}"
if [[ "${SPYVER}" != "${actual_version}" ]]; then
echo "Error: installed Spyder version is incorrect!"
exit_status=1
fi
}

install || exit 1
echo -e "\n#############"
echo "Install info:"
check_prefix
check_uninstall
check_shortcut
check_spyder_version

exit $exit_status
31 changes: 28 additions & 3 deletions .github/workflows/installers-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ jobs:
[[ -n $CNAME ]] && args=("--cert-id" "$CNAME") || args=()
python build_installers.py ${args[@]}
SPYVER=$(python build_installers.py --version)
PKG_NAME=$(ls $DISTDIR | grep Spyder-)
echo "SPYVER=$SPYVER" >> $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${PKG_NAME%.*}" >> $GITHUB_ENV
echo "PKG_PATH=$DISTDIR/$PKG_NAME" >> $GITHUB_ENV
Expand All @@ -279,20 +281,43 @@ jobs:
run: |
set base_prefix=%USERPROFILE%\AppData\Local\spyder-6
start /wait %PKG_PATH% /InstallationType=JustMe /NoRegistry=1 /S
if exist %base_prefix%\install.log type %base_prefix%\install.log
echo.
if exist %base_prefix%\install.log (
echo Log output:
type %base_prefix%\install.log
) else (
echo No log found at %base_prefix%\install.log
)
set mode=system
for /F "tokens=*" %%i in (
'%base_prefix%\python %base_prefix%\Scripts\menuinst_cli.py shortcut --mode=%mode%'
) do (
set shortcut=%%~fi
)
echo.
if exist "%shortcut%" (
echo "Spyder installed successfully"
echo Spyder installed successfully
) else (
echo "Spyder NOT installed successfully"
echo Spyder NOT installed successfully
EXIT /B 1
)
set runtime_python=%base_prefix%\envs\spyder-runtime\python
for /F "tokens=*" %%i in (
'%runtime_python% -c "import spyder; print(spyder.__version__)"'
) do (
set actual_version=%%~i
)
echo.
echo Expected version = %SPYVER%
echo Actual version = %actual_version%
if %SPYVER% neq %actual_version% (
echo Error: installed Spyder version is incorrect!
EXIT /B 1
)
EXIT /B %ERRORLEVEL%
- name: Notarize or Compute Checksum
Expand Down
11 changes: 9 additions & 2 deletions installers-conda/build_installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
"--conda-lock", action="store_true",
help="Create conda-lock file and exit."
)
p.add_argument(
"--version", action="store_true",
help="Print Spyder version and exit."
)
args = p.parse_args()

yaml = YAML()
Expand Down Expand Up @@ -186,10 +190,10 @@ def _create_conda_lock(env_type='base'):

definitions = {
"channels": [
CONDA_BLD_PATH,
"conda-forge",
"conda-forge/label/spyder_dev",
"conda-forge/label/spyder_kernels_rc",
"conda-forge"
CONDA_BLD_PATH,
],
"dependencies": [k + v for k, v in specs.items()],
"platforms": [TARGET_PLATFORM]
Expand Down Expand Up @@ -511,5 +515,8 @@ def main():
_create_conda_lock(env_type='base')
_create_conda_lock(env_type='runtime')
sys.exit()
if args.version:
print(SPYVER)
sys.exit()

main()

0 comments on commit be3c654

Please sign in to comment.