File python-jupyter_core.spec of Package python-jupyter_core
#
# spec file for package python-jupyter_core
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-jupyter_core
Version: 4.4.0
Release: 0
Summary: Base package on which Jupyter projects rely
License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/jupyter/jupyter_core
Source: 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
BuildRequires: %{python_module devel}
BuildRequires: %{python_module ipython_genutils}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module traitlets}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-ipython_genutils
Requires: python-traitlets
Recommends: python-jupyter_ipython
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%python_subpackages
%description
Core common functionality of Jupyter projects.
This package contains base application classes and configuration inherited by
other projects. It doesn't do much on its own.
There is no reason to install this package on its own. It will be pulled in
as a dependency by packages that require it.
%prep
%setup -q -n jupyter_core-%{version}
%patch0 -p1
# Set the appropriate paths dynamically
sed -i "s|\"/usr/share/jupyter\"|\"%{_datadir}/jupyter\"|" jupyter_core/paths.py
sed -i "s|\"/etc/jupyter\"|\"%{_sysconfdir}/jupyter\"|" jupyter_core/paths.py
sed -i "s|(sys\.prefix, 'share', 'jupyter')|('%{_datadir}', 'jupyter')|" jupyter_core/paths.py
sed -i "s|(sys\.prefix, 'etc', 'jupyter')|('%{_sysconfdir}', 'jupyter')|" jupyter_core/paths.py
%build
%python_build
%install
%python_install
%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/jupyter_core/troubleshoot.py
sed -i "s|^#!/usr/bin/env python$|#!%{__$python}|" %{buildroot}%{$python_sitelib}/jupyter_core/troubleshoot.py
$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/jupyter_core/
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/jupyter_core/
%fdupes %{buildroot}%{$python_sitelib}
}
# these directories are used by extensions
mkdir -p %{buildroot}%{_datadir}/jupyter/
mkdir -p %{buildroot}%{_datadir}/jupyter/kernels/
mkdir -p %{buildroot}%{_sysconfdir}/jupyter/
%files %{python_files}
%defattr(-,root,root,-)
%doc CONTRIBUTING.md COPYING.md README.md
%python3_only %{_bindir}/jupyter
%python3_only %{_bindir}/jupyter-migrate
%{python_sitelib}/jupyter*.py*
%pycache_only %{python_sitelib}/__pycache__/jupyter*.*.py*
%{_datadir}/jupyter/
%{_datadir}/jupyter/kernels/
%{_sysconfdir}/jupyter/
%{python_sitelib}/jupyter_core/
%{python_sitelib}/jupyter_core-%{version}-*.egg-info
%changelog