Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into add_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Peter committed Apr 5, 2023
2 parents 3a15f25 + 401ee99 commit b74b6c2
Show file tree
Hide file tree
Showing 16 changed files with 252 additions and 77 deletions.
16 changes: 0 additions & 16 deletions .github/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ if [ "$USE_CONDA" = "true" ]; then
# Remove pylsp before installing its subrepo below
micromamba remove --force python-lsp-server python-lsp-server-base -y

# To test with Jupyter-client 8
micromamba install --no-deps jupyter_client=8.1

# To test with pydocstyle 6.3.0
micromamba install pydocstyle=6.3.0

# To test with the latest autopep8
micromamba install autopep8=2
else
# Update pip and setuptools
python -m pip install -U pip setuptools wheel build
Expand All @@ -56,14 +48,6 @@ else
pip install pyqt5==5.12.* pyqtwebengine==5.12.*
fi

# To test with Jupyter-client 8
pip install jupyter-client==8.1

# To test with pydocstyle 6.3.0
pip install pydocstyle==6.3.0

# To test with the latest autopep8
pip install autopep8==2.0.2
fi

# Install subrepos from source
Expand Down
36 changes: 22 additions & 14 deletions Announcements.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
# Minor release to list

**Subject**: [ANN] Spyder 5.4.2 is released!
**Subject**: [ANN] Spyder 5.4.3 is released!


Hi all,

