Skip to content

Commit

Permalink
Merge branch 'finderwidget' into profile_script
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed Jun 22, 2022
2 parents b612117 + 39fc0c0 commit a7090ae
Show file tree
Hide file tree
Showing 56 changed files with 1,155 additions and 980 deletions.
48 changes: 10 additions & 38 deletions .github/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,9 @@ if [ "$USE_CONDA" = "true" ]; then

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

# Remove packages we have subrepos for.
for dep in $(ls external-deps)
do
echo "Removing $dep package"

if [ "$dep" = "qtconsole" ]; then
conda remove qtconsole-base qtconsole --force -q -y
else
conda remove $dep --force -q -y
fi
done

else
# Update pip and setuptools
python -m pip install -U pip setuptools
python -m pip install -U pip setuptools wheel build

# Install Spyder and its dependencies from our setup.py
pip install -e .[test]
Expand All @@ -50,40 +37,25 @@ else
# To check our manifest and coverage
pip install -q check-manifest codecov

# Remove packages we have subrepos for
for dep in $(ls external-deps)
do
echo "Removing $dep package"
pip uninstall $dep -q -y
done
# 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

# Remove Spyder to properly install it below
pip uninstall spyder -q -y
fi

# Install subrepos in development mode
for dep in $(ls external-deps)
do
echo "Installing $dep subrepo"

# This is necessary to pass our minimal required version of PyLSP to setuptools-scm
if [ "$dep" = "python-lsp-server" ]; then
SETUPTOOLS_SCM_PRETEND_VERSION=`python pylsp_utils.py` pip install --no-deps -q -e external-deps/$dep
else
pip install --no-deps -q -e external-deps/$dep
fi
done
# Install subrepos from source
python -bb -X dev -W error 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.
# Note: `python setup.py egg_info` doesn't work here but it
# does locally.
python setup.py -q bdist_wheel
pip install --no-deps -q dist/spyder*.whl
python -bb -X dev -W error -m build
python -bb -X dev -W error -m pip install --no-deps dist/spyder*.whl

# Create environment for Jedi environments tests
mamba create -n jedi-test-env -q -y python=3.6 flask spyder-kernels
Expand Down
17 changes: 17 additions & 0 deletions .github/scripts/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -ex

# Adjust PATH in macOS
if [ "$OS" = "macos" ]; then
PATH=/Users/runner/miniconda3/envs/test/bin:/Users/runner/miniconda3/condabin:$PATH
fi

# Rename log file before running the test suite. Its contents will be read
# before the next run (see conftest.py in the root of the repo).
mv log.txt pytest_log.txt

# Run tests
if [ "$OS" = "linux" ]; then
xvfb-run --auto-servernum python runtests.py --color=yes | tee log.txt
else
python runtests.py --color=yes | tee log.txt
fi
31 changes: 18 additions & 13 deletions .github/workflows/installer-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ on:
name: Create macOS App Bundle and DMG

jobs:
matrix_prep:
name: Determine Build Matrix
runs-on: macos-10.15
outputs:
build_type: ${{ steps.set-matrix.outputs.build_type }}
steps:
- id: set-matrix
run: |
if [[ ${GITHUB_EVENT_NAME} == 'release' ]]; then
build_type=$(echo "['Full', 'Lite']")
else
build_type=$(echo "['Full']")
fi
echo "::set-output name=build_type::{'build_type':$(echo $build_type)}"
build:
name: macOS App Bundle
runs-on: macos-10.15
needs: matrix_prep
strategy:
matrix:
build_type: ['Full', 'Lite']
matrix: ${{fromJson(needs.matrix_prep.outputs.build_type)}}
defaults:
run:
shell: bash -l {0}
Expand All @@ -38,20 +52,11 @@ jobs:
if [[ -z ${LITE_FLAG} ]]; then
INSTALL_FLAGS+=('-r' 'req-scientific.txt')
fi
${pythonLocation}/bin/python -m pip install -U pip setuptools wheel
${pythonLocation}/bin/python -m pip install -U pip setuptools
${pythonLocation}/bin/python -m pip install -r req-build.txt -r req-extras.txt -r req-plugins.txt "${INSTALL_FLAGS[@]}" -e ${GITHUB_WORKSPACE}
- name: Install Subrepos
if: ${{github.event_name == 'pull_request'}}
run: |
for dep in $(ls ${GITHUB_WORKSPACE}/external-deps)
do
if [ "$dep" = "python-lsp-server" ]; then
SETUPTOOLS_SCM_PRETEND_VERSION=`${pythonLocation}/bin/python ${GITHUB_WORKSPACE}/pylsp_utils.py` \
${pythonLocation}/bin/python -m pip install ${GITHUB_WORKSPACE}/external-deps/$dep
else
${pythonLocation}/bin/python -m pip install ${GITHUB_WORKSPACE}/external-deps/$dep
fi
done
run: ${pythonLocation}/bin/python -bb -X dev -W error ${GITHUB_WORKSPACE}/install_dev_repos.py --not-editable --no-install spyder
- name: Show Build Environment
run: |
${pythonLocation}/bin/python -V -V
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:

jobs:
build:
name: Py${{ matrix.PYTHON_VERSION }}
name: Linux - Py${{ matrix.PYTHON_VERSION }}
runs-on: ubuntu-latest
env:
CI: 'true'
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
- '**.bat'
- '**.py'
- '**.sh'
- '!installers/**'
- '!.github/workflows/installer*.yml'

pull_request:
branches:
Expand All @@ -28,10 +30,12 @@ on:
- '**.bat'
- '**.py'
- '**.sh'
- '!installers/**'
- '!.github/workflows/installer*.yml'

