Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-jupyter-core for 
openSUSE:Factory checked in at 2021-11-15 15:26:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jupyter-core (Old)
 and      /work/SRC/openSUSE:Factory/.python-jupyter-core.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-jupyter-core"

Mon Nov 15 15:26:11 2021 rev:9 rq:931208 version:4.9.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jupyter-core/python-jupyter-core.changes  
2021-10-31 22:55:25.063687925 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-jupyter-core.new.1890/python-jupyter-core.changes
        2021-11-15 15:27:44.469846028 +0100
@@ -1,0 +2,20 @@
+Fri Nov 12 21:09:24 UTC 2021 - Ben Greiner <c...@bnavigator.de>
+
+- Update to 4.9.1
+  * Add Python site user base subdirectories to config and data
+    user-level paths if site.ENABLE_USER_SITE is True. One way to
+    disable these directory additions is to set the
+    PYTHONNOUSERSITE environment variable. These locations can be
+    customized by setting the PYTHONUSERBASE environment variable.
+  * Add a workaround for virtualenv for getting the user site
+    directory.
+
+-------------------------------------------------------------------
+Fri Nov 12 08:25:01 UTC 2021 - Stefan Schubert <sch...@suse.de>
+
+- Patch for solving gh#openSUSE/libalternatives#11:
+  argv0_subcommand.patch
+  This patch can be removed while releasing version >4.9.1.
+- Enabled using libalternatives again.
+
+-------------------------------------------------------------------

Old:
----
  jupyter_core-4.8.1.tar.gz

New:
----
  argv0_subcommand.patch
  jupyter_core-4.9.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-jupyter-core.spec ++++++
--- /var/tmp/diff_new_pack.y6Qppa/_old  2021-11-15 15:27:45.581846339 +0100
+++ /var/tmp/diff_new_pack.y6Qppa/_new  2021-11-15 15:27:45.585846341 +0100
@@ -17,8 +17,7 @@
 
 
 #
-%bcond_with libalternatives_issue_11_fixed
-%if 0%{?suse_version} > 1500 && %{with libalternatives_issue_11_fixed}
+%if 0%{?suse_version} > 1500
 %bcond_without libalternatives
 %else
 %bcond_with libalternatives
@@ -35,7 +34,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-jupyter-core%{psuffix}
-Version:        4.8.1
+Version:        4.9.1
 Release:        0
 Summary:        Base package on which Jupyter projects rely
 License:        BSD-3-Clause
@@ -43,6 +42,8 @@
 Source0:        
https://files.pythonhosted.org/packages/source/j/jupyter_core/jupyter_core-%{version}.tar.gz
 # PATCH-FIX-OPENSUSE -- use_rpms_paths.patch -- change paths so they are easy 
to replace at build time
 Patch0:         use_rpms_paths.patch
+# PATCH-FIX-UPSTREAM argv0_subcommand.patch -- gh#jupyter/jupyter_core#248, 
merged after the release of 4.9.1
+Patch1:         argv0_subcommand.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module traitlets}
 BuildRequires:  fdupes
@@ -84,8 +85,7 @@
 as a dependency by packages that require it.
 
 %prep
-%setup -q -n jupyter_core-%{version}
-%patch0 -p1
+%autosetup -p1 -n jupyter_core-%{version}
 # Set the appropriate hardcoded paths dynamically
 sed -i "s|\"_datadir_jupyter_\"|\"%{_datadir}/jupyter\"|" jupyter_core/paths.py
 sed -i "s|\"_sysconfdir_jupyter_\"|\"%{_sysconfdir}/jupyter\"|" 
jupyter_core/paths.py
@@ -115,7 +115,6 @@
 %endif
 
 %pre
-# removing old update-alternatives entries
 # If libalternatives is used: Removing old update-alternatives entries.
 %python_libalternatives_reset_alternative jupyter
 

