From 324cf7eab940e8681bcf4deb250772fc35ae192e Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Tue, 10 Oct 2023 10:25:35 -0500 Subject: [PATCH] Drop support for Python 3.7 --- .github/workflows/test-files.yml | 2 +- .github/workflows/test-linux.yml | 4 ++++ README.md | 4 ++-- binder/environment.yml | 2 +- requirements/main.yml | 2 +- setup.py | 13 ++++++++----- spyder/app/tests/conftest.py | 3 --- spyder/app/tests/spyder-boilerplate/setup.py | 3 +-- spyder/app/tests/test_mainwindow.py | 4 +--- spyder/dependencies.py | 8 ++++++-- spyder/tests/test_dependencies_in_sync.py | 4 +++- 11 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test-files.yml b/.github/workflows/test-files.yml index f6df310041d..c62115945be 100644 --- a/.github/workflows/test-files.yml +++ b/.github/workflows/test-files.yml @@ -51,7 +51,7 @@ jobs: strategy: fail-fast: false matrix: - PYTHON_VERSION: ['3.8', '3.10'] + PYTHON_VERSION: ['3.9', '3.10'] timeout-minutes: 30 steps: - name: Checkout Pull Requests diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index ee1273d6fa5..81b060d9491 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -58,6 +58,10 @@ jobs: INSTALL_TYPE: ['pip', 'conda'] PYTHON_VERSION: ['3.8', '3.10'] TEST_TYPE: ['fast', 'slow'] + exclude: + # Only test Python 3.8 with pip because Conda-forge will drop it soon + - INSTALL_TYPE: 'conda' + PYTHON_VERSION: '3.8' timeout-minutes: 90 steps: - name: Checkout Pull Requests diff --git a/README.md b/README.md index 8e9e89e66f5..5d51f73dd80 100644 --- a/README.md +++ b/README.md @@ -200,13 +200,13 @@ to install them separately in those cases. ### Build dependencies When installing Spyder from its source package, the only requirement is to have -a Python version equal or greater than 3.7. +a Python version equal or greater than 3.8. ### Runtime dependencies The basic dependencies to run Spyder are: -* **Python** 3.7+: The core language Spyder is written in and for. +* **Python** 3.8+: The core language Spyder is written in and for. * **PyQt5** 5.9+: Python bindings for Qt, used for Spyder's GUI. The rest our dependencies (both required and optional) are declared in diff --git a/binder/environment.yml b/binder/environment.yml index 9259ae23141..a1f7a0589d9 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -13,7 +13,7 @@ dependencies: - cookiecutter >=1.6.0 - diff-match-patch >=20181111 - intervaltree >=3.0.2 -- ipython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0,!=8.11.0,!=8.12.0,!=8.12.1 +- ipython >=8.13.0,<9.0.0 - jedi >=0.17.2,<0.20.0 - jellyfish >=0.7 - jsonschema >=3.2.0 diff --git a/requirements/main.yml b/requirements/main.yml index 9966d16e151..19474df0f00 100644 --- a/requirements/main.yml +++ b/requirements/main.yml @@ -11,7 +11,7 @@ dependencies: - cookiecutter >=1.6.0 - diff-match-patch >=20181111 - intervaltree >=3.0.2 - - ipython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0,!=8.11.0,!=8.12.0,!=8.12.1 + - ipython >=8.13.0,<9.0.0 - jedi >=0.17.2,<0.20.0 - jellyfish >=0.7 - jsonschema >=3.2.0 diff --git a/setup.py b/setup.py index 4e8cc34564a..37a8020a563 100644 --- a/setup.py +++ b/setup.py @@ -39,8 +39,8 @@ # Taken from the notebook setup.py -- Modified BSD License # ============================================================================= v = sys.version_info -if v[0] >= 3 and v[:2] < (3, 7): - error = "ERROR: Spyder requires Python version 3.7 and above." +if v[0] >= 3 and v[:2] < (3, 8): + error = "ERROR: Spyder requires Python version 3.8 and above." print(error, file=sys.stderr) sys.exit(1) @@ -180,16 +180,18 @@ def run(self): package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST)}, scripts=[osp.join('scripts', fname) for fname in SCRIPTS], data_files=get_data_files(), - python_requires='>=3.7', + python_requires='>=3.8', classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: MacOS', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', @@ -209,7 +211,8 @@ def run(self): 'cookiecutter>=1.6.0', 'diff-match-patch>=20181111', 'intervaltree>=3.0.2', - 'ipython>=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0,!=8.11.0,!=8.12.0,!=8.12.1', + 'ipython>=8.12.2,<8.13.0; python_version=="3.8"', + 'ipython>=8.13.0,<9.0.0; python_version>"3.8"', 'jedi>=0.17.2,<0.20.0', 'jellyfish>=0.7', 'jsonschema>=3.2.0', diff --git a/spyder/app/tests/conftest.py b/spyder/app/tests/conftest.py index b048766148a..db9c48e5e8d 100755 --- a/spyder/app/tests/conftest.py +++ b/spyder/app/tests/conftest.py @@ -54,9 +54,6 @@ # Time to wait for the completion services to be up or give a response COMPLETION_TIMEOUT = 30000 -# Python 3.7 -PY37 = sys.version_info[:2] == (3, 7) - # ============================================================================= # ---- Auxiliary functions diff --git a/spyder/app/tests/spyder-boilerplate/setup.py b/spyder/app/tests/spyder-boilerplate/setup.py index 58adb5fdeb2..8e420f28359 100644 --- a/spyder/app/tests/spyder-boilerplate/setup.py +++ b/spyder/app/tests/spyder-boilerplate/setup.py @@ -19,7 +19,7 @@ author_email="spyder.python@gmail.com", description="Plugin that registers a programmatic custom layout", license="MIT license", - python_requires='>= 3.7', + python_requires='>= 3.8', install_requires=[ "qtpy", "qtawesome", @@ -36,7 +36,6 @@ "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Development Status :: 5 - Production/Stable", diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py index d079e55ad85..11e4e6da6e3 100644 --- a/spyder/app/tests/test_mainwindow.py +++ b/spyder/app/tests/test_mainwindow.py @@ -48,7 +48,7 @@ from spyder.app.tests.conftest import ( COMPILE_AND_EVAL_TIMEOUT, COMPLETION_TIMEOUT, EVAL_TIMEOUT, find_desired_tab_in_window, LOCATION, open_file_in_editor, - preferences_dialog_helper, PY37, read_asset_file, reset_run_code, + preferences_dialog_helper, read_asset_file, reset_run_code, SHELL_TIMEOUT, start_new_kernel) from spyder.config.base import ( get_home_dir, get_conf_path, get_module_path, running_in_ci) @@ -2727,7 +2727,6 @@ def test_preferences_checkboxes_not_checked_regression(main_window, qtbot): False) -@pytest.mark.skipif(PY37, reason="Segfaults too much on Python 3.7") def test_preferences_change_font_regression(main_window, qtbot): """ Test for spyder-ide/spyder/#10284 regression. @@ -3295,7 +3294,6 @@ def test_runcell_pdb(main_window, qtbot): @flaky(max_runs=3) @pytest.mark.parametrize("debug", [False, True]) -@pytest.mark.skipif(PY37, reason="Segfaults too much on Python 3.7") def test_runcell_cache(main_window, qtbot, debug): """Test the runcell command cache.""" # Write code with a cell to a file diff --git a/spyder/dependencies.py b/spyder/dependencies.py index 0689efb32ae..d734fb9d178 100644 --- a/spyder/dependencies.py +++ b/spyder/dependencies.py @@ -15,8 +15,13 @@ from spyder.config.base import _, is_pynsist, running_in_ci, running_in_mac_app from spyder.utils import programs + HERE = osp.dirname(osp.abspath(__file__)) +# Python 3.8 +PY38 = sys.version_info[:2] == (3, 8) + + # ============================================================================= # Kind of dependency # ============================================================================= @@ -38,8 +43,7 @@ # None for pynsist install for now # (check way to add dist.info/egg.info from packages without wheels available) INTERVALTREE_REQVER = None if is_pynsist() else '>=3.0.2' -IPYTHON_REQVER = ( - ">=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0,!=8.11.0,!=8.12.0,!=8.12.1") +IPYTHON_REQVER = ">=8.12.2,<8.13.0" if PY38 else ">=8.13.0,<9.0.0" JEDI_REQVER = '>=0.17.2,<0.20.0' JELLYFISH_REQVER = '>=0.7' JSONSCHEMA_REQVER = '>=3.2.0' diff --git a/spyder/tests/test_dependencies_in_sync.py b/spyder/tests/test_dependencies_in_sync.py index b29f8c028d4..8a1c604374d 100644 --- a/spyder/tests/test_dependencies_in_sync.py +++ b/spyder/tests/test_dependencies_in_sync.py @@ -9,10 +9,11 @@ import os.path as osp # Third party imports +import pytest import yaml # Local imports -from spyder.dependencies import DESCRIPTIONS, OPTIONAL +from spyder.dependencies import DESCRIPTIONS, OPTIONAL, PY38 # Constants HERE = osp.abspath(osp.dirname(__file__)) @@ -187,6 +188,7 @@ def test_dependencies_for_binder_in_sync(): assert spyder_env == full_reqs +@pytest.mark.skipif(PY38, reason="Fails in Python 3.8") def test_dependencies_for_spyder_dialog_in_sync(): """ Spyder dependencies dialog should share deps with main.yml.