jobs:
build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
name: Linux - Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
runs-on: ubuntu-latest
env:
CI: 'true'
Expand Down Expand Up @@ -124,7 +128,16 @@ jobs:
- name: Run tests
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
run: xvfb-run --auto-servernum python runtests.py || xvfb-run --auto-servernum python runtests.py || xvfb-run --auto-servernum python runtests.py || xvfb-run --auto-servernum python runtests.py || xvfb-run --auto-servernum python runtests.py
run: |
touch log.txt # This is necessary to run the script below
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh
- name: Coverage
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
- '**.bat'
- '**.py'
- '**.sh'
- '!installers/**'
- '!.github/workflows/installer*.yml'

pull_request:
branches:
Expand All @@ -28,10 +30,12 @@ on:
- '**.bat'
- '**.py'
- '**.sh'
- '!installers/**'
- '!.github/workflows/installer*.yml'

jobs:
build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
name: Mac - Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
runs-on: macos-10.15
env:
CI: 'true'
Expand All @@ -43,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
INSTALL_TYPE: ['pip']
INSTALL_TYPE: ['conda']
PYTHON_VERSION: ['3.9']
TEST_TYPE: ['fast', 'slow']
timeout-minutes: 120
Expand Down Expand Up @@ -109,7 +113,16 @@ jobs:
- name: Run tests
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
run: python runtests.py || python runtests.py || python runtests.py || python runtests.py || python runtests.py
run: |
touch log.txt # This is necessary to run the script below
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh || \
bash -l .github/scripts/run_tests.sh
# Enable this if SSH debugging is required
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
- '**.bat'
- '**.py'
- '**.sh'
- '!installers/**'
- '!.github/workflows/installer*.yml'

pull_request:
branches:
Expand All @@ -28,10 +30,12 @@ on:
- '**.bat'
- '**.py'
- '**.sh'
- '!installers/**'
- '!.github/workflows/installer*.yml'

jobs:
build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
name: Windows - Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
runs-on: windows-latest
env:
CI: 'true'
Expand Down
37 changes: 12 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,52 +38,39 @@ Finally, set the upstream remote to the official Spyder repo with:
$ git remote add upstream https://github.com/spyder-ide/spyder.git
```

### Creating a conda environment or virtualenv

If you use Anaconda you can create a conda environment with the following commands:
### Creating an environment and installing dependencies

```bash
$ conda create -n spyder-dev python=3
$ conda activate spyder-dev
```

You can also use `virtualenv` on Linux, but `conda` is **strongly** recommended:
If you use a Conda-based distribution (Anaconda, etc), you can create an environment and install the necessary dependencies as follows:

```bash
$ mkvirtualenv spyder-dev
$ workon spyder-dev
$ conda create -n spyder-dev -c conda-forge --file requirements/conda.txt
$ conda activate spyder-dev
```


### Installing dependencies

After you have created your development environment, you need to install Spyder's necessary dependencies. The easiest way to do so (with Anaconda) is
If you are running on macOS, you will also need to install `python.app`, so after activating the environment, run

```bash
$ conda install -c conda-forge --file requirements/conda.txt
$ conda install -c conda-forge python.app
```

This installs all Spyder's dependencies into the environment.
If you are running on macOS, you will also need to install `python.app`.
You can also use `virtualenv` on Linux, but `conda` is **strongly** recommended:

```bash
$ conda install python.app
$ mkvirtualenv spyder-dev
$ workon spyder-dev
(spyder-dev) $ pip install -e .
```

If using `pip` and `virtualenv` (not recommended), you need to `cd` to the directory where your git clone is stored and run:

```bash
$ pip install -e .
```

### Running Spyder

To start Spyder directly from your clone, i.e. without installing it into your environment, you need to run (from the directory you cloned it to e.g. `spyder`):
To run Spyder from your clone in its development mode, with extra checks and options (pass `--help` to see them), launch it via the `bootstrap.py` script in the repo root directory:

```bash
$ python bootstrap.py
```
Note that if you are running on macOS, you will need to call `pythonw` instead of `python`.
Note that if you are running on macOS 10.15 or earlier, you will need to call `pythonw` instead of `python`.

To start Spyder in debug mode, useful for tracking down an issue, you can run:

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ include changelogs/Spyder-5.md
include AUTHORS.txt
include NOTICE.txt
include bootstrap.py
include pylsp_utils.py
include install_dev_repos.py
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ To release a new version of Spyder you need to follow these steps:

* Update the version of any packages required before the release in the following files:

- `setup.py` (look up for the Windows installer patch too)
- `setup.py` (look up for the `install_requires` variable and also for the `Loosen constraints to ensure dev versions still work` patch )
- `spyder/dependencies.py`
- `requirements/conda.txt`
- `binder/environment.yml`
- *`spyder/plugins/ipythonconsole/widgets/main_widget.py` (look up for the constants `SPYDER_KERNELS_MIN_VERSION` and `SPYDER_KERNELS_MAX_VERSION`)
- `spyder/plugins/ipythonconsole/widgets/main_widget.py` (look up for the constants `SPYDER_KERNELS_MIN_VERSION` and `SPYDER_KERNELS_MAX_VERSION`)

**Note**: Usually, the version of `spyder-kernels` for validation in the IPython Console only needs to be updated for minor or major releases of that package. For bugfix releases the value should remain the same to not hassle users using custom interpreters into updating `spyder-kernels` in their environments. However, this depends on the type of bugs resolved and if it's worthy to reinforce the need of an update even for those versions.

Expand Down
2 changes: 1 addition & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:
- pickleshare >=0.4
- psutil >=5.3
- pygments >=2.0
- pylint >=2.5.0
- pylint >=2.5.0,<3.0
- pyls-spyder >=0.4.0
- pyqt <5.16
- pyqtwebengine <5.16
Expand Down
Loading

0 comments on commit a7090ae

Please sign in to comment.