++++++ argv0_subcommand.patch ++++++
diff -Naur org/jupyter_core/command.py patch/jupyter_core/command.py
--- org/jupyter_core/command.py 2021-11-12 09:01:30.121064192 +0100
+++ patch/jupyter_core/command.py       2021-11-12 09:07:57.943564964 +0100
@@ -297,7 +297,7 @@
         sys.exit(e)
 
     try:
-        _execvp(command, sys.argv[1:])
+        _execvp(command, [command] + sys.argv[2:])
     except OSError as e:
         sys.exit("Error executing Jupyter command %r: %s" % (subcommand, e))
 
diff -Naur org/jupyter_core/tests/test_command.py 
patch/jupyter_core/tests/test_command.py
--- org/jupyter_core/tests/test_command.py      2021-11-12 09:01:59.721265505 
+0100
+++ patch/jupyter_core/tests/test_command.py    2021-11-12 09:09:21.832084810 
+0100
@@ -192,3 +192,27 @@
         env[str('PATHEXT')] = '.EXE'
     out = check_output([sys.executable, str(jupyter), 'witness'], env=env)
     assert b'WITNESS A' in out
+
+def test_argv0(tmpdir):
+    a = tmpdir.mkdir("a")
+    jupyter = a.join('jupyter')
+    jupyter.write(
+        'from jupyter_core import command; command.main()'
+    )
+    jupyter.chmod(0o700)
+    witness_a = a.join('jupyter-witness')
+    witness_a_src = f'''#!{sys.executable}
+import sys
+print(sys.argv[0])
+'''
+    write_executable(witness_a, witness_a_src)
+
+    env = {}
+    if 'SYSTEMROOT' in os.environ:  # Windows http://bugs.python.org/issue20614
+        env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
+    if sys.platform == 'win32':
+        env[str('PATHEXT')] = '.EXE'
+    out = check_output([sys.executable, str(jupyter), 'witness'], env=env)
+
+    # Make sure the first argv is the full path to the executing script
+    assert f'{jupyter}-witness'.encode() in out
++++++ jupyter_core-4.8.1.tar.gz -> jupyter_core-4.9.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_core-4.8.1/PKG-INFO 
new/jupyter_core-4.9.1/PKG-INFO
--- old/jupyter_core-4.8.1/PKG-INFO     2021-09-17 03:21:05.841862400 +0200
+++ new/jupyter_core-4.9.1/PKG-INFO     2021-10-28 06:00:18.573315600 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: jupyter_core
-Version: 4.8.1
+Version: 4.9.1
 Summary: Jupyter core package. A base package on which Jupyter projects rely.
 Home-page: https://jupyter.org
 Author: Jupyter Development Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_core-4.8.1/docs/changelog.rst 
new/jupyter_core-4.9.1/docs/changelog.rst
--- old/jupyter_core-4.8.1/docs/changelog.rst   2021-09-17 02:11:12.000000000 
+0200
+++ new/jupyter_core-4.9.1/docs/changelog.rst   2021-10-27 21:21:03.000000000 
+0200
@@ -1,9 +1,43 @@
 Changes in jupyter-core
 =======================
 
+4.9
+---
+
+4.9.1
+~~~~~
+
+`on
+GitHub <https://github.com/jupyter/jupyter_core/releases/tag/4.9.0>`__
+
+- Add a workaround for virtualenv for getting the user site directory. 
(:ghpull:`247`)
+
+
+4.9.0
+~~~~~
+
+`on
+GitHub <https://github.com/jupyter/jupyter_core/releases/tag/4.9.0>`__
+
+See the `jupyter_core
+4.9 <https://github.com/jupyter/jupyter_core/milestone/21?closed=1>`__
+milestone on GitHub for the full list of pull requests and issues closed.
+
+- Add Python site user base subdirectories to config and data user-level paths 
if ``site.ENABLE_USER_SITE`` is True. One way to disable these directory 
additions is to set the ``PYTHONNOUSERSITE`` environment variable. These 
locations can be customized by setting the ``PYTHONUSERBASE`` environment 
variable. (:ghpull:`242`)
+
+
 4.8
 ---
 
