Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Update for new menuinst and friends and new Spyder feedstock (Installers) #21647

Merged
merged 22 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f96a9ae
Check for file created by installer rather than spyder-menu.json.
mrclary Dec 22, 2023
5df189e
Patch Spyder source version to match installer version
mrclary Dec 22, 2023
fad66b8
Use correct feedstock repository branch
mrclary Dec 22, 2023
88eba73
Update conda, conda-standalone, constructor, and menuinst for menuins…
mrclary Jan 9, 2024
7670e4a
Use more robust check for sed version.
mrclary Dec 26, 2023
5752efb
Ensure correct shortcut path by querying menuinst.
mrclary Jan 9, 2024
8c78c07
Do not register environments
mrclary Jan 8, 2024
60bb1ae
Do not remove osx_is_app or app section.
mrclary Dec 27, 2023
b1ad5b6
Do not need to patch build script
mrclary Dec 27, 2023
9f1b97e
Do not need to patch menu json file
mrclary Dec 22, 2023
dd0d881
Revise condarc
mrclary Dec 27, 2023
ec4a865
Use condarc channels which should include spyder_kernels_rc, spyder_d…
mrclary Dec 27, 2023
afbfc48
Ensure quotes are removed and don't inadvertently add whitespace
mrclary Jan 11, 2024
ed85891
Set conda-based-app in pre-install script instead of post-install scr…
mrclary Jan 9, 2024
5efba58
Accommodate bundle name with spaces and properly quote variable expan…
mrclary Feb 1, 2024
18d7b04
squash spaces
mrclary Feb 2, 2024
5cf74e5
Add logging for Windows installer
mrclary Jan 26, 2024
d27aff1
GitHub Actions are run as administrator so menuinst installs shortcut…
mrclary Jan 26, 2024
5804756
Create temporary cert file and keychain in temporary directory
mrclary Feb 2, 2024
5353b3a
Add CLI for menuinst and combine macOS and Linux installer test in in…
mrclary Feb 2, 2024
8ae856b
Unix system install considerations.
mrclary Feb 2, 2024
accc1c2
Apply suggestion from code review
mrclary Feb 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/scripts/installer_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/usr/bin/env bash

# This script tests the installer for macOS and Linux on CI
# and will only install for the local user.

exit_status=0

install() {
if [[ "$OSTYPE" == "darwin"* ]]; then
# Stream install.log to stdout to view all log messages.
tail -F /var/log/install.log & tail_id=$!
trap "kill -s TERM $tail_id" EXIT

installer -pkg $PKG_PATH -target CurrentUserHomeDirectory >/dev/null
elif [[ "$OSTYPE" == "linux"* ]]; then
$PKG_PATH -b
fi
}

check_prefix() {
if [[ "$OSTYPE" == "darwin"* ]]; then
base_prefix=$(compgen -G $HOME/Library/spyder-*)
elif [[ "$OSTYPE" == "linux"* ]]; then
base_prefix=$(compgen -G $HOME/.local/spyder-*)
fi

if [[ -d "$base_prefix" ]]; then
echo "\nContents of ${base_prefix}:"
ls -al $base_prefix
else
echo "$base_prefix does not exist!"
exit 1
fi
}

check_uninstall() {
if [[ -e "${base_prefix}/uninstall-spyder.sh" ]]; then
echo -e "\nContents of ${base_prefix}/uninstall-spyder.sh:"
cat $base_prefix/uninstall-spyder.sh
else
echo "${base_prefix}/uninstall-spyder.sh does not exist!"
exit_status=1
fi
}

check_shortcut() {
pythonexe=${base_prefix}/bin/python
menuinst=${base_prefix}/bin/menuinst_cli.py
shortcut=$($pythonexe $menuinst shortcut --mode=user)
if [[ -e "${shortcut}" ]]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "\n${shortcut}/Contents/MacOS contents:"
ls -al "${shortcut}/Contents/MacOS"
echo -e "\n$shortcut/Contents/Info.plist contents:"
cat "${shortcut}/Contents/Info.plist"
script=$(compgen -G "${shortcut}/Contents/MacOS/spyder"*-script)
echo -e "\n${script} contents:"
cat "${script}"
elif [[ "$OSTYPE" == "linux"* ]]; then
echo -e "\n${shortcut} contents:"
cat $shortcut
fi
else
echo "$shortcut does not exist"
exit_status=1
fi
}

install
echo "Install info:"
check_prefix
check_uninstall
check_shortcut

exit $exit_status
2 changes: 1 addition & 1 deletion .github/workflows/build-subrepos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
environment-file: installers-conda/build-environment.yml
environment-name: spy-inst
create-args: >-
--channel-priority=strict
--channel-priority=flexible
python=${{ matrix.python-version }}
cache-downloads: true
cache-environment: true
Expand Down
90 changes: 30 additions & 60 deletions .github/workflows/installers-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ jobs:
MACOS_INSTALLER_CERTIFICATE: ${{ secrets.MACOS_INSTALLER_CERTIFICATE }}
APPLICATION_PWD: ${{ secrets.APPLICATION_PWD }}
CONSTRUCTOR_TARGET_PLATFORM: ${{ matrix.target-platform }}
NSIS_USING_LOG_BUILD: 1

