openSUSE Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2020
- 2 participants
- 2810 discussions
[opensuse-commit] commit flashrom for openSUSE:Factory
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package flashrom for openSUSE:Factory checked in at 2020-11-29 12:30:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/flashrom (Old)
and /work/SRC/openSUSE:Factory/.flashrom.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "flashrom"
Sun Nov 29 12:30:21 2020 rev:24 rq:851347 version:1.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/flashrom/flashrom.changes 2020-02-21 16:42:30.598051264 +0100
+++ /work/SRC/openSUSE:Factory/.flashrom.new.5913/flashrom.changes 2020-11-29 12:30:29.666127565 +0100
@@ -1,0 +2,6 @@
+Fri Nov 27 08:18:53 UTC 2020 - Guillaume GARDET <guillaume.gardet(a)opensuse.org>
+
+- Fix build on aarch64 with upstream patch:
+ * fix_aarch64.patch
+
+-------------------------------------------------------------------
New:
----
fix_aarch64.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ flashrom.spec ++++++
--- /var/tmp/diff_new_pack.0pZYLH/_old 2020-11-29 12:30:30.206128111 +0100
+++ /var/tmp/diff_new_pack.0pZYLH/_new 2020-11-29 12:30:30.206128111 +0100
@@ -27,6 +27,8 @@
Source1: https://download.flashrom.org/releases/%{name}-v%{version}.tar.bz2.asc#/%{n…
# Got the key from David Hendricks
Source2: %{name}.keyring
+# PATCH-FIX-UPSTREAM - https://github.com/flashrom/flashrom/commit/da6b3b70cb852dd8e9f9e21aef95fa8…
+Patch1: fix_aarch64.patch
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libftdi1)
BuildRequires: pkgconfig(libpci)
@@ -48,6 +50,7 @@
%prep
%setup -q -n %{name}-v%{version}
+%patch1 -p1
%build
make %{?_smp_mflags} \
++++++ fix_aarch64.patch ++++++
From da6b3b70cb852dd8e9f9e21aef95fa83e7f7ab0d Mon Sep 17 00:00:00 2001
From: Pyry Kontio <pyry.kontio(a)drasa.eu>
Date: Mon, 6 Jul 2020 12:57:35 +0900
Subject: [PATCH] Makefile: Fix building on AArch64 NixOS
The parsing of the output of archtest.c produced an unexpected
value on AArch64 NixOS. For example, the make variable ARCH was set to:
```
bit outside of fd_set selected
arm
```
This made the arch and OS checks fail.
This commit simplifies the parsing, making it more robust.
The C files archtest.c, endiantest.c and os.h used to set the
TARGET_OS, ARCH and ENDIAN variables, respectively, output
the result of the test as the final line, so just extracting
the final line and removing double quoting is enough.
This commit also fixes a bug with debug_shell lacking escaping
single quotes, which prevented using the single quote in the
debug_shell calls. It used to work by accident before this fix;
the line in the call happened to contain a balanced pair of double
quotes and lacked other characters that needed escaping, which
didn't break the debug_shell, but this was accidental and very
brittle.
Signed-off-by: Pyry Kontio <pyry.kontio(a)drasa.eu>
Change-Id: Iaa4477a71e758cf9ecad2c22f3b77bc6508a3510
Reviewed-on: https://review.coreboot.org/c/flashrom/+/43140
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Angel Pons <th3fanbus(a)gmail.com>
---
Makefile | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index f3f7717e2..e475cbdbd 100644
--- a/Makefile
+++ b/Makefile
@@ -83,7 +83,8 @@ dummy_for_make_3_80:=$(shell printf "Build started on %s\n\n" "$$(date)" >$(BUIL
# Provide an easy way to execute a command, print its output to stdout and capture any error message on stderr
# in the build details file together with the original stdout output.
-debug_shell = $(shell export LC_ALL=C ; { echo 'exec: export LC_ALL=C ; { $(1) ; }' >&2; { $(1) ; } | tee -a $(BUILD_DETAILS_FILE) ; echo >&2 ; } 2>>$(BUILD_DETAILS_FILE))
+debug_shell = $(shell export LC_ALL=C ; { echo 'exec: export LC_ALL=C ; { $(subst ','\'',$(1)) ; }' >&2; \
+ { $(1) ; } | tee -a $(BUILD_DETAILS_FILE) ; echo >&2 ; } 2>>$(BUILD_DETAILS_FILE))
###############################################################################
# General OS-specific settings.
@@ -106,7 +107,8 @@ endif
# IMPORTANT: The following line must be placed before TARGET_OS is ever used
# (of course), but should come after any lines setting CC because the line
# below uses CC itself.
-override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
+override TARGET_OS := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E os.h 2>/dev/null \
+ | tail -1 | cut -f 2 -d'"'))
ifeq ($(TARGET_OS), Darwin)
override CPPFLAGS += -I/opt/local/include -I/usr/local/include
@@ -490,8 +492,10 @@ endif
# IMPORTANT: The following line must be placed before ARCH is ever used
# (of course), but should come after any lines setting CC because the line
# below uses CC itself.
-override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null | grep -v '^\#' | grep '"' | cut -f 2 -d'"'))
-override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null | grep -v '^\#'))
+override ARCH := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E archtest.c 2>/dev/null \
+ | tail -1 | cut -f 2 -d'"'))
+override ENDIAN := $(strip $(call debug_shell,$(CC) $(CPPFLAGS) -E endiantest.c 2>/dev/null \
+ | tail -1))
# Disable the internal programmer on unsupported architectures (everything but x86 and mipsel)
ifneq ($(ARCH)-little, $(filter $(ARCH),x86 mips)-$(ENDIAN))
@@ -1299,12 +1303,12 @@ compiler: featuresavailable
@printf "Target arch is "
@# FreeBSD wc will output extraneous whitespace.
@echo $(ARCH)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
- ( echo "unknown. Aborting."; exit 1)
+ ( echo "unknown (\"$(ARCH)\"). Aborting."; exit 1)
@printf "%s\n" '$(ARCH)'
@printf "Target OS is "
@# FreeBSD wc will output extraneous whitespace.
@echo $(TARGET_OS)|wc -w|grep -q '^[[:blank:]]*1[[:blank:]]*$$' || \
- ( echo "unknown. Aborting."; exit 1)
+ ( echo "unknown (\"$(TARGET_OS)\"). Aborting."; exit 1)
@printf "%s\n" '$(TARGET_OS)'
ifeq ($(TARGET_OS), libpayload)
@$(CC) --version 2>&1 | grep -q coreboot || \
1
0
[opensuse-commit] commit wireshark for openSUSE:Leap:15.1:Update
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package wireshark for openSUSE:Leap:15.1:Update checked in at 2020-11-29 12:30:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.1:Update/wireshark (Old)
and /work/SRC/openSUSE:Leap:15.1:Update/.wireshark.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "wireshark"
Sun Nov 29 12:30:24 2020 rev:6 rq:851007 version:unknown
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.MP9BjI/_old 2020-11-29 12:30:30.910128823 +0100
+++ /var/tmp/diff_new_pack.MP9BjI/_new 2020-11-29 12:30:30.910128823 +0100
@@ -1 +1 @@
-<link package='wireshark.14904' cicount='copy' />
+<link package='wireshark.15072' cicount='copy' />
1
0
[opensuse-commit] commit python-h5py for openSUSE:Factory
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package python-h5py for openSUSE:Factory checked in at 2020-11-29 12:30:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-h5py (Old)
and /work/SRC/openSUSE:Factory/.python-h5py.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-h5py"
Sun Nov 29 12:30:19 2020 rev:16 rq:851345 version:3.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-h5py/python-h5py.changes 2020-05-11 13:45:01.693587316 +0200
+++ /work/SRC/openSUSE:Factory/.python-h5py.new.5913/python-h5py.changes 2020-11-29 12:30:28.802126691 +0100
@@ -1,0 +2,23 @@
+Thu Nov 26 14:55:53 UTC 2020 - Atri Bhattacharya <badshah400(a)gmail.com>
+
+- Update to version 3.1.0:
+ * See https://docs.h5py.org/en/latest/whatsnew/3.1.html for list
+ of changes.
+- Changes from version 3.0.0: See
+ https://docs.h5py.org/en/latest/whatsnew/3.0.html
+- Drop upstreamed patches:
+ * remove_unittest2.patch.
+ * no_include_opt.patch.
+- Add python-h5py-relax-dependency-versions.patch to allow building
+ against more recent versions of numpy than minimally required.
+- Python 2 is no longer supported; at least version 3.6 is
+ required.
+- Run all tests except:
+ * MPI based ones, as we build against the non-mpi version of
+ hdf5.
+ * Offset test which overflows on 32-bit.
+- Tests require python-cached-property for openSUSE <= 1500.
+- Fix `requires_eq` on libhdf5 (oS:F now has libhdf_hl103)
+ already.
+
+-------------------------------------------------------------------
Old:
----
h5py-2.10.0.tar.gz
no_include_opt.patch
remove_unittest2.patch
New:
----
h5py-3.1.0.tar.gz
python-h5py-relax-dependency-versions.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-h5py.spec ++++++
--- /var/tmp/diff_new_pack.oYR20j/_old 2020-11-29 12:30:29.310127205 +0100
+++ /var/tmp/diff_new_pack.oYR20j/_new 2020-11-29 12:30:29.314127209 +0100
@@ -17,21 +17,20 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define skip_python2 1
Name: python-h5py
-Version: 2.10.0
+Version: 3.1.0
Release: 0
Summary: Python interface to the Hierarchical Data Format library
License: BSD-3-Clause
Group: Development/Libraries/Python
URL: https://github.com/h5py/h5py
Source: https://files.pythonhosted.org/packages/source/h/h5py/h5py-%{version}.tar.gz
-#PATCH-FIX-OPENSUSE no_include_opt.patch -- Don't include /opt/ directory.
-Patch0: no_include_opt.patch
-#PATCH-FIX-OPENSUSE remove_unittest2.patch mcepl(a)suse.cz -- remove dependency unittest2
-Patch1: remove_unittest2.patch
+# PATCH-FEATURE-OPENSUSE python-h5py-relax-dependency-versions.patch badshah400(a)gmail.com -- Build against newer version of numpy
+Patch0: python-h5py-relax-dependency-versions.patch
BuildRequires: %{python_module Cython >= 0.23}
BuildRequires: %{python_module devel}
-BuildRequires: %{python_module numpy-devel >= 1.7}
+BuildRequires: %{python_module numpy-devel >= 1.12}
BuildRequires: %{python_module pkgconfig}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
@@ -40,9 +39,12 @@
BuildRequires: hdf5-devel
BuildRequires: python-rpm-macros
Requires: hdf5
-Requires: python-numpy >= 1.7
+Requires: python-numpy >= 1.12
Requires: python-six
-%requires_eq libhdf5_hl100
+%requires_eq libhdf5
+%if 0%{?suse_version} <= 1500
+BuildRequires: %{python_module cached-property}
+%endif
%python_subpackages
%description
@@ -53,8 +55,7 @@
metaphor, indexed by name.
%prep
-%setup -q -n h5py-%{version}
-%autopatch -p1
+%autosetup -p1 -n h5py-%{version}
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
@@ -65,14 +66,16 @@
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
-export PYTHONDONTWRITEBYTECODE=1
-# test_float_round_tripping -- overflows on 32bit
-# py3 only code must be skipped
-%pytest_arch %{buildroot}%{$python_sitearch}/h5py/tests/ -k 'not (test_highlevel_access or test_deprecation_available_ftypes or test_read_uncompressed_offsets or test_read_write_chunk or test_float_round_tripping)'
+# Offset test fails on 32-bit and we don't build against mpi-hdf5
+%ifarch %{ix86}
+%pytest_arch %{buildroot}%{$python_sitearch}/h5py/tests/ -k 'not (TestMPI or test_float_round_tripping)'
+%else
+%pytest_arch %{buildroot}%{$python_sitearch}/h5py/tests/ -k 'not TestMPI'
+%endif
%files %{python_files}
%license lzf/LICENSE.txt
-%doc ANN.rst README.rst lzf/README.txt examples licenses/*
+%doc README.rst lzf/README.txt examples licenses/*
%{python_sitearch}/h5py/
%{python_sitearch}/h5py-%{version}-py*.egg-info
++++++ h5py-2.10.0.tar.gz -> h5py-3.1.0.tar.gz ++++++
++++ 18977 lines of diff (skipped)
++++++ python-h5py-relax-dependency-versions.patch ++++++
Index: h5py-3.1.0/setup.py
===================================================================
--- h5py-3.1.0.orig/setup.py
+++ h5py-3.1.0/setup.py
@@ -49,14 +49,14 @@ SETUP_REQUIRES = [
f"Cython >=0.29; python_version<'3.8'",
f"Cython >=0.29.14; python_version>='3.8'",
] + [
- f"numpy =={np_min}; python_version{py_condition}"
+ f"numpy >={np_min}; python_version{py_condition}"
for np_min, py_condition in NUMPY_MIN_VERSIONS
]
if setup_configure.mpi_enabled():
RUN_REQUIRES.append('mpi4py >=3.0.0')
- SETUP_REQUIRES.append("mpi4py ==3.0.0; python_version<'3.8'")
- SETUP_REQUIRES.append("mpi4py ==3.0.3; python_version>='3.8'")
+ SETUP_REQUIRES.append("mpi4py >=3.0.0; python_version<'3.8'")
+ SETUP_REQUIRES.append("mpi4py >=3.0.3; python_version>='3.8'")
# Set the environment variable H5PY_SETUP_REQUIRES=0 if we need to skip
# setup_requires for any reason.
1
0
[opensuse-commit] commit python-thewalrus for openSUSE:Factory
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package python-thewalrus for openSUSE:Factory checked in at 2020-11-29 12:30:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-thewalrus (Old)
and /work/SRC/openSUSE:Factory/.python-thewalrus.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-thewalrus"
Sun Nov 29 12:30:17 2020 rev:2 rq:851335 version:0.14.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-thewalrus/python-thewalrus.changes 2020-09-25 16:36:28.120153140 +0200
+++ /work/SRC/openSUSE:Factory/.python-thewalrus.new.5913/python-thewalrus.changes 2020-11-29 12:30:21.834119643 +0100
@@ -1,0 +2,37 @@
+Thu Nov 26 07:51:50 UTC 2020 - andy great <andythe_great(a)pm.me>
+
+- Update to version 0.14.0.
+ * New features
+ * Adds the function find_classical_subsystem that tries to find
+ a subset of the modes with a classical covariance matrix.
+ * Adds the functions mean_number_of_clicks and
+ variance_number_of_clicks that calculate the first and second
+ statistical moments of the total number of clicks in a
+ Gaussian state centered at the origin.
+ * Adds the module decompositions with the function williamson
+ to find the Williamson decomposition of an even-size
+ positive-semidefinite matrix.
+ * Adds the loop_hafnian_quad function to the Python interface
+ for converting double precision matrices into quad precision,
+ doing the calculations in quad precision, and then return the
+ result as a double.
+ * Improvements
+ * Introduces a new faster and significantly more accurate
+ algorithm to calculate power traces allowing to speed up the
+ calculation of loop hafnians
+ * The quantum module has been refactored and organized into
+ sub-modules. Several functions have been renamed, while the
+ old names are being deprecated.
+ * Adds support for C++14
+ * pytest-randomly is added to the test suite to improve testing
+ and avoid stochastically failing tests.
+ * Modifies the function input_validation to use np.allclose for
+ checking the symmetry of the input matrices.
+ * Modifies the function _hafnian to calculate efficiently loop
+ hafnians of diagonal matrices.
+ * Breaking changes
+ * Removes the redundant function normal_ordered_complex_cov.
+ * Renames the function mean_number_of_clicks to be
+ mean_number_of_click_graph.
+
+-------------------------------------------------------------------
Old:
----
thewalrus-0.13.0.tar.gz
New:
----
thewalrus-0.14.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-thewalrus.spec ++++++
--- /var/tmp/diff_new_pack.FqaXpD/_old 2020-11-29 12:30:22.594120412 +0100
+++ /var/tmp/diff_new_pack.FqaXpD/_new 2020-11-29 12:30:22.598120417 +0100
@@ -20,7 +20,7 @@
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-thewalrus
-Version: 0.13.0
+Version: 0.14.0
Release: 0
Summary: An open-source software architecture for photonic quantum computing
License: Apache-2.0
@@ -29,8 +29,8 @@
Source: https://github.com/XanaduAI/thewalrus/archive/v%{version}.tar.gz#/%{package…
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module dask-all}
-BuildRequires: %{python_module numba >= 0.43.1}
-BuildRequires: %{python_module numpy >= 1.13.3}
+BuildRequires: %{python_module numba >= 0.49.1}
+BuildRequires: %{python_module numpy >= 1.15.0}
BuildRequires: %{python_module numpy-devel >= 1.13.3}
BuildRequires: %{python_module pytest >= 5.4.1}
BuildRequires: %{python_module repoze.lru >= 0.7}
@@ -42,8 +42,8 @@
BuildRequires: gcc-c++
BuildRequires: python-rpm-macros
Requires: python-dask-all
-Requires: python-numba
-Requires: python-numpy >= 1.13.3
+Requires: python-numba >= 0.49.1
+Requires: python-numpy >= 1.15.0
Requires: python-repoze.lru >= 0.7
Requires: python-scipy >= 1.2.1
Requires: python-sympy >= 1.5.1
++++++ thewalrus-0.13.0.tar.gz -> thewalrus-0.14.0.tar.gz ++++++
++++ 5143 lines of diff (skipped)
1
0
[opensuse-commit] commit python-quantum-blackbird for openSUSE:Factory
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package python-quantum-blackbird for openSUSE:Factory checked in at 2020-11-29 12:30:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-quantum-blackbird (Old)
and /work/SRC/openSUSE:Factory/.python-quantum-blackbird.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-quantum-blackbird"
Sun Nov 29 12:30:16 2020 rev:3 rq:851334 version:0.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-quantum-blackbird/python-quantum-blackbird.changes 2020-09-04 11:13:18.003066558 +0200
+++ /work/SRC/openSUSE:Factory/.python-quantum-blackbird.new.5913/python-quantum-blackbird.changes 2020-11-29 12:30:20.302118094 +0100
@@ -1,0 +2,18 @@
+Thu Nov 26 07:36:38 UTC 2020 - andy great <andythe_great(a)pm.me>
+
+- Update to version 0.3.0.
+ * Arrays and variables now support being defined as parameters
+ (using braces) in a Blackbird template.
+ * Time-domain multiplexing programs are now supported, using the
+ syntax type tdm (temporal_modes=3, copies=1).
+ * For-loops are supported inside Blackbird scripts.
+ * Keyword arguments are supported inside operations; for example,
+ MeasureHomodyne(select=[0, 1]) or
+ MeasureFock(dark_counts=[1, 0.5, 3]).
+ * Indexing is supported inside both modes and arguments; for
+ example, MZgate(list[2], list[0]) | [list[3], list[1]])).
+ All indices allow expressions such as phases[-3 + 2*2].
+ * Templates are no longer changed when calling them and replacing
+ the parameters with actual values.
+
+-------------------------------------------------------------------
Old:
----
blackbird-0.2.4.tar.gz
New:
----
blackbird-0.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-quantum-blackbird.spec ++++++
--- /var/tmp/diff_new_pack.h7U3wH/_old 2020-11-29 12:30:21.086118887 +0100
+++ /var/tmp/diff_new_pack.h7U3wH/_new 2020-11-29 12:30:21.090118891 +0100
@@ -20,14 +20,14 @@
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-quantum-blackbird
-Version: 0.2.4
+Version: 0.3.0
Release: 0
Summary: Quantum assembly language for continuous-variable quantum computation
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/XanaduAI/blackbird
Source: https://github.com/XanaduAI/blackbird/archive/v%{version}.tar.gz#/blackbird…
-BuildRequires: %{python_module antlr4-python3-runtime >= 4.7.2}
+BuildRequires: %{python_module antlr4-python3-runtime >= 4.8}
BuildRequires: %{python_module networkx}
BuildRequires: %{python_module numpy >= 1.16}
BuildRequires: %{python_module pytest}
@@ -36,7 +36,7 @@
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: uuid-devel
-Requires: python-antlr4-python3-runtime >= 4.7.1
+Requires: python-antlr4-python3-runtime >= 4.8
Requires: python-networkx
Requires: python-numpy >= 1.16
Requires: python-sympy
++++++ blackbird-0.2.4.tar.gz -> blackbird-0.3.0.tar.gz ++++++
++++ 5112 lines of diff (skipped)
1
0
[opensuse-commit] commit python-roifile for openSUSE:Factory
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package python-roifile for openSUSE:Factory checked in at 2020-11-29 12:30:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-roifile (Old)
and /work/SRC/openSUSE:Factory/.python-roifile.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-roifile"
Sun Nov 29 12:30:09 2020 rev:2 rq:851333 version:2020.8.13
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-roifile/python-roifile.changes 2020-08-14 13:11:02.893249493 +0200
+++ /work/SRC/openSUSE:Factory/.python-roifile.new.5913/python-roifile.changes 2020-11-29 12:30:19.326117107 +0100
@@ -1,0 +2,12 @@
+Thu Nov 26 07:20:28 UTC 2020 - andy great <andythe_great(a)pm.me>
+
+- Update to version 2020.8.13.
+ * Support writing to ZIP file.
+ * Support os.PathLike file names.
+
+-------------------------------------------------------------------
+Sat Aug 1 16:24:41 UTC 2020 - andy great <andythe_great(a)pm.me>
+
+- Update spec file to use python alternative.
+
+-------------------------------------------------------------------
Old:
----
roifile-2020.5.28.tar.gz
New:
----
roifile-2020.8.13.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-roifile.spec ++++++
--- /var/tmp/diff_new_pack.THNLMu/_old 2020-11-29 12:30:19.914117702 +0100
+++ /var/tmp/diff_new_pack.THNLMu/_new 2020-11-29 12:30:19.918117705 +0100
@@ -20,7 +20,7 @@
%define packagename roifile
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-roifile
-Version: 2020.5.28
+Version: 2020.8.13
Release: 0
Summary: Read and write ImageJ ROI format
License: BSD-3-Clause
@@ -32,11 +32,13 @@
BuildRequires: python-rpm-macros
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module numpy >= 1.15.1}
-BuildRequires: %{python_module matplotlib >= 3.1}
-BuildRequires: %{python_module tifffile}
+BuildRequires: %{python_module matplotlib >= 3.2}
+BuildRequires: %{python_module tifffile >= 2020.8.13}
Requires: python-numpy >= 1.15.1
-Requires: python-matplotlib >= 3.1
-Requires: python-tifffile
+Requires: python-matplotlib >= 3.2
+Requires: python-tifffile >= 2020.8.13
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
@@ -56,7 +58,17 @@
%install
%python_install
+%python_clone -a %{buildroot}%{_bindir}/%{packagename}
+
+
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%prepare_alternative %{packagename}
+
+%post
+%python_install_alternative %{packagename}
+
+%postun
+%python_uninstall_alternative %{packagename}
%check
# Test not given
@@ -64,7 +76,7 @@
%files %{python_files}
%doc README.rst
%license LICENSE
-%{_bindir}/%{packagename}
+%python_alternative %{_bindir}/%{packagename}
%{python_sitelib}/*egg-info/
%{python_sitelib}/%{packagename}/
++++++ roifile-2020.5.28.tar.gz -> roifile-2020.8.13.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roifile-2020.5.28/README.rst new/roifile-2020.8.13/README.rst
--- old/roifile-2020.5.28/README.rst 2020-05-28 17:10:13.000000000 +0200
+++ new/roifile-2020.8.13/README.rst 2020-08-14 05:40:40.000000000 +0200
@@ -15,21 +15,23 @@
:License: BSD 3-Clause
-:Version: 2020.5.28
+:Version: 2020.8.13
Requirements
------------
-* `CPython >= 3.6 <https://www.python.org>`_
+* `CPython >= 3.7 <https://www.python.org>`_
* `Numpy 1.15.1 <https://www.numpy.org>`_
-* `Tifffile 2020.5.25 <https://pypi.org/project/tifffile/>`_ (optional)
-* `Matplotlib 3.1 <https://pypi.org/project/matplotlib/>`_ (optional)
+* `Tifffile 2020.8.13 <https://pypi.org/project/tifffile/>`_ (optional)
+* `Matplotlib 3.2 <https://pypi.org/project/matplotlib/>`_ (optional)
Revisions
---------
+2020.8.13
+ Support writing to ZIP file.
+ Support os.PathLike file names.
2020.5.28
Fix int32 to hex color conversion.
Fix coordinates of closing path.
-2020.5.2
Fix reading TIFF files with no overlays.
2020.5.1
Split positions from counters.
@@ -39,6 +41,9 @@
Notes
-----
+The ImageJ ROI format cannot store integer coordinate values outside the
+range of -32768 to 32767 (16-bit signed).
+
Other Python packages handling ImageJ ROIs:
* `ijpython_roi <https://github.com/dwaithe/ijpython_roi>`_
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roifile-2020.5.28/roifile/roifile.py new/roifile-2020.8.13/roifile/roifile.py
--- old/roifile-2020.5.28/roifile/roifile.py 2020-05-28 17:10:13.000000000 +0200
+++ new/roifile-2020.8.13/roifile/roifile.py 2020-08-14 05:40:40.000000000 +0200
@@ -45,21 +45,23 @@
:License: BSD 3-Clause
-:Version: 2020.5.28
+:Version: 2020.8.13
Requirements
------------
-* `CPython >= 3.6 <https://www.python.org>`_
+* `CPython >= 3.7 <https://www.python.org>`_
* `Numpy 1.15.1 <https://www.numpy.org>`_
-* `Tifffile 2020.5.25 <https://pypi.org/project/tifffile/>`_ (optional)
-* `Matplotlib 3.1 <https://pypi.org/project/matplotlib/>`_ (optional)
+* `Tifffile 2020.8.13 <https://pypi.org/project/tifffile/>`_ (optional)
+* `Matplotlib 3.2 <https://pypi.org/project/matplotlib/>`_ (optional)
Revisions
---------
+2020.8.13
+ Support writing to ZIP file.
+ Support os.PathLike file names.
2020.5.28
Fix int32 to hex color conversion.
Fix coordinates of closing path.
-2020.5.2
Fix reading TIFF files with no overlays.
2020.5.1
Split positions from counters.
@@ -69,6 +71,9 @@
Notes
-----
+The ImageJ ROI format cannot store integer coordinate values outside the
+range of -32768 to 32767 (16-bit signed).
+
Other Python packages handling ImageJ ROIs:
* `ijpython_roi <https://github.com/dwaithe/ijpython_roi>`_
@@ -109,10 +114,11 @@
"""
-__version__ = '2020.5.28'
+__version__ = '2020.8.13'
__all__ = ('ImagejRoi', 'ROI_TYPE', 'ROI_SUBTYPE', 'ROI_OPTIONS')
+import os
import sys
import enum
import struct
@@ -276,6 +282,7 @@
For ZIP or TIFF files, return a list of ImagejRoi.
"""
+ filename = os.fspath(filename)
if filename[-4:].lower() == '.tif':
import tifffile
with tifffile.TiffFile(filename) as tif:
@@ -400,7 +407,7 @@
dtype=self.byteorder + 'u4',
buffer=data,
offset=counters_offset
- )
+ )
self.counters = (counters & 0xFF).astype('u1')
self.counter_positions = counters >> 8
@@ -433,7 +440,7 @@
buffer=data,
offset=64,
order='F'
- ).copy()
+ ).copy()
if self.subpixelresolution:
self.subpixel_coordinates = numpy.ndarray(
@@ -442,7 +449,7 @@
buffer=data,
offset=64 + self.n_coordinates * 4,
order='F'
- ).copy()
+ ).copy()
elif self.composite and self.roitype == ROI_TYPE.RECT:
self.multi_coordinates = numpy.ndarray(
@@ -450,17 +457,34 @@
dtype=self.byteorder + 'f4',
buffer=data,
offset=64
- ).copy()
+ ).copy()
elif self.roitype not in (ROI_TYPE.RECT, ROI_TYPE.LINE, ROI_TYPE.OVAL):
log_warning(f'cannot handle ImagejRoi type {self.roitype!r}')
return self
- def tofile(self, filename):
- """Write ImagejRoi to a new ROI file."""
- with open(filename, 'wb') as fh:
- fh.write(self.tobytes())
+ def tofile(self, filename, name=None, mode=None):
+ """Write ImagejRoi to a ROI or ZIP file.
+
+ Existing ZIP files are opened for append.
+
+ """
+ filename = os.fspath(filename)
+ if filename[-4:].lower() == '.zip':
+ import zipfile
+ if name is None:
+ name = self.name if self.name else self.autoname
+ if name[-4:].lower() != '.roi':
+ name += '.roi'
+ if mode is None:
+ mode = 'a' if os.path.exists(filename) else 'w'
+ with zipfile.ZipFile(filename, mode) as zf:
+ with zf.open(name, 'w') as fh:
+ fh.write(self.tobytes())
+ else:
+ with open(filename, 'wb') as fh:
+ fh.write(self.tobytes())
def tobytes(self):
"""Return ImagejRoi as bytes."""
@@ -700,15 +724,17 @@
[self.left, self.bottom],
[self.right, self.bottom],
[self.right, self.top],
- [self.left, self.top]], 'f4')
+ [self.left, self.top]],
+ 'f4'
+ )
else:
coords = numpy.empty((0, 2), dtype=self.byteorder + 'i4')
return [coords] if multi else coords
- def hexcolor(self, b):
+ def hexcolor(self, b, default=None):
"""Return color (bytes) as hex triplet or None if black."""
if b == ROI_COLOR_NONE:
- return None
+ return default
if self.byteorder == '>':
return f'#{b[1]:02x}{b[2]:02x}{b[3]:02x}'
return f'#{b[3]:02x}{b[2]:02x}{b[1]:02x}'
@@ -777,6 +803,17 @@
))
@property
+ def autoname(self):
+ """Return name generated from positions."""
+ y = (self.bottom - self.top) // 2
+ x = (self.right - self.left) // 2
+ name = f'{y:05}-{x:05}'
+ if self.counter_positions is not None:
+ tzc = int(self.counter_positions.max())
+ name = f'{tzc:05}-' + name
+ return name
+
+ @property
def utf16(self):
"""Return UTF-16 codec depending on byteorder."""
return 'utf-16' + ('be' if self.byteorder == '>' else 'le')
@@ -814,6 +851,7 @@
def test_imagejroi():
"""Test roifile.ImagejRoi class."""
+ # test ROIs from a ZIP file
rois = ImagejRoi.fromfile('tests/ijzip.zip')
assert len(rois) == 7
for roi in rois:
@@ -821,6 +859,16 @@
roi.coordinates()
roi.__str__()
+ # re-write ROIs to a ZIP file
+ try:
+ os.remove('_test.zip')
+ except OSError:
+ pass
+ for roi in rois:
+ roi.tofile('_test.zip')
+ assert ImagejRoi.fromfile('_test.zip')[-1] == rois[-1]
+
+ # verify box_combined
roi = ImagejRoi.fromfile('tests/box_combined.roi')
assert roi.tobytes() == ImagejRoi.frombytes(roi.tobytes()).tobytes()
assert roi.name == '0464-0752'
@@ -834,6 +882,7 @@
assert roi.multi_coordinates[0] == 0.0
roi.__str__()
+ # read a ROI from a TIFF file
for roi in ImagejRoi.fromfile('tests/IJMetadata.tif'):
assert roi == ImagejRoi.frombytes(roi.tobytes())
roi.coordinates()
@@ -850,7 +899,6 @@
``python -m roifile file_or_directory``
"""
- import os
from glob import glob
if argv is None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roifile-2020.5.28/setup.py new/roifile-2020.8.13/setup.py
--- old/roifile-2020.5.28/setup.py 2020-05-28 17:10:13.000000000 +0200
+++ new/roifile-2020.8.13/setup.py 2020-08-14 05:40:40.000000000 +0200
@@ -39,8 +39,13 @@
long_description=readme,
author='Christoph Gohlke',
author_email='cgohlke(a)uci.edu',
- url='https://www.lfd.uci.edu/~gohlke/',
license='BSD',
+ url='https://www.lfd.uci.edu/~gohlke/',
+ project_urls={
+ 'Bug Tracker': 'https://github.com/cgohlke/roifile/issues',
+ 'Source Code': 'https://github.com/cgohlke/roifile',
+ # 'Documentation': 'https://',
+ },
packages=['roifile'],
entry_points={
'console_scripts': ['roifile = roifile.roifile:main']},
@@ -49,7 +54,7 @@
extras_require={
'all': [
'matplotlib>=3.1',
- 'tifffile>=2020.5.25',
+ 'tifffile>=2020.6.3',
]
},
platforms=['any'],
@@ -60,7 +65,6 @@
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3 :: Only',
- 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
1
0
[opensuse-commit] commit buildah for openSUSE:Leap:15.1:Update
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package buildah for openSUSE:Leap:15.1:Update checked in at 2020-11-29 12:30:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.1:Update/buildah (Old)
and /work/SRC/openSUSE:Leap:15.1:Update/.buildah.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "buildah"
Sun Nov 29 12:30:06 2020 rev:2 rq:851006 version:unknown
Changes:
--------
New Changes file:
NO CHANGES FILE!!!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ _link ++++++
--- /var/tmp/diff_new_pack.cx6x4E/_old 2020-11-29 12:30:19.098116877 +0100
+++ /var/tmp/diff_new_pack.cx6x4E/_new 2020-11-29 12:30:19.098116877 +0100
@@ -1 +1 @@
-<link package='buildah.11044' cicount='copy' />
+<link package='buildah.15047' cicount='copy' />
1
0
[opensuse-commit] commit python-netpbmfile for openSUSE:Factory
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package python-netpbmfile for openSUSE:Factory checked in at 2020-11-29 12:30:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-netpbmfile (Old)
and /work/SRC/openSUSE:Factory/.python-netpbmfile.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-netpbmfile"
Sun Nov 29 12:30:04 2020 rev:2 rq:851330 version:2020.10.18
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-netpbmfile/python-netpbmfile.changes 2020-08-14 13:11:08.821251751 +0200
+++ /work/SRC/openSUSE:Factory/.python-netpbmfile.new.5913/python-netpbmfile.changes 2020-11-29 12:30:17.730115492 +0100
@@ -1,0 +2,9 @@
+Thu Nov 26 06:58:50 UTC 2020 - andy great <andythe_great(a)pm.me>
+
+- Update to version 2020.10.18.
+ * Disallow comments after last value in PNM headers.
+- Update since 2020.1.1
+ Remove support for Python 3.6.
+ Support os.PathLike file names.
+
+-------------------------------------------------------------------
Old:
----
netpbmfile-2020.1.1.tar.gz
New:
----
netpbmfile-2020.10.18.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-netpbmfile.spec ++++++
--- /var/tmp/diff_new_pack.4WaPDy/_old 2020-11-29 12:30:18.378116148 +0100
+++ /var/tmp/diff_new_pack.4WaPDy/_new 2020-11-29 12:30:18.382116152 +0100
@@ -20,7 +20,7 @@
%define packagename netpbmfile
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-netpbmfile
-Version: 2020.1.1
+Version: 2020.10.18
Release: 0
Summary: Read and write image files in the Netpbm format
License: BSD-3-Clause
@@ -28,13 +28,13 @@
URL: https://www.lfd.uci.edu/~gohlke/
Source: https://github.com/cgohlke/netpbmfile/archive/v%{version}.tar.gz#/%{package…
BuildRequires: %{python_module Cython}
-BuildRequires: %{python_module matplotlib >= 3.1}
-BuildRequires: %{python_module numpy >= 1.14}
+BuildRequires: %{python_module matplotlib >= 3.2}
+BuildRequires: %{python_module numpy >= 1.15}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-matplotlib >= 3.1
-Requires: python-numpy >= 1.14
+Requires: python-matplotlib >= 3.2
+Requires: python-numpy >= 1.15
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
++++++ netpbmfile-2020.1.1.tar.gz -> netpbmfile-2020.10.18.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netpbmfile-2020.1.1/README.rst new/netpbmfile-2020.10.18/README.rst
--- old/netpbmfile-2020.1.1/README.rst 2020-01-18 10:05:20.000000000 +0100
+++ new/netpbmfile-2020.10.18/README.rst 2020-10-18 15:13:28.000000000 +0200
@@ -24,16 +24,21 @@
:License: BSD 3-Clause
-:Version: 2020.1.1
+:Version: 2020.10.18
Requirements
------------
-* `CPython >= 3.6 <https://www.python.org>`_
-* `Numpy 1.14 <https://www.numpy.org>`_
-* `Matplotlib 3.1 <https://www.matplotlib.org>`_ (optional for plotting)
+* `CPython >= 3.7 <https://www.python.org>`_
+* `Numpy 1.15 <https://www.numpy.org>`_
+* `Matplotlib 3.2 <https://www.matplotlib.org>`_ (optional for plotting)
Revisions
---------
+2020.10.18
+ Disallow comments after last value in PNM headers.
+2020.9.18
+ Remove support for Python 3.6 (NEP 29).
+ Support os.PathLike file names.
2020.1.1
Fix reading tightly packed P1 format and ASCII data with inline comments.
Remove support for Python 2.7 and 3.5.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netpbmfile-2020.1.1/netpbmfile/netpbmfile.py new/netpbmfile-2020.10.18/netpbmfile/netpbmfile.py
--- old/netpbmfile-2020.1.1/netpbmfile/netpbmfile.py 2020-01-18 10:05:20.000000000 +0100
+++ new/netpbmfile-2020.10.18/netpbmfile/netpbmfile.py 2020-10-18 15:13:28.000000000 +0200
@@ -54,16 +54,21 @@
:License: BSD 3-Clause
-:Version: 2020.1.1
+:Version: 2020.10.18
Requirements
------------
-* `CPython >= 3.6 <https://www.python.org>`_
-* `Numpy 1.14 <https://www.numpy.org>`_
-* `Matplotlib 3.1 <https://www.matplotlib.org>`_ (optional for plotting)
+* `CPython >= 3.7 <https://www.python.org>`_
+* `Numpy 1.15 <https://www.numpy.org>`_
+* `Matplotlib 3.2 <https://www.matplotlib.org>`_ (optional for plotting)
Revisions
---------
+2020.10.18
+ Disallow comments after last value in PNM headers.
+2020.9.18
+ Remove support for Python 3.6 (NEP 29).
+ Support os.PathLike file names.
2020.1.1
Fix reading tightly packed P1 format and ASCII data with inline comments.
Remove support for Python 2.7 and 3.5.
@@ -109,7 +114,7 @@
"""
-__version__ = '2020.1.1'
+__version__ = '2020.10.18'
__all__ = ('imread', 'imwrite', 'imsave', 'NetpbmFile')
@@ -172,7 +177,7 @@
self._fh = filename
else:
self._fh = open(filename, 'rb')
- self.filename = filename
+ self.filename = os.fspath(filename)
self._fh.seek(0)
data = self._fh.read(4096)
@@ -188,7 +193,8 @@
self._read_pnm_header(data)
except Exception as exc:
raise ValueError(
- f'Not a Netpbm file:\n{data[:32]}') from exc
+ f'Not a Netpbm file:\n{data[:32]}'
+ ) from exc
if self.magicnum in b'PFPf':
dtype = self.byteorder + 'f4'
@@ -278,14 +284,17 @@
def __str__(self):
"""Return information about Netpbm file."""
- return '\n '.join((
- self.__class__.__name__,
- os.path.normpath(os.path.normcase(self.filename)),
- f'type: {NetpbmFile.MAGIC_NUMBER[self.magicnum].decode("ascii")}',
- f'axes: {self.axes}',
- 'shape: {}'.format(', '.join(str(i) for i in self.shape)),
- f'dtype: {self.dtype}',
- ))
+ magicnum = NetpbmFile.MAGIC_NUMBER[self.magicnum].decode('ascii')
+ return '\n '.join(
+ (
+ self.__class__.__name__,
+ os.path.normpath(os.path.normcase(self.filename)),
+ f'type: {magicnum}',
+ f'axes: {self.axes}',
+ 'shape: {}'.format(', '.join(str(i) for i in self.shape)),
+ f'dtype: {self.dtype}',
+ )
+ )
def _read_pam_header(self, data):
"""Read PAM header and initialize instance."""
@@ -293,7 +302,7 @@
br'(^P7[\n\r]+(?:(?:[\n\r]+)|(?:#.*)|'
br'(HEIGHT\s+\d+)|(WIDTH\s+\d+)|(DEPTH\s+\d+)|(MAXVAL\s+\d+)|'
br'(?:TUPLTYPE\s+\w+))*ENDHDR\n)',
- data
+ data,
).groups()
self.header = regroups[0]
self.magicnum = b'P7'
@@ -307,15 +316,20 @@
"""Read PNM header and initialize instance."""
bpm = data[1:2] in b'14'
regroups = re.search(
- b''.join((
- br'(^(P[123456]|P7 332)\s+(?:#.*[\r\n])*',
- br'\s*(\d+)\s+(?:#.*[\r\n])*',
- br'\s*(\d+)\s+(?:#.*[\r\n])*' * (not bpm),
- br'\s*(\d+)\s(?:\s*#.*[\r\n]\s)*)'
- )),
- data
+ b''.join(
+ (
+ br'(^(P[123456]|P7 332)\s+(?:#.*[\r\n])*',
+ br'\s*(\d+)\s+(?:#.*[\r\n])*',
+ br'\s*(\d+)\s+(?:#.*[\r\n])*' * (not bpm),
+ # in disagreement with the netpbm doc pages, the netpbm
+ # man pages only allow a single whitespace character after
+ # the last value
+ br'\s*(\d+)\s)',
+ )
+ ),
+ data,
).groups()
- regroups = regroups + (1, ) * bpm
+ regroups = regroups + (1,) * bpm
self.header = regroups[0]
self.magicnum = regroups[1]
self.width = int(regroups[2])
@@ -326,12 +340,14 @@
def _read_pf_header(self, data):
"""Read PF header and initialize instance."""
+ # there are no comments in these files
regroups = re.search(
br'(^(P[Ff])\s+(?:#.*[\r\n])*'
br'\s*(\d+)\s+(?:#.*[\r\n])*'
br'\s*(\d+)\s+(?:#.*[\r\n])*'
- br'\s*([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)\s+(?:#.*[\r\n])*)',
- data
+ br'\s*([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)'
+ br'\s*[\n])',
+ data,
).groups()
self.header = regroups[0]
self.magicnum = regroups[1]
@@ -344,7 +360,7 @@
def _read_data(self, fh, byteorder=None):
"""Return image data from open file as numpy array."""
fh.seek(len(self.header))
- data = fh.read()
+
if byteorder is None:
byteorder = self.byteorder
if self.magicnum in b'PFPf':
@@ -356,24 +372,26 @@
dtype = numpy.dtype(dtype)
depth = 1 if self.magicnum == b'P7 332' else self.depth
shape = [-1, self.height, self.width, depth]
- size = numpy.prod(shape[1:], dtype='int64')
- if self.magicnum in b'PFPf':
- size *= dtype.itemsize
- data = numpy.frombuffer(data[:size], dtype).reshape(shape)
- elif self.magicnum in b'P1P2P3':
+
+ if self.magicnum in b'P1P2P3':
+ data = fh.read()
if self.magicnum == b'P1' and data[1] != b' ':
data = [bytes([i]) for i in data if i == 48 or i == 49]
else:
data = [i for i in data.split() if i.isdigit()]
+ size = numpy.prod(shape[1:], dtype='int64')
data = numpy.array(data[:size], dtype)
data = data.reshape(shape)
- elif self.maxval == 1:
- shape[2] = int(math.ceil(self.width / 8))
- data = numpy.frombuffer(data, dtype).reshape(shape)
- data = numpy.unpackbits(data, axis=-2)[:, :, :self.width, :]
else:
- size *= dtype.itemsize
- data = numpy.frombuffer(data[:size], dtype).reshape(shape)
+ bilevel = self.maxval == 1 and self.magicnum not in b'PFPf'
+ if bilevel:
+ shape[2] = int(math.ceil(self.width / 8))
+ size = numpy.prod(shape[1:], dtype='int64') * dtype.itemsize
+ data = fh.read(size)
+ data = numpy.frombuffer(data, dtype).reshape(shape)
+ if bilevel:
+ data = numpy.unpackbits(data, axis=-2)[:, :, : self.width, :]
+
if data.shape[0] < 2:
data = data.reshape(data.shape[1:])
if data.shape[-1] < 2:
@@ -396,15 +414,19 @@
def _header(self, pam=False):
"""Return file header as byte string."""
if pam or self.magicnum == b'P7':
- header = '\n'.join((
- 'P7',
- f'HEIGHT {self.height}',
- f'WIDTH {self.width}',
- f'DEPTH {self.depth}',
- f'MAXVAL {self.maxval}',
- '\n'.join(f"TUPLTYPE {i.decode('ascii')}"
- for i in self.tupltypes),
- 'ENDHDR\n'))
+ header = '\n'.join(
+ (
+ 'P7',
+ f'HEIGHT {self.height}',
+ f'WIDTH {self.width}',
+ f'DEPTH {self.depth}',
+ f'MAXVAL {self.maxval}',
+ '\n'.join(
+ f"TUPLTYPE {i.decode('ascii')}" for i in self.tupltypes
+ ),
+ 'ENDHDR\n',
+ )
+ )
elif self.maxval == 1:
header = f'P4 {self.width} {self.height}\n'
elif self.depth == 1:
@@ -429,6 +451,7 @@
if len(argv) > 1 and '--doctest' in argv:
import doctest
+
doctest.testmod()
return
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/netpbmfile-2020.1.1/setup.py new/netpbmfile-2020.10.18/setup.py
--- old/netpbmfile-2020.1.1/setup.py 2020-01-18 10:05:20.000000000 +0100
+++ new/netpbmfile-2020.10.18/setup.py 2020-10-18 15:13:28.000000000 +0200
@@ -14,14 +14,21 @@
description = re.search(r'"""(.*)\.(?:\r\n|\r|\n)', code).groups()[0]
-readme = re.search(r'(?:\r\n|\r|\n){2}"""(.*)"""(?:\r\n|\r|\n){2}__version__',
- code, re.MULTILINE | re.DOTALL).groups()[0]
+readme = re.search(
+ r'(?:\r\n|\r|\n){2}"""(.*)"""(?:\r\n|\r|\n){2}__version__',
+ code,
+ re.MULTILINE | re.DOTALL,
+).groups()[0]
-readme = '\n'.join([description, '=' * len(description)] +
- readme.splitlines()[1:])
+readme = '\n'.join(
+ [description, '=' * len(description)] + readme.splitlines()[1:]
+)
-license = re.search(r'(# Copyright.*?(?:\r\n|\r|\n))(?:\r\n|\r|\n)+""', code,
- re.MULTILINE | re.DOTALL).groups()[0]
+license = re.search(
+ r'(# Copyright.*?(?:\r\n|\r|\n))(?:\r\n|\r|\n)+""',
+ code,
+ re.MULTILINE | re.DOTALL,
+).groups()[0]
license = license.replace('# ', '').replace('#', '')
@@ -40,12 +47,18 @@
author='Christoph Gohlke',
author_email='cgohlke(a)uci.edu',
url='https://www.lfd.uci.edu/~gohlke/',
+ project_urls={
+ 'Bug Tracker': 'https://github.com/cgohlke/netpbmfile/issues',
+ 'Source Code': 'https://github.com/cgohlke/netpbmfile',
+ # 'Documentation': 'https://',
+ },
license='BSD',
packages=['netpbmfile'],
entry_points={
- 'console_scripts': ['netpbmfile = netpbmfile.netpbmfile:main']},
+ 'console_scripts': ['netpbmfile = netpbmfile.netpbmfile:main']
+ },
python_requires='>=3.6',
- install_requires=['numpy>=1.14.5'],
+ install_requires=['numpy>=1.15.1'],
platforms=['any'],
classifiers=[
'Development Status :: 4 - Beta',
@@ -54,8 +67,8 @@
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3 :: Only',
- 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
],
)
1
0
[opensuse-commit] commit python-rpcq for openSUSE:Factory
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package python-rpcq for openSUSE:Factory checked in at 2020-11-29 12:29:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-rpcq (Old)
and /work/SRC/openSUSE:Factory/.python-rpcq.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-rpcq"
Sun Nov 29 12:29:58 2020 rev:2 rq:851324 version:3.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-rpcq/python-rpcq.changes 2020-08-19 18:58:45.291908754 +0200
+++ /work/SRC/openSUSE:Factory/.python-rpcq.new.5913/python-rpcq.changes 2020-11-29 12:30:16.642114392 +0100
@@ -1,0 +2,8 @@
+Thu Nov 26 06:23:22 UTC 2020 - andy great <andythe_great(a)pm.me>
+
+- Update to version 3.6.0.
+ * Add YokogawaGS200Channel message
+- Updates since 3.4.0.
+ * Add QDOSequencer, QDOSlowFluxChannel, and QDOFastFluxChannel.
+
+-------------------------------------------------------------------
Old:
----
rpcq-3.4.0.tar.gz
New:
----
rpcq-3.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-rpcq.spec ++++++
--- /var/tmp/diff_new_pack.cDG4F5/_old 2020-11-29 12:30:17.286115043 +0100
+++ /var/tmp/diff_new_pack.cDG4F5/_new 2020-11-29 12:30:17.290115048 +0100
@@ -20,7 +20,7 @@
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-rpcq
-Version: 3.4.0
+Version: 3.6.0
Release: 0
Summary: The RPC framework and message specification for Rigetti QCS
License: Apache-2.0
++++++ rpcq-3.4.0.tar.gz -> rpcq-3.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpcq-3.4.0/VERSION.txt new/rpcq-3.6.0/VERSION.txt
--- old/rpcq-3.4.0/VERSION.txt 2020-07-16 01:37:35.000000000 +0200
+++ new/rpcq-3.6.0/VERSION.txt 2020-11-25 21:19:55.000000000 +0100
@@ -1 +1 @@
-3.4.0
+3.6.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpcq-3.4.0/rpcq/core_messages.py new/rpcq-3.6.0/rpcq/core_messages.py
--- old/rpcq-3.4.0/rpcq/core_messages.py 2020-07-16 01:37:35.000000000 +0200
+++ new/rpcq-3.6.0/rpcq/core_messages.py 2020-11-25 21:19:55.000000000 +0100
@@ -692,7 +692,7 @@
"""Delay [seconds] to account for inter-channel skew."""
flux_current: Optional[float] = None
- """Slow flux current [Amps]."""
+ """Flux current [Amps]."""
relay_closed: Optional[bool] = None
"""Set the state of the Flux relay.
@@ -793,6 +793,52 @@
@dataclass(eq=False, repr=False)
+class QDOSlowFluxChannel(Message):
+ """
+ Configuration for a single QDO Slow Flux Channel.
+ """
+
+ channel_index: int
+ """The channel index on the QDO, zero indexed from the
+ lowest channel, as installed in the box. Flux index typically starts at 4."""
+
+ flux_current: Optional[float] = None
+ """Flux current [Amps]."""
+
+ relay_closed: Optional[bool] = False
+ """Set the state of the Flux relay.
+ True - Relay closed, allows flux current to flow.
+ False - Relay open, no flux current can flow."""
+
+
+@dataclass(eq=False, repr=False)
+class QDOFastFluxChannel(Message):
+ """
+ Configuration for a single QDO Fast Flux Channel.
+ """
+
+ channel_index: int
+ """The channel index on the QDO, zero indexed from the
+ lowest channel, as installed in the box."""
+
+ direction: Optional[str] = "tx"
+ """The QDO is a device that transmits pulses."""
+
+ delay: float = 0.0e+0
+ """Delay [seconds] to account for inter-channel skew."""
+
+ flux_current: Optional[float] = None
+ """Flux current [Amps]."""
+
+
+@dataclass(eq=False, repr=False)
+class YokogawaGS200Channel(Message):
+ """
+ Configuration for a single Yokogawa GS200 Channel.
+ """
+
+
+@dataclass(eq=False, repr=False)
class LegacyUSRPSequencer(Message):
"""
Configuration for a Legacy USRP Sequencer
@@ -812,6 +858,16 @@
"""
tx_channel: str
+ """The label of the associated channel."""
+
+
+@dataclass(eq=False, repr=False)
+class QDOSequencer(Message):
+ """
+ Configuration for a single QDO Sequencer.
+ """
+
+ tx_channel: str
"""The label of the associated channel."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpcq-3.4.0/src/core-messages.lisp new/rpcq-3.6.0/src/core-messages.lisp
--- old/rpcq-3.4.0/src/core-messages.lisp 2020-07-16 01:37:35.000000000 +0200
+++ new/rpcq-3.6.0/src/core-messages.lisp 2020-11-25 21:19:55.000000000 +0100
@@ -868,7 +868,7 @@
:default 0.0)
(|flux_current|
- :documentation "Slow flux current [Amps]."
+ :documentation "Flux current [Amps]."
:type :float
:required nil
:default nil)
@@ -1019,6 +1019,63 @@
:documentation "Configuration for a single CW Generator Channel.")
+(defmessage |QDOSlowFluxChannel| ()
+ (
+ (|channel_index|
+ :documentation "The channel index on the QDO, zero indexed from the\
+ lowest channel, as installed in the box. Flux index typically starts at 4."
+ :type :integer
+ :required t)
+
+ (|flux_current|
+ :documentation "Flux current [Amps]."
+ :type :float
+ :required nil
+ :default nil)
+
+ (|relay_closed|
+ :documentation "Set the state of the Flux relay.\
+ True - Relay closed, allows flux current to flow.\
+ False - Relay open, no flux current can flow."
+ :type :bool
+ :required nil
+ :default nil))
+
+ :documentation "Configuration for a single QDO Slow Flux Channel.")
+
+(defmessage |QDOFastFluxChannel| ()
+ (
+ (|direction|
+ :documentation "The QDO is a device that transmits pulses."
+ :type :string
+ :required nil
+ :default "tx")
+
+ (|channel_index|
+ :documentation "The channel index on the QDO, zero indexed from the\
+ lowest channel, as installed in the box."
+ :type :integer
+ :required t)
+
+ (|delay|
+ :documentation "Delay [seconds] to account for inter-channel skew."
+ :type :float
+ :required t
+ :default 0.0)
+
+ (|flux_current|
+ :documentation "Flux current [Amps]."
+ :type :float
+ :required nil
+ :default nil))
+
+ :documentation "Configuration for a single QDO Fast Flux Channel.")
+
+(defmessage |YokogawaGS200Channel| ()
+ ()
+
+ :documentation "Configuration for a single Yokogawa GS200 Channel.")
+
(defmessage |LegacyUSRPSequencer| ()
(
(|tx_channel|
@@ -1042,6 +1099,15 @@
:documentation "Configuration for a single QFD Sequencer.")
+(defmessage |QDOSequencer| ()
+ (
+ (|tx_channel|
+ :documentation "The label of the associated channel."
+ :type :string
+ :required t))
+
+ :documentation "Configuration for a single QDO Sequencer.")
+
(defmessage |QFDx2Sequencer| ()
(
(|tx_channel|
1
0
[opensuse-commit] commit python-qtconsole for openSUSE:Factory
by User for buildservice source handling 29 Nov '20
by User for buildservice source handling 29 Nov '20
29 Nov '20
Hello community,
here is the log from the commit of package python-qtconsole for openSUSE:Factory checked in at 2020-11-29 12:29:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-qtconsole (Old)
and /work/SRC/openSUSE:Factory/.python-qtconsole.new.5913 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-qtconsole"
Sun Nov 29 12:29:55 2020 rev:13 rq:851343 version:5.0.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-qtconsole/python-qtconsole.changes 2020-09-17 14:52:06.083982611 +0200
+++ /work/SRC/openSUSE:Factory/.python-qtconsole.new.5913/python-qtconsole.changes 2020-11-29 12:30:12.590110294 +0100
@@ -1,0 +2,13 @@
+Thu Nov 26 17:51:02 UTC 2020 - Arun Persaud <arun(a)gmx.de>
+
+- update to version 5.0.1:
+ * Add python_requires to setup.py for Python 3.6+ compatibility
+
+- changes from version 5.0.0:
+ * Additions
+ + Add option to set completion type while running.
+ * Changes
+ + Emit kernel_restarted after restarting kernel.
+ + Drop support for Python 2.7 and 3.5.
+
+-------------------------------------------------------------------
Old:
----
qtconsole-4.7.7.tar.gz
New:
----
qtconsole-5.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-qtconsole.spec ++++++
--- /var/tmp/diff_new_pack.PTZx7e/_old 2020-11-29 12:30:15.186112920 +0100
+++ /var/tmp/diff_new_pack.PTZx7e/_new 2020-11-29 12:30:15.190112923 +0100
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-qtconsole
-Version: 4.7.7
+Version: 5.0.1
Release: 0
Summary: Jupyter Qt console
License: BSD-3-Clause
++++++ qtconsole-4.7.7.tar.gz -> qtconsole-5.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/PKG-INFO new/qtconsole-5.0.1/PKG-INFO
--- old/qtconsole-4.7.7/PKG-INFO 2020-09-03 06:02:46.000000000 +0200
+++ new/qtconsole-5.0.1/PKG-INFO 2020-11-24 18:27:25.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: qtconsole
-Version: 4.7.7
+Version: 5.0.1
Summary: Jupyter Qt console
Home-page: http://jupyter.org
Author: Jupyter Development Team
@@ -9,7 +9,9 @@
License: BSD
Description: # Jupyter QtConsole
- [![Build Status](https://travis-ci.org/jupyter/qtconsole.svg?branch=master)](https:/…
+ ![Windows tests](https://github.com/jupyter/qtconsole/workflows/Windows%20tests/badge…
+ ![Macos tests](https://github.com/jupyter/qtconsole/workflows/Macos%20tests/badge.s…
+ ![Linux tests](https://github.com/jupyter/qtconsole/workflows/Linux%20tests/badge.s…
[![Coverage Status](https://coveralls.io/repos/github/jupyter/qtconsole/badge.svg?branch=master)](https://coveralls.io/github/jupyter/qtconsole?branch=master)
[![Documentation Status](https://readthedocs.org/projects/qtconsole/badge/?version=stable)](…
[![Google Group](https://img.shields.io/badge/-Google%20Group-lightgrey.svg)](https:/…
@@ -90,11 +92,12 @@
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Requires-Python: >= 3.6
Description-Content-Type: text/markdown
Provides-Extra: test
Provides-Extra: doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/README.md new/qtconsole-5.0.1/README.md
--- old/qtconsole-4.7.7/README.md 2019-05-27 15:00:29.000000000 +0200
+++ new/qtconsole-5.0.1/README.md 2020-11-21 23:57:26.000000000 +0100
@@ -1,6 +1,8 @@
# Jupyter QtConsole
-[![Build Status](https://travis-ci.org/jupyter/qtconsole.svg?branch=master)](https:/…
+![Windows tests](https://github.com/jupyter/qtconsole/workflows/Windows%20tests/badge…
+![Macos tests](https://github.com/jupyter/qtconsole/workflows/Macos%20tests/badge.s…
+![Linux tests](https://github.com/jupyter/qtconsole/workflows/Linux%20tests/badge.s…
[![Coverage Status](https://coveralls.io/repos/github/jupyter/qtconsole/badge.svg?branch=master)](https://coveralls.io/github/jupyter/qtconsole?branch=master)
[![Documentation Status](https://readthedocs.org/projects/qtconsole/badge/?version=stable)](…
[![Google Group](https://img.shields.io/badge/-Google%20Group-lightgrey.svg)](https:/…
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/docs/gh-pages.py new/qtconsole-5.0.1/docs/gh-pages.py
--- old/qtconsole-4.7.7/docs/gh-pages.py 2015-12-20 15:40:14.000000000 +0100
+++ new/qtconsole-5.0.1/docs/gh-pages.py 2020-11-21 05:27:38.000000000 +0100
@@ -14,8 +14,6 @@
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
-from __future__ import print_function
-
import os
import shutil
import sys
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/docs/source/changelog.rst new/qtconsole-5.0.1/docs/source/changelog.rst
--- old/qtconsole-4.7.7/docs/source/changelog.rst 2020-09-03 05:55:38.000000000 +0200
+++ new/qtconsole-5.0.1/docs/source/changelog.rst 2020-11-24 18:22:55.000000000 +0100
@@ -3,6 +3,35 @@
Changes in Jupyter Qt console
=============================
+.. _5.0:
+
+5.0
+~~~
+
+5.0.1
+-----
+
+`5.0.1 on GitHub <https://github.com/jupyter/qtconsole/milestones/5.0.1>`__
+
+* Add python_requires to setup.py for Python 3.6+ compatibility
+
+5.0.0
+-----
+
+`5.0.0 on GitHub <https://github.com/jupyter/qtconsole/milestones/5.0>`__
+
+Additions
++++++++++
+
+- Add option to set completion type while running.
+
+Changes
++++++++
+
+- Emit kernel_restarted after restarting kernel.
+- Drop support for Python 2.7 and 3.5.
+
+
.. _4.7:
4.7
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/docs/source/conf.py new/qtconsole-5.0.1/docs/source/conf.py
--- old/qtconsole-4.7.7/docs/source/conf.py 2017-08-12 17:49:25.000000000 +0200
+++ new/qtconsole-5.0.1/docs/source/conf.py 2020-11-21 05:27:38.000000000 +0100
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-#
# Jupyter Qt Console documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 13 10:20:17 2015.
#
@@ -251,8 +249,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
- (master_doc, 'JupyterQtConsole.tex', u'Jupyter Qt Console Documentation',
- u'Jupyter Development Team', 'manual'),
+ (master_doc, 'JupyterQtConsole.tex', 'Jupyter Qt Console Documentation',
+ 'Jupyter Development Team', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -281,7 +279,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- (master_doc, 'jupyterqtconsole', u'Jupyter Qt Console Documentation',
+ (master_doc, 'jupyterqtconsole', 'Jupyter Qt Console Documentation',
[author], 1)
]
@@ -295,7 +293,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- (master_doc, 'JupyterQtConsole', u'Jupyter Qt Console Documentation',
+ (master_doc, 'JupyterQtConsole', 'Jupyter Qt Console Documentation',
author, 'JupyterQtConsole', 'One line description of project.',
'Miscellaneous'),
]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/_version.py new/qtconsole-5.0.1/qtconsole/_version.py
--- old/qtconsole-4.7.7/qtconsole/_version.py 2020-09-03 06:01:53.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/_version.py 2020-11-24 18:26:22.000000000 +0100
@@ -1,2 +1,2 @@
-version_info = (4, 7, 7)
+version_info = (5, 0, 1)
__version__ = '.'.join(map(str, version_info))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/ansi_code_processor.py new/qtconsole-5.0.1/qtconsole/ansi_code_processor.py
--- old/qtconsole-4.7.7/qtconsole/ansi_code_processor.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/ansi_code_processor.py 2020-11-21 05:27:38.000000000 +0100
@@ -12,7 +12,6 @@
from qtpy import QtGui
# Local imports
-from ipython_genutils.py3compat import string_types
from qtconsole.styles import dark_style
#-----------------------------------------------------------------------------
@@ -335,7 +334,7 @@
else:
return None
- if isinstance(constructor, string_types):
+ if isinstance(constructor, str):
# If this is an X11 color name, we just hope there is a close SVG
# color name. We could use QColor's static method
# 'setAllowX11ColorNames()', but this is global and only available
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/bracket_matcher.py new/qtconsole-5.0.1/qtconsole/bracket_matcher.py
--- old/qtconsole-4.7.7/qtconsole/bracket_matcher.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/bracket_matcher.py 2020-11-21 05:27:38.000000000 +0100
@@ -23,7 +23,7 @@
text edit widget.
"""
assert isinstance(text_edit, (QtWidgets.QTextEdit, QtWidgets.QPlainTextEdit))
- super(BracketMatcher, self).__init__()
+ super().__init__()
# The format to apply to matching brackets.
self.format = QtGui.QTextCharFormat()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/call_tip_widget.py new/qtconsole-5.0.1/qtconsole/call_tip_widget.py
--- old/qtconsole-4.7.7/qtconsole/call_tip_widget.py 2020-08-17 19:19:15.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/call_tip_widget.py 2020-11-21 05:27:38.000000000 +0100
@@ -19,7 +19,7 @@
text edit widget.
"""
assert isinstance(text_edit, (QtWidgets.QTextEdit, QtWidgets.QPlainTextEdit))
- super(CallTipWidget, self).__init__(None, QtCore.Qt.ToolTip)
+ super().__init__(None, QtCore.Qt.ToolTip)
self._hide_timer = QtCore.QBasicTimer()
self._text_edit = text_edit
@@ -62,7 +62,7 @@
elif etype == QtCore.QEvent.Leave:
self._leave_event_hide()
- return super(CallTipWidget, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
def timerEvent(self, event):
""" Reimplemented to hide the widget when the hide timer fires.
@@ -78,13 +78,13 @@
def enterEvent(self, event):
""" Reimplemented to cancel the hide timer.
"""
- super(CallTipWidget, self).enterEvent(event)
+ super().enterEvent(event)
self._hide_timer.stop()
def hideEvent(self, event):
""" Reimplemented to disconnect signal handlers and event filter.
"""
- super(CallTipWidget, self).hideEvent(event)
+ super().hideEvent(event)
# This fixes issue jupyter/qtconsole#383
try:
self._text_edit.cursorPositionChanged.disconnect(
@@ -96,7 +96,7 @@
def leaveEvent(self, event):
""" Reimplemented to start the hide timer.
"""
- super(CallTipWidget, self).leaveEvent(event)
+ super().leaveEvent(event)
self._leave_event_hide()
def paintEvent(self, event):
@@ -108,17 +108,17 @@
painter.drawPrimitive(QtWidgets.QStyle.PE_PanelTipLabel, option)
painter.end()
- super(CallTipWidget, self).paintEvent(event)
+ super().paintEvent(event)
def setFont(self, font):
""" Reimplemented to allow use of this method as a slot.
"""
- super(CallTipWidget, self).setFont(font)
+ super().setFont(font)
def showEvent(self, event):
""" Reimplemented to connect signal handlers and event filter.
"""
- super(CallTipWidget, self).showEvent(event)
+ super().showEvent(event)
self._text_edit.cursorPositionChanged.connect(
self._cursor_position_changed)
self._text_edit.installEventFilter(self)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/comms.py new/qtconsole-5.0.1/qtconsole/comms.py
--- old/qtconsole-4.7.7/qtconsole/comms.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/comms.py 2020-11-21 05:27:38.000000000 +0100
@@ -12,7 +12,6 @@
from traitlets.config import LoggingConfigurable
from ipython_genutils.importstring import import_item
-from ipython_genutils.py3compat import string_types
import uuid
@@ -27,7 +26,7 @@
"""
def __init__(self, kernel_client, *args, **kwargs):
- super(CommManager, self).__init__(*args, **kwargs)
+ super().__init__(*args, **kwargs)
self.comms = {}
self.targets = {}
if kernel_client:
@@ -76,7 +75,7 @@
f can be a Python callable or an import string for one.
"""
- if isinstance(f, string_types):
+ if isinstance(f, str):
f = import_item(f)
self.targets[target_name] = f
@@ -192,7 +191,7 @@
"""
Create a new comm. Must call open to use.
"""
- super(Comm, self).__init__(target_name=target_name)
+ super().__init__(target_name=target_name)
self.target_name = target_name
self.kernel_client = kernel_client
if comm_id is None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/completion_html.py new/qtconsole-5.0.1/qtconsole/completion_html.py
--- old/qtconsole-4.7.7/qtconsole/completion_html.py 2020-09-03 05:53:18.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/completion_html.py 2020-11-21 05:27:38.000000000 +0100
@@ -1,5 +1,4 @@
"""A navigable completer for the qtconsole"""
-# coding : utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
@@ -16,30 +15,30 @@
if not item_matrix :
return ''
html_cols = []
- tds = lambda text : u'<td>'+text+u' </td>'
- trs = lambda text : u'<tr>'+text+u'</tr>'
+ tds = lambda text : '<td>'+text+' </td>'
+ trs = lambda text : '<tr>'+text+'</tr>'
tds_items = [list(map(tds, row)) for row in item_matrix]
if select :
row, col = select
- tds_items[row][col] = u'<td class="inverted">'\
+ tds_items[row][col] = '<td class="inverted">'\
+item_matrix[row][col]\
- +u' </td>'
+ +' </td>'
#select the right item
- html_cols = map(trs, (u''.join(row) for row in tds_items))
+ html_cols = map(trs, (''.join(row) for row in tds_items))
head = ''
foot = ''
if header :
- head = (u'<tr>'\
- +''.join((u'<td>'+header+u'</td>')*len(item_matrix[0]))\
+ head = ('<tr>'\
+ +''.join(('<td>'+header+'</td>')*len(item_matrix[0]))\
+'</tr>')
if footer :
- foot = (u'<tr>'\
- +''.join((u'<td>'+footer+u'</td>')*len(item_matrix[0]))\
+ foot = ('<tr>'\
+ +''.join(('<td>'+footer+'</td>')*len(item_matrix[0]))\
+'</tr>')
- html = (u'<table class="completion" style="white-space:pre"'
+ html = ('<table class="completion" style="white-space:pre"'
'cellspacing=0>' +
- head + (u''.join(html_cols)) + foot + u'</table>')
+ head + (''.join(html_cols)) + foot + '</table>')
return html
class SlidingInterval(object):
@@ -130,7 +129,7 @@
text edit widget.
"""
assert isinstance(console_widget._control, (QtWidgets.QTextEdit, QtWidgets.QPlainTextEdit))
- super(CompletionHtml, self).__init__()
+ super().__init__()
self._text_edit = console_widget._control
self._console_widget = console_widget
@@ -192,7 +191,7 @@
elif etype == QtCore.QEvent.FocusOut:
self.cancel_completion()
- return super(CompletionHtml, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
#--------------------------------------------------------------------------
# 'CompletionHtml' interface
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/completion_plain.py new/qtconsole-5.0.1/qtconsole/completion_plain.py
--- old/qtconsole-4.7.7/qtconsole/completion_plain.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/completion_plain.py 2020-11-21 05:27:38.000000000 +0100
@@ -19,7 +19,7 @@
text edit widget.
"""
assert isinstance(console_widget._control, (QtWidgets.QTextEdit, QtWidgets.QPlainTextEdit))
- super(CompletionPlain, self).__init__()
+ super().__init__()
self._text_edit = console_widget._control
self._console_widget = console_widget
@@ -36,7 +36,7 @@
if etype in( QtCore.QEvent.KeyPress, QtCore.QEvent.FocusOut ):
self.cancel_completion()
- return super(CompletionPlain, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
#--------------------------------------------------------------------------
# 'CompletionPlain' interface
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/completion_widget.py new/qtconsole-5.0.1/qtconsole/completion_widget.py
--- old/qtconsole-4.7.7/qtconsole/completion_widget.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/completion_widget.py 2020-11-21 05:27:38.000000000 +0100
@@ -20,7 +20,7 @@
"""
text_edit = console_widget._control
assert isinstance(text_edit, (QtWidgets.QTextEdit, QtWidgets.QPlainTextEdit))
- super(CompletionWidget, self).__init__(parent=console_widget)
+ super().__init__(parent=console_widget)
self._text_edit = text_edit
self.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
@@ -58,7 +58,7 @@
else:
self.cancel_completion()
- return super(CompletionWidget, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
def keyPressEvent(self, event):
key = event.key()
@@ -70,7 +70,7 @@
elif key in (QtCore.Qt.Key_Up, QtCore.Qt.Key_Down,
QtCore.Qt.Key_PageUp, QtCore.Qt.Key_PageDown,
QtCore.Qt.Key_Home, QtCore.Qt.Key_End):
- return super(CompletionWidget, self).keyPressEvent(event)
+ return super().keyPressEvent(event)
else:
QtWidgets.QApplication.sendEvent(self._text_edit, event)
@@ -81,7 +81,7 @@
def hideEvent(self, event):
""" Reimplemented to disconnect signal handlers and event filter.
"""
- super(CompletionWidget, self).hideEvent(event)
+ super().hideEvent(event)
try:
self._text_edit.cursorPositionChanged.disconnect(self._update_current)
except TypeError:
@@ -91,7 +91,7 @@
def showEvent(self, event):
""" Reimplemented to connect signal handlers and event filter.
"""
- super(CompletionWidget, self).showEvent(event)
+ super().showEvent(event)
self._text_edit.cursorPositionChanged.connect(self._update_current)
self.installEventFilter(self)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/console_widget.py new/qtconsole-5.0.1/qtconsole/console_widget.py
--- old/qtconsole-4.7.7/qtconsole/console_widget.py 2020-09-03 05:53:18.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/console_widget.py 2020-11-21 05:27:38.000000000 +0100
@@ -218,7 +218,7 @@
parent : QWidget, optional [default None]
The parent for this widget.
"""
- super(ConsoleWidget, self).__init__(**kw)
+ super().__init__(**kw)
if parent:
self.setParent(parent)
@@ -467,7 +467,7 @@
anchor = self._control.anchorAt(event.pos())
QtWidgets.QToolTip.showText(event.globalPos(), anchor)
- return super(ConsoleWidget, self).eventFilter(obj, event)
+ return super().eventFilter(obj, event)
#---------------------------------------------------------------------------
# 'QWidget' interface
@@ -578,11 +578,11 @@
def _handle_is_complete_reply(self, msg):
if msg['parent_header'].get('msg_id', 0) != self._is_complete_msg_id:
return
- status = msg['content'].get('status', u'complete')
- indent = msg['content'].get('indent', u'')
+ status = msg['content'].get('status', 'complete')
+ indent = msg['content'].get('indent', '')
self._trigger_is_complete_callback(status != 'incomplete', indent)
- def _trigger_is_complete_callback(self, complete=False, indent=u''):
+ def _trigger_is_complete_callback(self, complete=False, indent=''):
if self._is_complete_msg_id is not None:
self._is_complete_msg_id = None
self._is_complete_callback(complete, indent)
@@ -777,6 +777,18 @@
font = property(_get_font, _set_font)
+ def _set_completion_widget(self, gui_completion):
+ """ Set gui completion widget.
+ """
+ if gui_completion == 'ncurses':
+ self._completion_widget = CompletionHtml(self)
+ elif gui_completion == 'droplist':
+ self._completion_widget = CompletionWidget(self)
+ elif gui_completion == 'plain':
+ self._completion_widget = CompletionPlain(self)
+
+ self.gui_completion = gui_completion
+
def open_anchor(self, anchor):
""" Open selected anchor in the default webbrowser
"""
@@ -1952,7 +1964,7 @@
def _indent(self, dedent=True):
""" Indent/Dedent current line or current text selection.
"""
- num_newlines = self._get_cursor().selectedText().count(u"\u2029")
+ num_newlines = self._get_cursor().selectedText().count("\u2029")
save_cur = self._get_cursor()
cur = self._get_cursor()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/frontend_widget.py new/qtconsole-5.0.1/qtconsole/frontend_widget.py
--- old/qtconsole-4.7.7/qtconsole/frontend_widget.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/frontend_widget.py 2020-11-21 05:27:38.000000000 +0100
@@ -3,15 +3,12 @@
# Copyright (c) Jupyter Development Team
# Distributed under the terms of the Modified BSD License.
-from __future__ import print_function
-
from collections import namedtuple
import sys
import uuid
import re
from qtpy import QtCore, QtGui, QtWidgets
-from ipython_genutils import py3compat
from ipython_genutils.importstring import import_item
from qtconsole.base_frontend_mixin import BaseFrontendMixin
@@ -27,7 +24,7 @@
"""
def __init__(self, frontend, lexer=None):
- super(FrontendHighlighter, self).__init__(frontend._control.document(), lexer=lexer)
+ super().__init__(frontend._control.document(), lexer=lexer)
self._current_offset = 0
self._frontend = frontend
self.highlighting_on = False
@@ -78,21 +75,21 @@
diff = len(string) - len(without_prompt)
if diff > 0:
self._current_offset = diff
- super(FrontendHighlighter, self).highlightBlock(without_prompt)
+ super().highlightBlock(without_prompt)
def rehighlightBlock(self, block):
""" Reimplemented to temporarily enable highlighting if disabled.
"""
old = self.highlighting_on
self.highlighting_on = True
- super(FrontendHighlighter, self).rehighlightBlock(block)
+ super().rehighlightBlock(block)
self.highlighting_on = old
def setFormat(self, start, count, format):
""" Reimplemented to highlight selectively.
"""
start += self._current_offset
- super(FrontendHighlighter, self).setFormat(start, count, format)
+ super().setFormat(start, count, format)
class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):
@@ -134,10 +131,7 @@
self.lexer = lexer_class()
def _lexer_class_default(self):
- if py3compat.PY3:
- return 'pygments.lexers.Python3Lexer'
- else:
- return 'pygments.lexers.PythonLexer'
+ return 'pygments.lexers.Python3Lexer'
lexer = Any()
def _lexer_default(self):
@@ -167,7 +161,7 @@
# -------------------------------------------------------------------------
def __init__(self, local_kernel=_local_kernel, *args, **kw):
- super(FrontendWidget, self).__init__(*args, **kw)
+ super().__init__(*args, **kw)
# FrontendWidget protected variables.
self._bracket_matcher = BracketMatcher(self._control)
self._call_tip_widget = CallTipWidget(self._control)
@@ -290,7 +284,7 @@
def _context_menu_make(self, pos):
""" Reimplemented to add an action for raw copy.
"""
- menu = super(FrontendWidget, self)._context_menu_make(pos)
+ menu = super()._context_menu_make(pos)
for before_action in menu.actions():
if before_action.shortcut().matches(QtGui.QKeySequence.Paste) == \
QtGui.QKeySequence.ExactMatch:
@@ -313,7 +307,11 @@
if self._control_key_down(event.modifiers(), include_command=False):
if key == QtCore.Qt.Key_C and self._executing:
- self.request_interrupt_kernel()
+ # If text is selected, the user probably wants to copy it.
+ if self.can_copy() and event.matches(QtGui.QKeySequence.Copy):
+ self.copy()
+ else:
+ self.request_interrupt_kernel()
return True
elif key == QtCore.Qt.Key_Period:
@@ -336,7 +334,7 @@
cursor.removeSelectedText()
return True
- return super(FrontendWidget, self)._event_filter_console_keypress(event)
+ return super()._event_filter_console_keypress(event)
#---------------------------------------------------------------------------
# 'BaseFrontendMixin' abstract interface
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/history_console_widget.py new/qtconsole-5.0.1/qtconsole/history_console_widget.py
--- old/qtconsole-4.7.7/qtconsole/history_console_widget.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/history_console_widget.py 2020-11-21 05:27:38.000000000 +0100
@@ -3,7 +3,6 @@
from qtpy import QtGui
-from ipython_genutils.py3compat import unicode_type
from traitlets import Bool
from .console_widget import ConsoleWidget
@@ -25,7 +24,7 @@
#---------------------------------------------------------------------------
def __init__(self, *args, **kw):
- super(HistoryConsoleWidget, self).__init__(*args, **kw)
+ super().__init__(*args, **kw)
# HistoryConsoleWidget protected variables.
self._history = []
@@ -40,7 +39,7 @@
""" Reimplemented to the store history. """
history = self.input_buffer if source is None else source
- super(HistoryConsoleWidget, self).do_execute(source, complete, indent)
+ super().do_execute(source, complete, indent)
if complete:
# Save the command unless it was an empty string or was identical
@@ -242,7 +241,7 @@
if index in self._history_edits:
return self._history_edits[index]
elif index == len(self._history):
- return unicode_type()
+ return str()
return self._history[index]
def _set_history(self, history):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/inprocess.py new/qtconsole-5.0.1/qtconsole/inprocess.py
--- old/qtconsole-4.7.7/qtconsole/inprocess.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/inprocess.py 2020-11-21 05:27:38.000000000 +0100
@@ -27,13 +27,13 @@
def start(self):
""" Reimplemented to emit signal.
"""
- super(QtInProcessChannel, self).start()
+ super().start()
self.started.emit()
def stop(self):
""" Reimplemented to emit signal.
"""
- super(QtInProcessChannel, self).stop()
+ super().stop()
self.stopped.emit()
def call_handlers_later(self, *args, **kwds):
@@ -53,7 +53,7 @@
def flush(self, timeout=1.0):
""" Reimplemented to ensure that signals are dispatched immediately.
"""
- super(QtInProcessChannel, self).flush()
+ super().flush()
self.process_events()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/jupyter_widget.py new/qtconsole-5.0.1/qtconsole/jupyter_widget.py
--- old/qtconsole-4.7.7/qtconsole/jupyter_widget.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/jupyter_widget.py 2020-11-21 05:27:38.000000000 +0100
@@ -115,7 +115,7 @@
#---------------------------------------------------------------------------
def __init__(self, *args, **kw):
- super(JupyterWidget, self).__init__(*args, **kw)
+ super().__init__(*args, **kw)
# JupyterWidget protected variables.
self._payload_handlers = {
@@ -191,7 +191,7 @@
self._show_interpreter_prompt(number)
self._request_info['execute'].pop(msg_id)
else:
- super(JupyterWidget, self)._handle_execute_reply(msg)
+ super()._handle_execute_reply(msg)
def _handle_history_reply(self, msg):
""" Handle history tail replies, which are only supported
@@ -218,7 +218,7 @@
history_items = content['history']
self.log.debug("Received history reply with %i entries", len(history_items))
items = []
- last_cell = u""
+ last_cell = ""
for _, _, cell in history_items:
cell = cell.rstrip()
if cell != last_cell:
@@ -292,7 +292,7 @@
text = data['text/plain']
self._append_plain_text(text, True)
# This newline seems to be needed for text and html output.
- self._append_plain_text(u'\n', True)
+ self._append_plain_text('\n', True)
def _handle_kernel_info_reply(self, rep):
"""Handle kernel info replies."""
@@ -317,7 +317,7 @@
if self._starting:
# finish handling started channels
self._starting = False
- super(JupyterWidget, self)._started_channels()
+ super()._started_channels()
def _started_channels(self):
"""Make a history request"""
@@ -612,4 +612,4 @@
def __init__(self, *a, **kw):
warn("IPythonWidget is deprecated; use JupyterWidget",
DeprecationWarning)
- super(IPythonWidget, self).__init__(*a, **kw)
+ super().__init__(*a, **kw)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/kernel_mixins.py new/qtconsole-5.0.1/qtconsole/kernel_mixins.py
--- old/qtconsole-4.7.7/qtconsole/kernel_mixins.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/kernel_mixins.py 2020-11-21 05:27:38.000000000 +0100
@@ -37,20 +37,20 @@
#---------------------------------------------------------------------------
def __init__(self, *args, **kwargs):
- super(QtKernelClientMixin, self).__init__(*args, **kwargs)
+ super().__init__(*args, **kwargs)
self.comm_manager = None
#------ Channel management -------------------------------------------------
def start_channels(self, *args, **kw):
""" Reimplemented to emit signal.
"""
- super(QtKernelClientMixin, self).start_channels(*args, **kw)
+ super().start_channels(*args, **kw)
self.started_channels.emit()
self.comm_manager = CommManager(parent=self, kernel_client=self)
def stop_channels(self):
""" Reimplemented to emit signal.
"""
- super(QtKernelClientMixin, self).stop_channels()
+ super().stop_channels()
self.stopped_channels.emit()
self.comm_manager = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/kill_ring.py new/qtconsole-5.0.1/qtconsole/kill_ring.py
--- old/qtconsole-4.7.7/qtconsole/kill_ring.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/kill_ring.py 2020-11-21 05:27:38.000000000 +0100
@@ -63,7 +63,7 @@
""" Create a kill ring attached to the specified Qt text edit.
"""
assert isinstance(text_edit, (QtWidgets.QTextEdit, QtWidgets.QPlainTextEdit))
- super(QtKillRing, self).__init__()
+ super().__init__()
self._ring = KillRing()
self._prev_yank = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/mainwindow.py new/qtconsole-5.0.1/qtconsole/mainwindow.py
--- old/qtconsole-4.7.7/qtconsole/mainwindow.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/mainwindow.py 2020-11-21 05:27:38.000000000 +0100
@@ -53,7 +53,7 @@
JupyterWidget instance, attached to the same kernel.
"""
- super(MainWindow, self).__init__()
+ super().__init__()
self._kernel_counter = 0
self._external_kernel_counter = 0
self._app = app
@@ -563,6 +563,44 @@
triggered=self.clear_active_frontend)
self.add_menu_action(self.view_menu, self.clear_action)
+ self.completion_menu = self.view_menu.addMenu("&Completion type")
+
+ completion_group = QtWidgets.QActionGroup(self)
+ active_frontend_completion = self.active_frontend.gui_completion
+ ncurses_completion_action = QtWidgets.QAction(
+ "&ncurses",
+ self,
+ triggered=lambda: self.set_completion_widget_active_frontend(
+ 'ncurses'))
+ ncurses_completion_action.setCheckable(True)
+ ncurses_completion_action.setChecked(
+ active_frontend_completion == 'ncurses')
+ droplist_completion_action = QtWidgets.QAction(
+ "&droplist",
+ self,
+ triggered=lambda: self.set_completion_widget_active_frontend(
+ 'droplist'))
+ droplist_completion_action.setCheckable(True)
+ droplist_completion_action.setChecked(
+ active_frontend_completion == 'droplist')
+ plain_commpletion_action = QtWidgets.QAction(
+ "&plain",
+ self,
+ triggered=lambda: self.set_completion_widget_active_frontend(
+ 'plain'))
+ plain_commpletion_action.setCheckable(True)
+ plain_commpletion_action.setChecked(
+ active_frontend_completion == 'plain')
+
+ completion_group.addAction(ncurses_completion_action)
+ completion_group.addAction(droplist_completion_action)
+ completion_group.addAction(plain_commpletion_action)
+
+ self.completion_menu.addAction(ncurses_completion_action)
+ self.completion_menu.addAction(droplist_completion_action)
+ self.completion_menu.addAction(plain_commpletion_action)
+ self.completion_menu.setDefaultAction(ncurses_completion_action)
+
self.pager_menu = self.view_menu.addMenu("&Pager")
hsplit_action = QtWidgets.QAction(".. &Horizontal Split",
@@ -749,6 +787,9 @@
def set_paging_active_frontend(self, paging):
self.active_frontend._set_paging(paging)
+ def set_completion_widget_active_frontend(self, gui_completion):
+ self.active_frontend._set_completion_widget(gui_completion)
+
def get_available_syntax_styles(self):
"""Get a list with the syntax styles available."""
styles = list(get_all_styles())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/manager.py new/qtconsole-5.0.1/qtconsole/manager.py
--- old/qtconsole-4.7.7/qtconsole/manager.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/manager.py 2020-11-21 05:27:38.000000000 +0100
@@ -24,7 +24,7 @@
self._timer.stop()
def poll(self):
- super(QtKernelRestarter, self).poll()
+ super().poll()
class QtKernelManager(KernelManager, QtKernelManagerMixin):
@@ -33,6 +33,10 @@
client_class = DottedObjectName('qtconsole.client.QtKernelClient')
autorestart = Bool(True, config=True)
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._is_restarting = False
+
def start_restarter(self):
if self.autorestart and self.has_kernel:
if self._restarter is None:
@@ -41,7 +45,7 @@
parent=self,
log=self.log,
)
- self._restarter.add_callback(self._handle_kernel_restarted)
+ self._is_restarting = True
self._restarter.start()
def stop_restarter(self):
@@ -49,5 +53,8 @@
if self._restarter is not None:
self._restarter.stop()
- def _handle_kernel_restarted(self):
- self.kernel_restarted.emit()
+ def post_start_kernel(self, **kw):
+ super().post_start_kernel(**kw)
+ if self._is_restarting:
+ self.kernel_restarted.emit()
+ self._is_restarting = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/pygments_highlighter.py new/qtconsole-5.0.1/qtconsole/pygments_highlighter.py
--- old/qtconsole-4.7.7/qtconsole/pygments_highlighter.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/pygments_highlighter.py 2020-11-21 05:27:38.000000000 +0100
@@ -4,10 +4,9 @@
from qtpy import QtGui
from qtconsole.qstringhelpers import qstring_length
-from ipython_genutils.py3compat import PY3, string_types
from pygments.formatters.html import HtmlFormatter
from pygments.lexer import RegexLexer, _TokenType, Text, Error
-from pygments.lexers import PythonLexer, Python3Lexer
+from pygments.lexers import Python3Lexer
from pygments.styles import get_style_by_name
@@ -65,7 +64,7 @@
pos += 1
statestack = ['root']
statetokens = tokendefs['root']
- yield pos, Text, u'\n'
+ yield pos, Text, '\n'
continue
yield pos, Error, text[pos]
pos += 1
@@ -104,7 +103,7 @@
#---------------------------------------------------------------------------
def __init__(self, parent, lexer=None):
- super(PygmentsHighlighter, self).__init__(parent)
+ super().__init__(parent)
self._document = self.document()
self._formatter = HtmlFormatter(nowrap=True)
@@ -112,10 +111,7 @@
if lexer is not None:
self._lexer = lexer
else:
- if PY3:
- self._lexer = Python3Lexer()
- else:
- self._lexer = PythonLexer()
+ self._lexer = Python3Lexer()
def highlightBlock(self, string):
""" Highlight a block of text.
@@ -147,7 +143,7 @@
def set_style(self, style):
""" Sets the style to the specified Pygments style.
"""
- if isinstance(style, string_types):
+ if isinstance(style, str):
style = get_style_by_name(style)
self._style = style
self._clear_caches()
@@ -192,7 +188,7 @@
def _get_format_from_document(self, token, document):
""" Returns a QTextCharFormat for token by
"""
- code, html = next(self._formatter._format_lines([(token, u'dummy')]))
+ code, html = next(self._formatter._format_lines([(token, 'dummy')]))
self._document.setHtml(html)
return QtGui.QTextCursor(self._document).charFormat()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/qstringhelpers.py new/qtconsole-5.0.1/qtconsole/qstringhelpers.py
--- old/qtconsole-4.7.7/qtconsole/qstringhelpers.py 2019-08-22 10:43:15.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/qstringhelpers.py 2020-11-21 05:27:38.000000000 +0100
@@ -1,24 +1,14 @@
-# -*- coding: utf-8 -*-
-#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""QString compatibility."""
-import sys
-
-
-PY2 = sys.version[0] == '2'
-
def qstring_length(text):
"""
Tries to compute what the length of an utf16-encoded QString would be.
"""
- if PY2:
- # I don't know what this is encoded in, so there is nothing I can do.
- return len(text)
utf16_text = text.encode('utf16')
length = len(utf16_text) // 2
# Remove Byte order mark.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/qtconsoleapp.py new/qtconsole-5.0.1/qtconsole/qtconsoleapp.py
--- old/qtconsole-4.7.7/qtconsole/qtconsoleapp.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/qtconsoleapp.py 2020-11-21 05:27:38.000000000 +0100
@@ -40,8 +40,8 @@
try:
import ctypes, traceback
MB_ICONERROR = 0x00000010
- title = u'Error starting QtConsole'
- msg = u''.join(traceback.format_exception(exctype, value, tb))
+ title = 'Error starting QtConsole'
+ msg = ''.join(traceback.format_exception(exctype, value, tb))
ctypes.windll.user32.MessageBoxW(0, msg, title, MB_ICONERROR)
finally:
# Also call the old exception hook to let it do
@@ -174,7 +174,7 @@
widget_factory = Any(RichJupyterWidget)
def parse_command_line(self, argv=None):
- super(JupyterQtConsoleApp, self).parse_command_line(argv)
+ super().parse_command_line(argv)
self.build_kernel_argv(self.extra_args)
@@ -412,7 +412,7 @@
def initialize(self, argv=None):
self._init_asyncio_patch()
self.init_qt_app()
- super(JupyterQtConsoleApp, self).initialize(argv)
+ super().initialize(argv)
if self._dispatching:
return
# handle deprecated renames
@@ -429,7 +429,7 @@
self.init_signal()
def start(self):
- super(JupyterQtConsoleApp, self).start()
+ super().start()
# draw the window
if self.maximize:
@@ -446,7 +446,7 @@
def __init__(self, *a, **kw):
warn("IPythonQtConsoleApp is deprecated; use JupyterQtConsoleApp",
DeprecationWarning)
- super(IPythonQtConsoleApp, self).__init__(*a, **kw)
+ super().__init__(*a, **kw)
# -----------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/rich_jupyter_widget.py new/qtconsole-5.0.1/qtconsole/rich_jupyter_widget.py
--- old/qtconsole-4.7.7/qtconsole/rich_jupyter_widget.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/rich_jupyter_widget.py 2020-11-21 05:27:38.000000000 +0100
@@ -50,7 +50,7 @@
""" Create a RichJupyterWidget.
"""
kw['kind'] = 'rich'
- super(RichJupyterWidget, self).__init__(*args, **kw)
+ super().__init__(*args, **kw)
# Configure the ConsoleWidget HTML exporter for our formats.
self._html_exporter.image_tag = self._get_image_tag
@@ -75,7 +75,7 @@
to the export running.
"""
self._svg_warning_displayed = False
- super(RichJupyterWidget, self).export_html()
+ super().export_html()
#---------------------------------------------------------------------------
@@ -101,7 +101,7 @@
menu.addAction('Save SVG As...',
lambda: save_svg(svg, self._control))
else:
- menu = super(RichJupyterWidget, self)._context_menu_make(pos)
+ menu = super()._context_menu_make(pos)
return menu
#---------------------------------------------------------------------------
@@ -146,11 +146,11 @@
try:
self._append_latex(data['text/latex'], True)
except LatexError:
- return super(RichJupyterWidget, self)._handle_display_data(msg)
+ return super()._handle_display_data(msg)
self._append_html(self.output_sep2, True)
else:
# Default back to the plain text representation.
- return super(RichJupyterWidget, self)._handle_execute_result(msg)
+ return super()._handle_execute_result(msg)
def _handle_display_data(self, msg):
"""Overridden to handle rich data types, like SVG."""
@@ -177,10 +177,10 @@
try:
self._append_latex(data['text/latex'], True)
except LatexError:
- return super(RichJupyterWidget, self)._handle_display_data(msg)
+ return super()._handle_display_data(msg)
else:
# Default back to the plain text representation.
- return super(RichJupyterWidget, self)._handle_display_data(msg)
+ return super()._handle_display_data(msg)
#---------------------------------------------------------------------------
# 'RichJupyterWidget' protected interface
@@ -415,4 +415,4 @@
def __init__(self, *a, **kw):
warn("RichIPythonWidget is deprecated, use RichJupyterWidget",
DeprecationWarning)
- super(RichIPythonWidget, self).__init__(*a, **kw)
+ super().__init__(*a, **kw)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/rich_text.py new/qtconsole-5.0.1/qtconsole/rich_text.py
--- old/qtconsole-4.7.7/qtconsole/rich_text.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/rich_text.py 2020-11-22 00:05:25.000000000 +0100
@@ -9,8 +9,6 @@
from qtpy import QtWidgets
-from ipython_genutils import py3compat
-
#-----------------------------------------------------------------------------
# Constants
#-----------------------------------------------------------------------------
@@ -66,7 +64,7 @@
if dialog.exec_():
self.filename = dialog.selectedFiles()[0]
choice = dialog.selectedNameFilter()
- html = py3compat.cast_unicode(self.control.document().toHtml())
+ html = self.control.document().toHtml()
# Configure the exporter.
if choice.startswith('XHTML'):
@@ -177,7 +175,7 @@
# valid XML.
offset = html.find("<html>")
assert offset > -1, 'Invalid HTML string: no <html> tag.'
- html = (u'<html xmlns="http://www.w3.org/1999/xhtml">\n'+
+ html = ('<html xmlns="http://www.w3.org/1999/xhtml">\n'+
html[offset+6:])
html = fix_html(html)
@@ -206,7 +204,7 @@
format : "png"|"svg", optional [default "png"]
Format for returned or referenced images.
"""
- return u''
+ return ''
def fix_html(html):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/svg.py new/qtconsole-5.0.1/qtconsole/svg.py
--- old/qtconsole-4.7.7/qtconsole/svg.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/svg.py 2020-11-21 05:27:38.000000000 +0100
@@ -4,8 +4,6 @@
# System library imports.
from qtpy import QtCore, QtGui, QtSvg, QtWidgets
-# Our own imports
-from ipython_genutils.py3compat import unicode_type
def save_svg(string, parent=None):
""" Prompts the user to save an SVG document to disk.
@@ -23,7 +21,7 @@
The name of the file to which the document was saved, or None if the save
was cancelled.
"""
- if isinstance(string, unicode_type):
+ if isinstance(string, str):
string = string.encode('utf-8')
dialog = QtWidgets.QFileDialog(parent, 'Save SVG Document')
@@ -48,7 +46,7 @@
string : basestring
A Python string containing a SVG document.
"""
- if isinstance(string, unicode_type):
+ if isinstance(string, str):
string = string.encode('utf-8')
mime_data = QtCore.QMimeData()
@@ -76,7 +74,7 @@
-------
A QImage of format QImage.Format_ARGB32.
"""
- if isinstance(string, unicode_type):
+ if isinstance(string, str):
string = string.encode('utf-8')
renderer = QtSvg.QSvgRenderer(QtCore.QByteArray(string))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/tests/test_00_console_widget.py new/qtconsole-5.0.1/qtconsole/tests/test_00_console_widget.py
--- old/qtconsole-4.7.7/qtconsole/tests/test_00_console_widget.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/tests/test_00_console_widget.py 2020-11-21 23:57:26.000000000 +0100
@@ -1,5 +1,5 @@
-import sys
import unittest
+import sys
from flaky import flaky
import pytest
@@ -10,10 +10,7 @@
from qtconsole.qtconsoleapp import JupyterQtConsoleApp
from . import no_display
-if sys.version[0] == '2': # Python 2
- from IPython.core.inputsplitter import InputSplitter as TransformerManager
-else:
- from IPython.core.inputtransformer2 import TransformerManager
+from IPython.core.inputtransformer2 import TransformerManager
SHELL_TIMEOUT = 20000
@@ -155,10 +152,7 @@
with qtbot.waitSignal(shell.executed):
shell.execute("import time")
- if sys.version[0] == '2':
- input_function = 'raw_input'
- else:
- input_function = 'input'
+ input_function = 'input'
shell.execute("print(" + input_function + "('name: ')); time.sleep(3)")
qtbot.waitUntil(lambda: control.toPlainText().split()[-1] == 'name:')
@@ -242,9 +236,9 @@
'foo\b\nbar\n',
'foo\b\nbar\r\n',
'abc\rxyz\b\b=']
- expected_outputs = [u'x=z\u2029',
- u'foo\u2029bar\u2029',
- u'foo\u2029bar\u2029',
+ expected_outputs = ['x=z\u2029',
+ 'foo\u2029bar\u2029',
+ 'foo\u2029bar\u2029',
'x=z']
for i, text in enumerate(test_inputs):
w._insert_plain_text(cursor, text)
@@ -265,14 +259,14 @@
w._insert_html(cursor, '<a href="http://python.org">written in</a>')
obj = w._control
tip = QtWidgets.QToolTip
- self.assertEqual(tip.text(), u'')
+ self.assertEqual(tip.text(), '')
# should be somewhere else
elsewhereEvent = QMouseEvent(MouseMove, QtCore.QPoint(50,50),
noButton, noButtons, noModifiers)
w.eventFilter(obj, elsewhereEvent)
self.assertEqual(tip.isVisible(), False)
- self.assertEqual(tip.text(), u'')
+ self.assertEqual(tip.text(), '')
# should be over text
overTextEvent = QMouseEvent(MouseMove, QtCore.QPoint(1,5),
noButton, noButtons, noModifiers)
@@ -361,6 +355,7 @@
copied = app.clipboard().text()
self.assertEqual(copied, 'Header\nprompt>if:\n> pass')
+ @pytest.mark.skipif(sys.platform == 'darwin', reason="Fails on macOS")
def test_keypresses(self):
"""Test the event handling code for keypresses."""
w = ConsoleWidget()
@@ -549,7 +544,7 @@
w._handle_is_complete_reply(
dict(parent_header=dict(msg_id=msg_id),
content=dict(status="incomplete", indent="!!!")))
- self.assert_text_equal(cursor, u"thing\u2029> !!!")
+ self.assert_text_equal(cursor, "thing\u2029> !!!")
self.assertEqual(calls, [])
# test complete statement (_execute called)
@@ -562,16 +557,16 @@
content=dict(status="complete", indent="###")))
self.assertEqual(calls, [("else", False)])
calls = []
- self.assert_text_equal(cursor, u"thing\u2029> !!!else\u2029")
+ self.assert_text_equal(cursor, "thing\u2029> !!!else\u2029")
# test missing answer from is_complete
msg_id = object()
w.execute("done", interactive=True)
self.assertEqual(calls, ["done"])
calls = []
- self.assert_text_equal(cursor, u"thing\u2029> !!!else\u2029")
+ self.assert_text_equal(cursor, "thing\u2029> !!!else\u2029")
w._trigger_is_complete_callback()
- self.assert_text_equal(cursor, u"thing\u2029> !!!else\u2029\u2029> ")
+ self.assert_text_equal(cursor, "thing\u2029> !!!else\u2029\u2029> ")
# assert that late answer isn't destroying anything
w._handle_is_complete_reply(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/tests/test_comms.py new/qtconsole-5.0.1/qtconsole/tests/test_comms.py
--- old/qtconsole-4.7.7/qtconsole/tests/test_comms.py 2019-11-17 19:57:23.000000000 +0100
+++ new/qtconsole-5.0.1/qtconsole/tests/test_comms.py 2020-11-21 05:27:38.000000000 +0100
@@ -1,16 +1,11 @@
import time
-import sys
import unittest
-from ipython_genutils.py3compat import PY3
from jupyter_client.blocking.channels import Empty
from qtconsole.manager import QtKernelManager
-PY2 = sys.version[0] == '2'
-if PY2:
- TimeoutError = RuntimeError
class Tests(unittest.TestCase):
@@ -146,17 +141,9 @@
# Received message has a header and parent header. The parent header has
# the info about the close message type in Python 3
- if PY3:
- assert msg['parent_header']['msg_type'] == 'comm_close'
- assert msg['msg_type'] == 'stream'
- assert msg['content']['text'] == 'close\n'
- else:
- # For some reason ipykernel notifies me that it is closing,
- # even though I closed the comm
- assert msg['header']['msg_type'] == 'comm_close'
- assert comm.comm_id == msg['content']['comm_id']
- msg = self._get_next_msg()
- assert msg['header']['msg_type'] == 'stream'
+ assert msg['parent_header']['msg_type'] == 'comm_close'
+ assert msg['msg_type'] == 'stream'
+ assert msg['content']['text'] == 'close\n'
if __name__ == "__main__":
unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/tests/test_completion_widget.py new/qtconsole-5.0.1/qtconsole/tests/test_completion_widget.py
--- old/qtconsole-4.7.7/qtconsole/tests/test_completion_widget.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/tests/test_completion_widget.py 2020-11-21 05:27:38.000000000 +0100
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
import os
import tempfile
import shutil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/tests/test_jupyter_widget.py new/qtconsole-5.0.1/qtconsole/tests/test_jupyter_widget.py
--- old/qtconsole-4.7.7/qtconsole/tests/test_jupyter_widget.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/tests/test_jupyter_widget.py 2020-11-21 23:57:26.000000000 +0100
@@ -1,8 +1,9 @@
import unittest
+import sys
import pytest
-
from qtpy import QtWidgets
+
from qtconsole.client import QtKernelClient
from qtconsole.jupyter_widget import JupyterWidget
from . import no_display
@@ -39,6 +40,8 @@
w.syntax_style = 'monokai'
self.assertEqual(w._ansi_processor.get_color(15).name(), '#ffffff')
+ @pytest.mark.skipif(not sys.platform.startswith('linux'),
+ reason="Works only on Linux")
def test_other_output(self):
""" Test displaying output from other clients.
"""
@@ -58,24 +61,24 @@
self.assertEqual(document.blockCount(), 6)
self.assertEqual(document.toPlainText(), (
- u'Header\n'
- u'\n'
- u'[other] In [1]: a = 1 + 1\n'
- u' ...: b = range(10)\n'
- u'\n'
- u'In [2]: '
+ 'Header\n'
+ '\n'
+ '[other] In [1]: a = 1 + 1\n'
+ ' ...: b = range(10)\n'
+ '\n'
+ 'In [2]: '
))
# Check proper syntax highlighting
self.assertEqual(document.toHtml(), (
- u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
- u'<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
- u'p, li { white-space: pre-wrap; }\n'
- u'</style></head><body style=" font-family:\'Monospace\'; font-size:9pt; font-weight:400; font-style:normal;">\n'
- u'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Header</p>\n'
- u'<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>\n'
- u'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">[other] In [</span><span style=" font-weight:600; color:#000080;">1</span><span style=" color:#000080;">]:</span> a = 1 + 1</p>\n'
- u'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0...:</span> b = range(10)</p>\n'
- u'<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>\n'
- u'<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">In [</span><span style=" font-weight:600; color:#000080;">2</span><span style=" color:#000080;">]:</span> </p></body></html>'
+ '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">\n'
+ '<html><head><meta name="qrichtext" content="1" /><style type="text/css">\n'
+ 'p, li { white-space: pre-wrap; }\n'
+ '</style></head><body style=" font-family:\'Monospace\'; font-size:9pt; font-weight:400; font-style:normal;">\n'
+ '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Header</p>\n'
+ '<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>\n'
+ '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">[other] In [</span><span style=" font-weight:600; color:#000080;">1</span><span style=" color:#000080;">]:</span> a = 1 + 1</p>\n'
+ '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0...:</span> b = range(10)</p>\n'
+ '<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>\n'
+ '<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000080;">In [</span><span style=" font-weight:600; color:#000080;">2</span><span style=" color:#000080;">]:</span> </p></body></html>'
))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole/util.py new/qtconsole-5.0.1/qtconsole/util.py
--- old/qtconsole-4.7.7/qtconsole/util.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole/util.py 2020-11-21 05:27:38.000000000 +0100
@@ -5,7 +5,6 @@
from qtpy import QtCore, QtGui
-from ipython_genutils.py3compat import iteritems
from traitlets import HasTraits, TraitType
#-----------------------------------------------------------------------------
@@ -25,7 +24,7 @@
def __new__(mcls, name, bases, classdict):
# FIXME: this duplicates the code from MetaHasTraits.
# I don't think a super() call will help me here.
- for k,v in iteritems(classdict):
+ for k,v in iter(classdict.items()):
if isinstance(v, TraitType):
v.name = k
elif inspect.isclass(v):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole.egg-info/PKG-INFO new/qtconsole-5.0.1/qtconsole.egg-info/PKG-INFO
--- old/qtconsole-4.7.7/qtconsole.egg-info/PKG-INFO 2020-09-03 06:02:43.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole.egg-info/PKG-INFO 2020-11-24 18:27:23.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: qtconsole
-Version: 4.7.7
+Version: 5.0.1
Summary: Jupyter Qt console
Home-page: http://jupyter.org
Author: Jupyter Development Team
@@ -9,7 +9,9 @@
License: BSD
Description: # Jupyter QtConsole
- [![Build Status](https://travis-ci.org/jupyter/qtconsole.svg?branch=master)](https:/…
+ ![Windows tests](https://github.com/jupyter/qtconsole/workflows/Windows%20tests/badge…
+ ![Macos tests](https://github.com/jupyter/qtconsole/workflows/Macos%20tests/badge.s…
+ ![Linux tests](https://github.com/jupyter/qtconsole/workflows/Linux%20tests/badge.s…
[![Coverage Status](https://coveralls.io/repos/github/jupyter/qtconsole/badge.svg?branch=master)](https://coveralls.io/github/jupyter/qtconsole?branch=master)
[![Documentation Status](https://readthedocs.org/projects/qtconsole/badge/?version=stable)](…
[![Google Group](https://img.shields.io/badge/-Google%20Group-lightgrey.svg)](https:/…
@@ -90,11 +92,12 @@
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Requires-Python: >= 3.6
Description-Content-Type: text/markdown
Provides-Extra: test
Provides-Extra: doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole.egg-info/SOURCES.txt new/qtconsole-5.0.1/qtconsole.egg-info/SOURCES.txt
--- old/qtconsole-4.7.7/qtconsole.egg-info/SOURCES.txt 2020-09-03 06:02:44.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole.egg-info/SOURCES.txt 2020-11-24 18:27:23.000000000 +0100
@@ -2,7 +2,6 @@
LICENSE
MANIFEST.in
README.md
-setup.cfg
setup.py
docs/Makefile
docs/autogen_config.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/qtconsole.egg-info/requires.txt new/qtconsole-5.0.1/qtconsole.egg-info/requires.txt
--- old/qtconsole-4.7.7/qtconsole.egg-info/requires.txt 2020-09-03 06:02:43.000000000 +0200
+++ new/qtconsole-5.0.1/qtconsole.egg-info/requires.txt 2020-11-24 18:27:23.000000000 +0100
@@ -11,7 +11,6 @@
Sphinx>=1.3
[test]
+flaky
pytest
-
-[test:python_version=="2.7"]
-mock
+pytest-qt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/setup.cfg new/qtconsole-5.0.1/setup.cfg
--- old/qtconsole-4.7.7/setup.cfg 2020-09-03 06:02:46.000000000 +0200
+++ new/qtconsole-5.0.1/setup.cfg 2020-11-24 18:27:25.000000000 +0100
@@ -1,6 +1,3 @@
-[bdist_wheel]
-universal = 1
-
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtconsole-4.7.7/setup.py new/qtconsole-5.0.1/setup.py
--- old/qtconsole-4.7.7/setup.py 2020-06-22 18:28:02.000000000 +0200
+++ new/qtconsole-5.0.1/setup.py 2020-11-24 18:19:30.000000000 +0100
@@ -1,11 +1,8 @@
#!/usr/bin/env python
-# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
-from __future__ import print_function
-
# the name of the package
name = 'qtconsole'
@@ -16,8 +13,8 @@
import sys
v = sys.version_info
-if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
- error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name
+if v[0] >= 3 and v[:2] < (3, 5):
+ error = "ERROR: %s requires Python version 3.6 or above." % name
print(error, file=sys.stderr)
sys.exit(1)
@@ -69,6 +66,7 @@
license = 'BSD',
platforms = "Linux, Mac OS X, Windows",
keywords = ['Interactive', 'Interpreter', 'Shell'],
+ python_requires = '>= 3.6',
install_requires = [
'traitlets',
'ipython_genutils',
@@ -80,8 +78,7 @@
'pyzmq>=17.1'
],
extras_require = {
- 'test': ['pytest'],
- 'test:python_version=="2.7"': ['mock'],
+ 'test': ['flaky', 'pytest', 'pytest-qt'],
'doc': 'Sphinx>=1.3',
},
entry_points = {
@@ -95,11 +92,11 @@
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
],
)
1
0