On the behalf of the [Spyder Project Contributors](https://github.com/spyder-ide/spyder/graphs/contributors),
I'm pleased to announce that Spyder **5.4.2** has been released and is available for
I'm pleased to announce that Spyder **5.4.3** has been released and is available for
Windows, GNU/Linux and MacOS X: https://github.com/spyder-ide/spyder/releases

This release comes two weeks and six days after version 5.4.1 and it contains the
This release comes ten weeks and six days after version 5.4.2 and it contains the
following new features and important fixes:

* Improvements to the experimental conda-based Linux installer (shortcut icon, improvements to execute the installer script)
* Fix issues detected with PyZMQ 25
* Fix dot completions and improve support for files and directories completions
* Fix getting current user enviroment variables
* Fix cursor position restauration after autoformat when saving files
* Fix error when reverting unexisting files
* Improvements to the workflows to build conda-based installers
* Fix some issues related with Python 3.11 compatibility

In this release we fixed 12 issues and merged 16 pull requests that amount
to more than 67 commits. For a full list of fixes, please see our
* Add support for QDarkstyle 3.1
* Add support for Jupyter-client 8
* Add mambaforge and miniforge when searching for conda environments
* Fix IPython Console completions, traceback handling and other issues to better support IPython 8.x
* Fix compatibility issues with PyZMQ 25.x
* Add warning message before loading .spydata files
* Fix web based widgets display by adding the `--no-sandbox` argument for `QtApplication`
* Fix copy and paste shortcuts for the Files and Projects explorer panes
* Fix Windows standalone installer restart mechanism
* Fix keyring backends for the Mac standalone installer
* Fix Editor issues related with handling LSP server failed starts
* Fix Editor issues related with restoring previous session and file changes outside Spyder
* Fix PYTHONPATH manager showing extra paths and other related errors
* Fix update available notification with pip based installations
* Fix some UX/UI issues for the find replace widget when the Editor has a small width
* Removal of Python 2 related code

In this release we fixed 29 issues and merged 47 pull requests that amount
to more than 173 commits. For a full list of fixes, please see our
[Changelog](https://github.com/spyder-ide/spyder/blob/5.x/CHANGELOG.md).

Don't forget to follow Spyder updates/news on the project's
Expand Down
8 changes: 4 additions & 4 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ dependencies:
- pyqt <5.16
- pyqtwebengine <5.16
- python-lsp-black >=1.2.0
- python-lsp-server >=1.7.1,<1.8.0
- python-lsp-server >=1.7.2,<1.8.0
- pyxdg >=0.26
- pyzmq >=22.1.0
- qdarkstyle >=3.0.2,<3.1.0
- qdarkstyle >=3.0.2,<3.2.0
- qstylizer >=0.2.2
- qtawesome >=1.2.1
- qtconsole >=5.4.0,<5.5.0
- qtconsole >=5.4.2,<5.5.0
- qtpy >=2.1.0
- rtree >=0.9.7
- setuptools >=49.6.0
- sphinx >=0.6.6
- spyder-kernels >=2.4.2,<2.5.0
- spyder-kernels >=2.4.3,<2.5.0
- textdistance >=4.2.0
- three-merge >=0.1.1
- watchdog >=0.10.3
Expand Down
114 changes: 114 additions & 0 deletions changelogs/Spyder-5.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions external-deps/python-lsp-server/.gitrepo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions external-deps/python-lsp-server/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion external-deps/qtconsole/.gitrepo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions external-deps/qtconsole/docs/source/changelog.rst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions external-deps/spyder-kernels/.gitrepo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions external-deps/spyder-kernels/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions requirements/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ dependencies:
- pyqt <5.16
- pyqtwebengine <5.16
- python-lsp-black >=1.2.0
- python-lsp-server >=1.7.1,<1.8.0
- python-lsp-server >=1.7.2,<1.8.0
- pyzmq >=22.1.0
- qdarkstyle >=3.0.2,<3.1.0
- qdarkstyle >=3.0.2,<3.2.0
- qstylizer >=0.2.2
- qtawesome >=1.2.1
- qtconsole >=5.4.0,<5.5.0
- qtconsole >=5.4.2,<5.5.0
- qtpy >=2.1.0
- rtree >=0.9.7
- setuptools >=49.6.0
- sphinx >=0.6.6
- spyder-kernels >=2.4.2,<2.5.0
- spyder-kernels >=2.4.3,<2.5.0
- textdistance >=4.2.0
- three-merge >=0.1.1
- watchdog >=0.10.3
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,18 @@ def run(self):
'pyls-spyder>=0.4.0',
'pyqt5<5.16',
'pyqtwebengine<5.16',
'python-lsp-server[all]>=1.7.1,<1.8.0',
'python-lsp-server[all]>=1.7.2,<1.8.0',
'pyxdg>=0.26;platform_system=="Linux"',
'pyzmq>=22.1.0',
'qdarkstyle>=3.0.2,<3.1.0',
'qdarkstyle>=3.0.2,<3.2.0',
'qstylizer>=0.2.2',
'qtawesome>=1.2.1',
'qtconsole>=5.4.0,<5.5.0',
'qtconsole>=5.4.2,<5.5.0',
'qtpy>=2.1.0',
'rtree>=0.9.7',
'setuptools>=49.6.0',
'sphinx>=0.6.6',
'spyder-kernels>=2.4.2,<2.5.0',
'spyder-kernels>=2.4.3,<2.5.0',
'textdistance>=4.2.0',
'three-merge>=0.1.1',
'watchdog>=0.10.3'
Expand All @@ -251,9 +251,9 @@ def run(self):
reqs_to_loosen = {'python-lsp-server[all]', 'qtconsole', 'spyder-kernels'}
install_requires = [req for req in install_requires
if req.split(">")[0] not in reqs_to_loosen]
install_requires.append('python-lsp-server[all]>=1.7.1,<1.9.0')
install_requires.append('qtconsole>=5.4.0,<5.6.0')
install_requires.append('spyder-kernels>=2.4.2,<3.1.0')
install_requires.append('python-lsp-server[all]>=1.7.2,<1.9.0')
install_requires.append('qtconsole>=5.4.2,<5.6.0')
install_requires.append('spyder-kernels>=2.4.3,<3.1.0')

extras_require = {
'test:platform_system == "Windows"': ['pywin32'],
Expand Down
8 changes: 4 additions & 4 deletions spyder/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@
PYGMENTS_REQVER = '>=2.0'
PYLINT_REQVER = '>=2.5.0,<3.0'
PYLINT_VENV_REQVER = '>=2.1.1'
PYLSP_REQVER = '>=1.7.1,<1.8.0'
PYLSP_REQVER = '>=1.7.2,<1.8.0'
PYLSP_BLACK_REQVER = '>=1.2.0'
PYLS_SPYDER_REQVER = '>=0.4.0'
PYXDG_REQVER = '>=0.26'
PYZMQ_REQVER = '>=22.1.0'
QDARKSTYLE_REQVER = '>=3.0.2,<3.1.0'
QDARKSTYLE_REQVER = '>=3.0.2,<3.2.0'
QSTYLIZER_REQVER = '>=0.2.2'
QTAWESOME_REQVER = '>=1.2.1'
QTCONSOLE_REQVER = '>=5.4.0,<5.5.0'
QTCONSOLE_REQVER = '>=5.4.2,<5.5.0'
QTPY_REQVER = '>=2.1.0'
RTREE_REQVER = '>=0.9.7'
SETUPTOOLS_REQVER = '>=49.6.0'
SPHINX_REQVER = '>=0.6.6'
SPYDER_KERNELS_REQVER = '>=2.4.2,<2.5.0'
SPYDER_KERNELS_REQVER = '>=2.4.3,<2.5.0'
TEXTDISTANCE_REQVER = '>=4.2.0'
THREE_MERGE_REQVER = '>=0.1.1'
# None for pynsist install for now
Expand Down
20 changes: 13 additions & 7 deletions spyder/plugins/variableexplorer/widgets/dataframeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@
from time import perf_counter

# Third party imports
from packaging.version import parse
from qtpy.compat import from_qvariant, to_qvariant
from qtpy.QtCore import (QAbstractTableModel, QModelIndex, Qt, Signal, Slot,
QItemSelectionModel, QEvent)
from qtpy.QtCore import (
QAbstractTableModel, QEvent, QItemSelectionModel, QModelIndex, Qt, Signal,
Slot)
from qtpy.QtGui import QColor, QCursor
from qtpy.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout,
QInputDialog, QLineEdit, QMenu, QMessageBox,
QPushButton, QTableView, QScrollBar, QTableWidget,
QFrame, QItemDelegate)
from qtpy.QtWidgets import (
QApplication, QCheckBox, QGridLayout, QHBoxLayout, QInputDialog, QLineEdit,
QMenu, QMessageBox, QPushButton, QTableView, QScrollBar, QTableWidget,
QFrame, QItemDelegate)
from spyder_kernels.utils.lazymodules import numpy as np, pandas as pd

# Local imports
Expand Down Expand Up @@ -1384,7 +1386,11 @@ def test_edit(data, title="", parent=None):
def test():
"""DataFrame editor test"""
from numpy import nan
from pandas.util.testing import assert_frame_equal, assert_series_equal

if parse(pd.__version__) >= parse('2.0.0'):
from pandas.testing import assert_frame_equal, assert_series_equal
else:
from pandas.util.testing import assert_frame_equal, assert_series_equal

app = qapplication() # analysis:ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
from unittest.mock import Mock, ANY

# Third party imports
from pandas import (DataFrame, date_range, read_csv, concat, Index, RangeIndex,
MultiIndex, CategoricalIndex, Series)
from qtpy.QtGui import QColor
from qtpy.QtCore import Qt, QTimer
from flaky import flaky
import numpy
from packaging.version import parse
from pandas import (
__version__ as pandas_version, DataFrame, date_range, read_csv, concat,
Index, RangeIndex, MultiIndex, CategoricalIndex, Series)
import pytest
from flaky import flaky
from qtpy.QtGui import QColor
from qtpy.QtCore import Qt, QTimer

# Local imports
from spyder.utils.programs import is_module_installed
Expand Down Expand Up @@ -62,17 +64,27 @@ def data_index(dfi, i, j, role=Qt.DisplayRole):
return dfi.data(dfi.createIndex(i, j), role)

def generate_pandas_indexes():
""" Creates a dictionary of many possible pandas indexes """
return {
'Index': Index(list('ABCDEFGHIJKLMNOPQRST')),
"""Creates a dictionary of many possible pandas indexes."""
# Float64Index was removed in Pandas 2.0
if parse(pandas_version) >= parse('2.0.0'):
float_index = 'Index'
else:
float_index = 'Float64Index'

indexes = {
'RangeIndex': RangeIndex(0, 20),
'Float64Index': Index([i/10 for i in range(20)]),
float_index: Index([i/10 for i in range(20)]),
'DatetimeIndex': date_range(start='2017-01-01', periods=20, freq='D'),
'MultiIndex': MultiIndex.from_product(
[list('ABCDEFGHIJ'), ('foo', 'bar')], names=['first', 'second']),
'CategoricalIndex': CategoricalIndex(list('abcaadaccbbacabacccb'),
categories=['a', 'b', 'c']),
}
}

if parse(pandas_version) < parse('2.0.0'):
indexes['Index'] = Index(list('ABCDEFGHIJKLMNOPQRST'))

return indexes


# =============================================================================
Expand Down Expand Up @@ -394,7 +406,7 @@ def test_dataframeeditor_with_various_indexes():
assert header.headerData(0, Qt.Horizontal,
Qt.DisplayRole) == "0"

if rng_name == "Index":
if rng_name == "Index" and parse(pandas_version) < parse('2.0.0'):
assert data(dfm, 0, 0) == 'A'
assert data(dfm, 1, 0) == 'B'
assert data(dfm, 2, 0) == 'C'
Expand All @@ -404,7 +416,7 @@ def test_dataframeeditor_with_various_indexes():
assert data(dfm, 1, 0) == '1'
assert data(dfm, 2, 0) == '2'
assert data(dfm, 19, 0) == '19'
elif rng_name == "Float64Index":
elif rng_name in ["Float64Index", "Index"]:
assert data(dfm, 0, 0) == '0'
assert data(dfm, 1, 0) == '0.1'
assert data(dfm, 2, 0) == '0.2'
Expand Down
Loading

0 comments on commit b74b6c2

Please sign in to comment.