steps:
- name: Checkout Code
Expand Down Expand Up @@ -156,13 +157,27 @@ jobs:
enableCrossOsArchive: true
fail-on-cache-miss: true

- name: Setup Build Environment
- name: Setup Build Environment (Windows)
if: runner.os == 'Windows'
uses: mamba-org/setup-micromamba@v1
with:
environment-file: installers-conda/build-environment.yml
environment-name: spy-inst
create-args: >-
--channel-priority=strict
--channel-priority=flexible
python=${{ matrix.python-version }}
nsis>=3.08=*_log_*
cache-downloads: true
cache-environment: true

- name: Setup Build Environment (macOS & Linux)
if: runner.os != 'Windows'
uses: mamba-org/setup-micromamba@v1
with:
environment-file: installers-conda/build-environment.yml
environment-name: spy-inst
create-args: >-
--channel-priority=flexible
python=${{ matrix.python-version }}
cache-downloads: true
cache-environment: true
Expand All @@ -185,7 +200,7 @@ jobs:
CONDA_BLD_PATH: ${{ runner.temp }}/conda-bld
run: |
conda config --set bld_path $CONDA_BLD_PATH
mamba index $CONDA_BLD_PATH
conda index $CONDA_BLD_PATH
mamba search -c local --override-channels || true

- name: Create Keychain
Expand Down Expand Up @@ -225,70 +240,25 @@ jobs:
echo "PKG_GLOB=$PKG_GLOB" >> $GITHUB_ENV
echo "PKG_BASE_NAME=$PKG_BASE_NAME" >> $GITHUB_ENV

- name: Test macOS Installer
if: runner.os == 'macOS'
run: |
# Stream install.log to stdout to view all log messages.
tail -F /var/log/install.log & tail_id=$!
trap "kill -s TERM $tail_id" EXIT

installer -pkg $PKG_PATH -target CurrentUserHomeDirectory >/dev/null

root_prefix=$(compgen -G $HOME/Library/spyder-*)

echo "Install info:"
echo "Contents of ${root_prefix}:"
ls -al $root_prefix
echo -e "\nContents of ${root_prefix}/uninstall-spyder.sh:"
cat $root_prefix/uninstall-spyder.sh

app_path=/Applications/Spyder.app
[[ -e ${root_prefix}/.nonadmin ]] && app_path=${HOME}${app_path}

if [[ -e "$app_path" ]]; then
echo "Contents of $app_path/Contents/MacOS:"
ls -al $app_path/Contents/MacOS
echo -e "\nContents of $app_path/Contents/Info.plist:"
cat $app_path/Contents/Info.plist
echo -e "\nContents of $app_path/Contents/MacOS/spyder-script:"
cat $app_path/Contents/MacOS/spyder-script
else
echo "$app_path does not exist"
exit 1
fi

- name: Test Linux Installer
if: runner.os == 'Linux'
run: |
$PKG_PATH -b

root_prefix=$(compgen -G $HOME/.local/spyder-*)

echo "Install info:"
echo "Contents of ${root_prefix}:"
ls -al $root_prefix
echo -e "\nContents of ${root_prefix}/uninstall-spyder.sh:"
cat ${root_prefix}/uninstall-spyder.sh

shortcut_path=/share/applications/spyder_spyder.desktop
[[ -e ${root_prefix}/.nonadmin ]] && shortcut_path=${HOME}/.local${shortcut_path} || shortcut_path=/usr${shortcut_path}

if [[ -e $shortcut_path ]]; then
echo -e "\nContents of ${shortcut_path}:"
cat $shortcut_path
else
echo "$shortcut_path does not exist"
exit 1
fi
- name: Test macOS or Linux Installer
if: runner.os != 'Windows'
run: ${{ github.workspace }}/.github/scripts/installer_test.sh

- name: Test Windows Installer
if: runner.os == 'Windows'
shell: cmd
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

set "shortcut_path=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\spyder\Spyder.lnk"
if exist "%shortcut_path%" (
set mode=system
for /F "tokens=*" %%i in (
'%base_prefix%\python %base_prefix%\Scripts\menuinst_cli.py shortcut --mode=%mode%'
) do (
set shortcut=%%~fi
)
if exist "%shortcut%" (
echo "Spyder installed successfully"
) else (
echo "Spyder NOT installed successfully"
Expand Down
10 changes: 5 additions & 5 deletions installers-conda/build-environment.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: spy-inst
channels:
- napari/label/bundle_tools_3
- conda-forge
dependencies:
- boa
- conda
- conda-standalone
- constructor
- conda >=23.11.0
- conda-standalone >=23.11.0
- constructor >=3.6.0
- gitpython
- menuinst
- mamba
- menuinst >=2.0.2
- ruamel.yaml.jinja2
- setuptools_scm
Loading
Loading