Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into gotonext/prev
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed Jun 21, 2023
2 parents 507d2f8 + e1a7232 commit d6cf255
Show file tree
Hide file tree
Showing 416 changed files with 24,964 additions and 24,022 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ bdfe0b59821951584de3f72768693a151ca8350a
cb81f482d45f3303aefaf680db7d4f9624bc37ee
5af4f02d1b4d7f47bee0130b3dbcedc402da5248
646f321f146e5db5c00c01829fd0fdea0497a30e
a10a6a3ee18881c2b904a9e664bcee5912231508
c054f122bded27998ca69a24dc5a64df25764453
21 changes: 10 additions & 11 deletions .github/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ if [ "$USE_CONDA" = "true" ]; then
# Install test dependencies
micromamba install --file requirements/tests.yml

# To check our manifest and coverage
micromamba install check-manifest -c conda-forge codecov -q -y
# To check our manifest
micromamba install check-manifest -q -y

# Remove pylsp before installing its subrepo below
micromamba remove --force python-lsp-server python-lsp-server-base -y

# Install PyZMQ 24 to avoid hangs
micromamba install -c conda-forge pyzmq=24
else
# Update pip and setuptools
python -m pip install -U pip setuptools wheel build
Expand All @@ -38,30 +39,28 @@ else
# Install QtAwesome from Github
pip install git+https://github.com/spyder-ide/qtawesome.git

# To check our manifest and coverage
pip install -q check-manifest codecov
# To check our manifest
pip install -q check-manifest

# This allows the test suite to run more reliably on Linux
if [ "$OS" = "linux" ]; then
pip uninstall pyqt5 pyqt5-qt5 pyqt5-sip pyqtwebengine pyqtwebengine-qt5 -q -y
pip install pyqt5==5.12.* pyqtwebengine==5.12.*
fi

# Install PyZMQ 24 to avoid hangs
pip install pyzmq==24.0.1
fi

# Install subrepos from source
python -bb -X dev -W error install_dev_repos.py --not-editable --no-install spyder
python -bb -X dev install_dev_repos.py --not-editable --no-install spyder

# Install boilerplate plugin
pushd spyder/app/tests/spyder-boilerplate
pip install --no-deps -q -e .
popd

# Install Spyder to test it as if it was properly installed.
python -bb -X dev -W error -m build
python -bb -X dev -W error -m pip install --no-deps dist/spyder*.whl
python -bb -X dev -m build
python -bb -X dev -m pip install --no-deps dist/spyder*.whl

# Adjust PATH on Windows so that we can use conda below. This needs to be done
# at this point or the pip slots fail.
Expand Down
6 changes: 3 additions & 3 deletions .github/scripts/modules_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ for f in spyder/*/*.py; do
if [[ $f == spyder/widgets/browser.py ]]; then
continue
fi
if [[ $f == spyder/widgets/switcher.py ]]; then
continue
fi
if [[ $f == spyder/widgets/about.py ]]; then
continue
fi
Expand Down Expand Up @@ -139,6 +136,9 @@ for f in spyder/*/*/*/*/*.py; do
if [[ $f == spyder/plugins/variableexplorer/widgets/objectexplorer/__init__.py ]]; then
continue
fi
if [[ $f == spyder/plugins/editor/widgets/codeeditor/__init__.py ]]; then
continue
fi
python "$f"
if [ $? -ne 0 ]; then
exit 1
Expand Down
119 changes: 89 additions & 30 deletions .github/workflows/installers-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ on:
required: false
default: true
type: boolean
ssh:
description: 'Enable ssh debugging'
required: false
default: false
type: boolean
mac:
description: 'Build macOS installer'
required: false
Expand Down Expand Up @@ -50,6 +55,7 @@ env:
BUILD_MAC: ${{ github.event_name != 'workflow_dispatch' || inputs.mac }}
BUILD_LNX: ${{ github.event_name != 'workflow_dispatch' || inputs.linux }}
BUILD_WIN: ${{ github.event_name != 'workflow_dispatch' || inputs.win }}
ENABLE_SSH: ${{ github.event_name == 'workflow_dispatch' && inputs.ssh }}

jobs:
build-noarch-pkgs:
Expand Down Expand Up @@ -105,8 +111,6 @@ jobs:
- name: Determine Build Matrix
id: build-matrix
run: |
[[ $IS_RELEASE == "true" ]] && BUILD_WIN="false"
if [[ $BUILD_MAC == "true" ]]; then
target_platform="'osx-64'"
include="{'os': 'macos-11', 'target-platform': 'osx-64'}"
Expand Down Expand Up @@ -158,20 +162,13 @@ jobs:
with:
fetch-depth: 0

- name: Install pcregrep
if: runner.os == 'macOS'
run: |
if [[ -z "$(which pcregrep)" ]]; then
brew install pcre
else
echo "$(which pcregrep) already installed."
fi
- name: Setup Build Environment
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: installers-conda/build-environment.yml
extra-specs: python=${{ matrix.python-version }}
cache-downloads: true
cache-env: true

