[packages/python-jupyter_core] - new - tests patch to pass PYTHONPATH to tests - completions patch to register completions also for
qboosh
qboosh at pld-linux.org
Sun Sep 29 13:37:34 CEST 2019
commit 8a5f2da55a7f29be4e93f03ef4ff79df3259d7ec
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Sep 29 13:40:37 2019 +0200
- new
- tests patch to pass PYTHONPATH to tests
- completions patch to register completions also for jupyter-{2,3} commands
python-jupyter_core-completions.patch | 16 +++
python-jupyter_core-tests.patch | 20 ++++
python-jupyter_core.spec | 204 ++++++++++++++++++++++++++++++++++
3 files changed, 240 insertions(+)
---
diff --git a/python-jupyter_core.spec b/python-jupyter_core.spec
new file mode 100644
index 0000000..48419e5
--- /dev/null
+++ b/python-jupyter_core.spec
@@ -0,0 +1,204 @@
+#
+# Conditional build:
+%bcond_without doc # Sphinx documentation
+%bcond_without tests # unit tests
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
+Summary: Core common functionality of Jupyter projects
+Summary(pl.UTF-8): Główna, wspólna funkcjonalność projektów Jupyter
+Name: python-jupyter_core
+Version: 4.5.0
+Release: 1
+License: BSD
+Group: Libraries/Python
+#Source0Download: https://pypi.org/simple/jupyter_core/
+Source0: https://files.pythonhosted.org/packages/source/j/jupyter_core/jupyter_core-%{version}.tar.gz
+# Source0-md5: 07d11867c91d0dcac24c6732cf74c457
+Patch0: %{name}-tests.patch
+Patch1: %{name}-completions.patch
+URL: https://pypi.org/project/jupyter_core/
+%if %{with python2}
+BuildRequires: python-modules >= 1:2.7
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-mock
+BuildRequires: python-pytest
+BuildRequires: python-traitlets >= 4.0
+%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-modules >= 1:3.5
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-pytest
+BuildRequires: python3-traitlets >= 4.0
+%endif
+%endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires: python3-sphinxcontrib_github_alt
+BuildRequires: python3-traitlets >= 4.0
+BuildRequires: sphinx-pdg-3
+%endif
+Requires: python-modules >= 1:2.7
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package contains base application classes and configuration
+inherited by other projects. It doesn't do much on its own.
+
+%description -l pl.UTF-8
+Ten pakiet zawiera klasy bazowe aplikacji oraz konfigurację
+dziedziczoną przez inne obiekty. Samodzielnie robi niewiele.
+
+%package -n python3-jupyter_core
+Summary: Core common functionality of Jupyter projects
+Summary(pl.UTF-8): Główna, wspólna funkcjonalność projektów Jupyter
+Group: Libraries/Python
+Requires: python3-modules >= 1:3.5
+
+%description -n python3-jupyter_core
+This package contains base application classes and configuration
+inherited by other projects. It doesn't do much on its own.
+
+%description -n python3-jupyter_core -l pl.UTF-8
+Ten pakiet zawiera klasy bazowe aplikacji oraz konfigurację
+dziedziczoną przez inne obiekty. Samodzielnie robi niewiele.
+
+%package apidocs
+Summary: API documentation for Python jupyter_core module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona jupyter_core
+Group: Documentation
+
+%description apidocs
+API documentation for Python jupyter_core module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona jupyter_core.
+
+%package -n bash-completion-jupyter
+Summary: Bash completion for jupyter commands
+Summary(pl.UTF-8): Bashowe dopełnianie parametrów poleceń jupyter
+Group: Applications/Shells
+Requires: bash-completion >= 2.0
+#Requires: python-jupyter_core or python3-jupyter_core
+
+%description -n bash-completion-jupyter
+Bash completion for jupyter commands.
+
+%description -n bash-completion-jupyter -l pl.UTF-8
+Bashowe dopełnianie parametrów poleceń jupyter.
+
+%package -n zsh-completion-jupyter
+Summary: Zsh completion for jupyter commands
+Summary(pl.UTF-8): Dopełnianie parametrów w zsh dla poleceń jupyter
+Group: Applications/Shells
+#Requires: python-jupyter_core or python3-jupyter_core
+Requires: zsh
+
+%description -n zsh-completion-jupyter
+Zsh completion for jupyter commands.
+
+%description -n zsh-completion-jupyter -l pl.UTF-8
+Dopełnianie parametrów w zsh dla poleceń jupyter.
+
+%prep
+%setup -q -n jupyter_core-%{version}
+%patch0 -p1
+%patch1 -p1
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+LC_ALL=C.UTF-8 \
+PYTHONPATH=$(pwd) \
+%{__python} -m pytest jupyter_core/tests
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd) \
+%{__python3} -m pytest jupyter_core/tests
+%endif
+%endif
+
+%if %{with doc}
+PYTHONPATH=$(pwd) \
+%{__make} -C docs html \
+ SPHINXBUILD=sphinx-build-3
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+for f in $RPM_BUILD_ROOT%{_bindir}/jupyter* ; do
+ %{__mv} "$f" "${f}-2"
+done
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%py3_install
+
+for f in $RPM_BUILD_ROOT%{_bindir}/jupyte*[!2] ; do
+ %{__mv} "$f" "${f}-3"
+done
+%endif
+
+install -d $RPM_BUILD_ROOT{%{bash_compdir},%{zsh_compdir}}
+cp -p examples/completions-zsh $RPM_BUILD_ROOT%{zsh_compdir}/_jupyter
+cp -p examples/jupyter-completion.bash $RPM_BUILD_ROOT%{bash_compdir}/jupyter
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc COPYING.md README.md
+%attr(755,root,root) %{_bindir}/jupyter-2
+%attr(755,root,root) %{_bindir}/jupyter-migrate-2
+%attr(755,root,root) %{_bindir}/jupyter-troubleshoot-2
+%{py_sitescriptdir}/jupyter.py[co]
+%{py_sitescriptdir}/jupyter_core
+%{py_sitescriptdir}/jupyter_core-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-jupyter_core
+%defattr(644,root,root,755)
+%doc COPYING.md README.md
+%attr(755,root,root) %{_bindir}/jupyter-3
+%attr(755,root,root) %{_bindir}/jupyter-migrate-3
+%attr(755,root,root) %{_bindir}/jupyter-troubleshoot-3
+%{py3_sitescriptdir}/jupyter.py
+%{py3_sitescriptdir}/__pycache__/jupyter.cpython-*.py[co]
+%{py3_sitescriptdir}/jupyter_core
+%{py3_sitescriptdir}/jupyter_core-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
+%endif
+
+%files -n bash-completion-jupyter
+%defattr(644,root,root,755)
+%{bash_compdir}/jupyter
+
+%files -n zsh-completion-jupyter
+%defattr(644,root,root,755)
+%{zsh_compdir}/_jupyter
diff --git a/python-jupyter_core-completions.patch b/python-jupyter_core-completions.patch
new file mode 100644
index 0000000..50b4612
--- /dev/null
+++ b/python-jupyter_core-completions.patch
@@ -0,0 +1,16 @@
+--- jupyter_core-4.5.0/examples/jupyter-completion.bash.orig 2018-11-07 18:10:19.000000000 +0100
++++ jupyter_core-4.5.0/examples/jupyter-completion.bash 2019-09-29 13:08:48.722306509 +0200
+@@ -89,4 +89,4 @@
+ fi
+
+ }
+-complete -o default -o nospace -F _jupyter jupyter
++complete -o default -o nospace -F _jupyter jupyter jupyter-2 jupyter-3
+--- jupyter_core-4.5.0/examples/completions-zsh.orig 2017-08-05 11:25:59.000000000 +0200
++++ jupyter_core-4.5.0/examples/completions-zsh 2019-09-29 13:18:28.779164072 +0200
+@@ -1,4 +1,4 @@
+-#compdef jupyter
++#compdef jupyter jupyter-2 jupyter-3
+ # A zsh autocompleter for jupyter.
+ _jupyter() {
+ IFS=$'\n'
diff --git a/python-jupyter_core-tests.patch b/python-jupyter_core-tests.patch
new file mode 100644
index 0000000..77d5050
--- /dev/null
+++ b/python-jupyter_core-tests.patch
@@ -0,0 +1,20 @@
+--- jupyter_core-4.5.0/jupyter_core/tests/test_command.py.orig 2018-02-07 18:03:52.000000000 +0100
++++ jupyter_core-4.5.0/jupyter_core/tests/test_command.py 2019-09-29 13:02:17.751091248 +0200
+@@ -134,6 +134,8 @@
+ env = {'PATH': ''}
+ if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614
+ env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
++ if 'PYTHONPATH' in os.environ:
++ env[str('PYTHONPATH')] = os.environ['PYTHONPATH']
+ if sys.platform == 'win32':
+ env[str('PATHEXT')] = '.EXE'
+ # This won't work on windows unless
+@@ -160,6 +162,8 @@
+ env = {'PATH': str(b)}
+ if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614
+ env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
++ if 'PYTHONPATH' in os.environ:
++ env[str('PYTHONPATH')] = os.environ['PYTHONPATH']
+ if sys.platform == 'win32':
+ env[str('PATHEXT')] = '.EXE'
+ out = check_output([sys.executable, str(jupyter), 'witness'], env=env)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-jupyter_core.git/commitdiff/8a5f2da55a7f29be4e93f03ef4ff79df3259d7ec
More information about the pld-cvs-commit
mailing list