+4.8.2
+~~~~~
+`on
+GitHub <https://github.com/jupyter/jupyter_core/releases/tag/4.8.2>`__
+
+jupyter_core 4.8.1 was released the same day as 4.8.0 and also included the 
fix below for the Windows tests. Unfortunately, the 4.8.1 release commit and 
tag were not pushed to GitHub. We are releasing 4.8.2 so we have a commit and 
tag in version control.
+
+- Fix windows test regression (:ghpull:`240`)
+
 4.8.0
 ~~~~~
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_core-4.8.1/jupyter_core/command.py 
new/jupyter_core-4.9.1/jupyter_core/command.py
--- old/jupyter_core-4.8.1/jupyter_core/command.py      2021-09-17 
02:11:12.000000000 +0200
+++ new/jupyter_core-4.9.1/jupyter_core/command.py      2021-10-26 
22:56:59.000000000 +0200
@@ -11,6 +11,7 @@
 import json
 import os
 from shutil import which
+import site
 import sys
 import sysconfig
 from subprocess import Popen
@@ -257,6 +258,11 @@
                     else:
                         print("JUPYTER_CONFIG_DIR is not set, so we use the 
default user-level config directory")
 
+                    if site.ENABLE_USER_SITE:
+                        print(f"Python's site.ENABLE_USER_SITE is True, so we 
add the user site directory '{site.getuserbase()}'")
+                    else:
+                        print(f"Python's site.ENABLE_USER_SITE is not True, so 
we do not add the Python site user directory '{site.getuserbase()}'")
+
                     # data path list
                     if env.get('JUPYTER_PATH'):
                         print(f"JUPYTER_PATH is set to 
'{env.get('JUPYTER_PATH')}', which is prepended to the data paths")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_core-4.8.1/jupyter_core/paths.py 
new/jupyter_core-4.9.1/jupyter_core/paths.py
--- old/jupyter_core-4.8.1/jupyter_core/paths.py        2021-09-17 
02:11:12.000000000 +0200
+++ new/jupyter_core-4.9.1/jupyter_core/paths.py        2021-10-27 
21:17:42.000000000 +0200
@@ -12,6 +12,7 @@
 import sys
 import stat
 import errno
+import site
 import tempfile
 import warnings
 from pathlib import Path
@@ -141,6 +142,10 @@
     If the JUPYTER_PREFER_ENV_PATH environment variable is set, the 
environment-level
     directories will have priority over user-level directories.
 
+    If the Python site.ENABLE_USER_SITE variable is True, we also add the
+    appropriate Python user site subdirectory to the user-level directories.
+
+
     If ``*subdirs`` are given, that subdirectory will be added to each element.
 
     Examples:
@@ -161,14 +166,25 @@
         )
 
     # Next is environment or user, depending on the JUPYTER_PREFER_ENV_PATH 
flag
-    user = jupyter_data_dir()
+    user = [jupyter_data_dir()]
+    if site.ENABLE_USER_SITE:
+        # Check if site.getuserbase() exists to be compatible with virtualenv,
+        # which often does not have this method.
+        if hasattr(site, 'getuserbase'):
+            userbase = site.getuserbase()
+        else:
+            userbase = site.USER_BASE
+        userdir = os.path.join(userbase, 'share', 'jupyter')
+        if userdir not in user:
+            user.append(userdir)
+
     env = [p for p in ENV_JUPYTER_PATH if p not in SYSTEM_JUPYTER_PATH]
 
     if envset('JUPYTER_PREFER_ENV_PATH'):
         paths.extend(env)
-        paths.append(user)
+        paths.extend(user)
     else:
-        paths.append(user)
+        paths.extend(user)
         paths.extend(env)
 
     # finally, system
@@ -197,9 +213,13 @@
 
 def jupyter_config_path():
     """Return the search path for Jupyter config files as a list.
-    
-    If the JUPYTER_PREFER_ENV_PATH environment variable is set, the 
environment-level
-    directories will have priority over user-level directories.
+
+    If the JUPYTER_PREFER_ENV_PATH environment variable is set, the
+    environment-level directories will have priority over user-level
+    directories.
+
+    If the Python site.ENABLE_USER_SITE variable is True, we also add the
+    appropriate Python user site subdirectory to the user-level directories.
     """
     if os.environ.get('JUPYTER_NO_CONFIG'):
         # jupyter_config_dir makes a blank config when JUPYTER_NO_CONFIG is 
set.
@@ -215,14 +235,26 @@
         )
 
     # Next is environment or user, depending on the JUPYTER_PREFER_ENV_PATH 
flag
-    user = jupyter_config_dir()
+    user = [jupyter_config_dir()]
+    if site.ENABLE_USER_SITE:
+        # Check if site.getuserbase() exists to be compatible with virtualenv,
+        # which often does not have this method.
+        if hasattr(site, 'getuserbase'):
+            userbase = site.getuserbase()
+        else:
+            userbase = site.USER_BASE
+
+        userdir = os.path.join(userbase, 'etc', 'jupyter')
+        if userdir not in user:
+            user.append(userdir)
+
     env = [p for p in ENV_CONFIG_PATH if p not in SYSTEM_CONFIG_PATH]
 
     if envset('JUPYTER_PREFER_ENV_PATH'):
         paths.extend(env)
-        paths.append(user)
+        paths.extend(user)
     else:
-        paths.append(user)
+        paths.extend(user)
         paths.extend(env)
 
     # Finally, system path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/jupyter_core-4.8.1/jupyter_core/tests/test_command.py 
new/jupyter_core-4.9.1/jupyter_core/tests/test_command.py
--- old/jupyter_core-4.8.1/jupyter_core/tests/test_command.py   2021-09-17 
02:11:12.000000000 +0200
+++ new/jupyter_core-4.9.1/jupyter_core/tests/test_command.py   2021-10-26 
22:56:59.000000000 +0200
@@ -17,6 +17,15 @@
 )
 
 
+resetenv = patch.dict(os.environ)
+
+def setup_module():
+    resetenv.start()
+    os.environ.pop('JUPYTER_PREFER_ENV_PATH', None)
+
+def teardown_module():
+    resetenv.stop()
+
 def get_jupyter_output(cmd):
     """Get output of a jupyter command"""
     if not isinstance(cmd, list):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_core-4.8.1/jupyter_core/tests/test_paths.py 
new/jupyter_core-4.9.1/jupyter_core/tests/test_paths.py
--- old/jupyter_core-4.8.1/jupyter_core/tests/test_paths.py     2021-09-17 
03:20:27.000000000 +0200
+++ new/jupyter_core-4.9.1/jupyter_core/tests/test_paths.py     2021-10-26 
22:56:59.000000000 +0200
@@ -10,6 +10,7 @@
 import tempfile
 from unittest.mock import patch
 import pytest
+import site
 import subprocess
 import sys
 import warnings
@@ -47,6 +48,17 @@
 
 jupyter_config_env = '/jupyter-cfg'
 config_env = patch.dict('os.environ', {'JUPYTER_CONFIG_DIR': 
jupyter_config_env})
+prefer_env = patch.dict('os.environ', {'JUPYTER_PREFER_ENV_PATH': 'True'})
+
+resetenv = patch.dict(os.environ)
+
+def setup_module():
+    resetenv.start()
+    os.environ.pop('JUPYTER_PREFER_ENV_PATH', None)
+
+def teardown_module():
+    resetenv.stop()
+
 
 
 def realpath(path):
@@ -54,7 +66,6 @@
 
 home_jupyter = realpath('~/.jupyter')
 
-
 def test_envset():
     true_values = ['', 'True', 'on', 'yes', 'Y', '1', 'anything']
     false_values = ['n', 'No', 'N', 'fAlSE', '0', '0.0', 'Off']
@@ -184,8 +195,27 @@
     assert path[0] == jupyter_data_dir()
     assert path[-2:] == system_path
 
+def test_jupyter_path_user_site():
+    with no_config_env, patch.object(site, 'ENABLE_USER_SITE', True):
+        path = jupyter_path()
+
+    # deduplicated expected values
+    values = list(dict.fromkeys([
+        jupyter_data_dir(),
+        os.path.join(site.getuserbase(), 'share', 'jupyter'),
+        paths.ENV_JUPYTER_PATH[0]
+    ]))
+    for p,v in zip(path, values):
+        assert p == v
+
+def test_jupyter_path_no_user_site():
+    with no_config_env, patch.object(site, 'ENABLE_USER_SITE', False):
+        path = jupyter_path()
+    assert path[0] == jupyter_data_dir()
+    assert path[1] == paths.ENV_JUPYTER_PATH[0]
+
 def test_jupyter_path_prefer_env():
-    with patch.dict('os.environ', {'JUPYTER_PREFER_ENV_PATH': 'true'}):
+    with prefer_env:
         path = jupyter_path()
     assert path[0] == paths.ENV_JUPYTER_PATH[0]
     assert path[1] == jupyter_data_dir()
@@ -213,15 +243,37 @@
         assert p.endswith(pjoin('', 'sub1', 'sub2'))
 
 def test_jupyter_config_path():
-    path = jupyter_config_path()
+    with patch.object(site, 'ENABLE_USER_SITE', True):
+        path = jupyter_config_path()
+
+    # deduplicated expected values
+    values = list(dict.fromkeys([
+        jupyter_config_dir(),
+        os.path.join(site.getuserbase(), 'etc', 'jupyter'),
+        paths.ENV_CONFIG_PATH[0]
+    ]))
+    for p,v in zip(path, values):
+        assert p == v
+
+def test_jupyter_config_path_no_user_site():
+    with patch.object(site, 'ENABLE_USER_SITE', False):
+        path = jupyter_config_path()
     assert path[0] == jupyter_config_dir()
     assert path[1] == paths.ENV_CONFIG_PATH[0]
 
+
 def test_jupyter_config_path_prefer_env():
-    with patch.dict('os.environ', {'JUPYTER_PREFER_ENV_PATH': 'true'}):
+    with prefer_env, patch.object(site, 'ENABLE_USER_SITE', True):
         path = jupyter_config_path()
-    assert path[0] == paths.ENV_CONFIG_PATH[0]
-    assert path[1] == jupyter_config_dir()
+
+    # deduplicated expected values
+    values = list(dict.fromkeys([
+        paths.ENV_CONFIG_PATH[0],
+        jupyter_config_dir(),
+        os.path.join(site.getuserbase(), 'etc', 'jupyter')
+    ]))
+    for p,v in zip(path, values):
+        assert p == v
 
 def test_jupyter_config_path_env():
     path_env = os.pathsep.join([
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_core-4.8.1/jupyter_core/version.py 
new/jupyter_core-4.9.1/jupyter_core/version.py
--- old/jupyter_core-4.8.1/jupyter_core/version.py      2021-09-17 
03:20:43.000000000 +0200
+++ new/jupyter_core-4.9.1/jupyter_core/version.py      2021-10-28 
05:59:44.000000000 +0200
@@ -11,7 +11,7 @@
     'serial'
 ])
 
-version_info = VersionInfo(4, 8, 1, 'final', 0)
+version_info = VersionInfo(4, 9, 1, 'final', 0)
 
 _specifier_ = {'alpha': 'a', 'beta': 'b', 'candidate': 'rc', 'final': '', 
'dev': 'dev'}
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/jupyter_core-4.8.1/jupyter_core.egg-info/PKG-INFO 
new/jupyter_core-4.9.1/jupyter_core.egg-info/PKG-INFO
--- old/jupyter_core-4.8.1/jupyter_core.egg-info/PKG-INFO       2021-09-17 
03:21:05.000000000 +0200
+++ new/jupyter_core-4.9.1/jupyter_core.egg-info/PKG-INFO       2021-10-28 
06:00:18.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: jupyter-core
-Version: 4.8.1
+Version: 4.9.1
 Summary: Jupyter core package. A base package on which Jupyter projects rely.
 Home-page: https://jupyter.org
 Author: Jupyter Development Team

Reply via email to