- name: Env Variables
run: |
Expand All @@ -184,7 +181,7 @@ jobs:
[[ -d $ARTIFACTS_PATH ]] || mkdir $ARTIFACTS_PATH
[[ -d $CONDA_BLD_PATH ]] || mkdir $CONDA_BLD_PATH
env
env | sort
- name: Download Local Conda Packages
if: needs.build-noarch-pkgs.result == 'success'
Expand Down Expand Up @@ -219,7 +216,7 @@ jobs:
if: runner.os == 'macOS' && (env.IS_RELEASE == 'true' || env.IS_PRE == 'true')
run: |
./certkeychain.sh "${MACOS_CERTIFICATE_PWD}" "${MACOS_CERTIFICATE}" "${MACOS_INSTALLER_CERTIFICATE}"
CNAME=$(security find-identity -p codesigning -v | pcregrep -o1 "\(([0-9A-Z]+)\)")
CNAME=$(security find-identity -p codesigning -v | pcre2grep -o1 "\(([0-9A-Z]+)\)")
echo "CNAME=$CNAME" >> $GITHUB_ENV
_codesign=$(which codesign)
Expand All @@ -233,50 +230,112 @@ jobs:
run: |
[[ -n $CNAME ]] && args=("--cert-id" "$CNAME") || args=()
python build_installers.py ${args[@]}
PKG_FILE=$(python build_installers.py --artifact-name)
PKG_NAME=$(basename $PKG_FILE)
echo "PKG_FILE=$PKG_FILE" >> $GITHUB_ENV
PKG_PATH=$(python build_installers.py --artifact-name)
PKG_NAME=$(basename $PKG_PATH)
PKG_GLOB=${PKG_PATH%.*}
PKG_BASE_NAME=${PKG_NAME%.*}
echo "PKG_PATH=$PKG_PATH" >> $GITHUB_ENV
echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV
echo "PKG_GLOB=$PKG_GLOB" >> $GITHUB_ENV
echo "PKG_BASE_NAME=$PKG_BASE_NAME" >> $GITHUB_ENV
- name: Test Application Bundle
- name: Test macOS Installer
if: runner.os == 'macOS'
run: |
installer -dumplog -pkg $PKG_FILE -target CurrentUserHomeDirectory 2>&1
# 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
app_path=$HOME/Applications/Spyder.app
if [[ -e "$app_path" ]]; then
echo "\nContents 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 ""
echo -e "\nContents of $app_path/Contents/MacOS/spyder-script:"
cat $app_path/Contents/MacOS/spyder-script
echo ""
echo -e "\n\nContents of" $HOME/Library/spyder-*/uninstall-spyder.sh :
cat $HOME/Library/spyder-*/uninstall-spyder.sh
else
echo "$app_path does not exist"
exit 1
fi
- name: Notarize package installer
if: runner.os == 'macOS' && (env.IS_RELEASE == 'true' || env.IS_PRE == 'true')
run: ./notarize.sh -p $APPLICATION_PWD $PKG_FILE
- name: Test Linux Installer
if: runner.os == 'Linux'
run: |
$PKG_PATH -b
shortcut_path=$HOME/.local/share/applications/spyder_spyder.desktop
if [[ -e $shortcut_path ]]; then
echo "\nContents of" $HOME/.local/spyder-* :
ls -al $HOME/.local/spyder-*
echo -e "\nContents of ${shortcut_path}:"
cat $shortcut_path
echo -e "\nContents of" $HOME/.local/spyder-*/uninstall-spyder.sh :
cat $HOME/.local/spyder-*/uninstall-spyder.sh
else
echo "$shortcut_path does not exist"
exit 1
fi
- name: Test Windows Installer
if: runner.os == 'Windows'
shell: cmd
run: |
start /wait %PKG_PATH% /InstallationType=JustMe /NoRegistry=1 /S
set "shortcut_path=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\spyder\Spyder.lnk"
if exist "%shortcut_path%" (
echo "Spyder installed successfully"
) else (
echo "Spyder NOT installed successfully"
EXIT /B 1
)
EXIT /B %ERRORLEVEL%
- name: Notarize or Compute Checksum
if: env.IS_RELEASE == 'true' || env.IS_PRE == 'true'
run: |
# Skip notarization for now because our Apple ID is expired.
if [[ $RUNNER_OS == "skip" ]]; then
./notarize.sh -p $APPLICATION_PWD $PKG_PATH
else
cd $(dirname $PKG_PATH)
echo $(sha256sum $PKG_NAME) > "${PKG_GLOB}-sha256sum.txt"
fi
- name: Setup Remote SSH Connection
# Notes:
# 1. This only works for conda, probably because it has the necessary
# MSYS2 packages to create the connection.
# 2. Check https://github.com/marketplace/actions/debugging-with-tmate for
# usage.
if: failure() && env.ENABLE_SSH == 'true'
uses: mxschmitt/action-tmate@v3
timeout-minutes: 45

- name: Upload Artifact
if: env.IS_RELEASE == 'false'
uses: actions/upload-artifact@v3
with:
path: ${{ env.PKG_FILE }}
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_GLOB }}*
name: ${{ env.PKG_BASE_NAME }}

- name: Get Release
if: env.IS_RELEASE == 'true'
uses: bruceadams/get-release@v1.3.2
id: get_release
env:
GITHUB_TOKEN: ${{ github.token }}
uses: bruceadams/get-release@v1.2.0

- name: Upload Release Asset
if: env.IS_RELEASE == 'true'
uses: actions/upload-release-asset@v1
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ env.PKG_FILE }}
asset_name: ${{ env.PKG_NAME }}
asset_content_type: application/octet-stream
asset_path: ${{ env.PKG_GLOB }}*
6 changes: 4 additions & 2 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,7 @@ jobs:
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh
- name: Coverage
shell: bash -l {0}
run: codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
6 changes: 4 additions & 2 deletions .github/workflows/test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,7 @@ jobs:
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh
- name: Coverage
shell: bash -l {0}
run: codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
6 changes: 4 additions & 2 deletions .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,7 @@ jobs:
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh
- name: Coverage
shell: bash -l {0}
run: codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
Loading

0 comments on commit d6cf255

Please sign in to comment.