066a4d0
# Unset -s on python shebang - ensure that extensions installed with pip
066a4d0
# to user locations are seen and properly loaded
4ec7e82
%global py3_shebang_flags %(echo %py3_shebang_flags | sed s/s//)
066a4d0
9e2c5e6
Name:           python-notebook
7baee9c
Version:        7.2.0
d6ea705
Release:        %autorelease
ee7b19d
Summary:        A web-based notebook environment for interactive computing
6ce30c4
# SPDX
6ce30c4
License:        BSD-3-Clause
6f8c843
URL:            https://jupyter.org
a78ac8f
Source:         %{pypi_source notebook}
f9fba47
db5e28b
BuildArch:      noarch
db5e28b
db5e28b
BuildRequires:  python3-devel
a78ac8f
# For validating desktop entry
a78ac8f
BuildRequires:  desktop-file-utils
4004e0e
db5e28b
%global _description \
db5e28b
The Jupyter Notebook is a web application that allows you to create and \
db5e28b
share documents that contain live code, equations, visualizations, and \
db5e28b
explanatory text. The Notebook has support for multiple programming \
db5e28b
languages, sharing, and interactive widgets.
db5e28b
db5e28b
%description %_description
db5e28b
9e2c5e6
%package -n     python3-notebook
86c398d
Summary:        %{summary}
96ba0af
Requires:       python-jupyter-filesystem
ef92928
%py_provides    python3-jupyter-notebook
ef92928
%py_provides    python3-ipython-notebook
ef92928
%py_provides    notebook
ef92928
%py_provides    jupyter-notebook
66806b6
# We stopped shipping doc a long time ago, but there are possible conflicts.
66806b6
# For details, see https://bugzilla.redhat.com/2254087
66806b6
# (Keep this around at least until Fedora 41.)
66806b6
Obsoletes:      python-notebook-doc < 7
db5e28b
9e2c5e6
%description -n python3-notebook %_description
db5e28b
db5e28b
db5e28b
%prep
b25cc7c
%autosetup -p1 -n notebook-%{version}
db5e28b
e167a28
# The nbval package is used for validation of notebooks.
e167a28
# It's sedded out because it isn't yet packaged in Fedora.
a78ac8f
# Selenium tests are skipped because the version in Fedora is too old.
e167a28
# We don't test coverage.
96ba0af
# pytest-tornasync is unmaintained upstream and will be
96ba0af
# replaced by pytest-jupyter.
96ba0af
for pkg in nbval "selenium==.*" coverage pytest-cov pytest-tornasync; do
96ba0af
  sed -Ei "/\"$pkg\",?/d" pyproject.toml
e167a28
done
e167a28
96ba0af
# Remove all backup files
96ba0af
find ./ -name "*.json.orig" -delete
e167a28
e167a28
%generate_buildrequires
3d7e153
%pyproject_buildrequires -x test
e167a28
e167a28
db5e28b
%build
e167a28
%pyproject_wheel
db5e28b
db5e28b
db5e28b
%install
e167a28
%pyproject_install
a78ac8f
%pyproject_save_files notebook
db5e28b
96ba0af
install -m 0755 -p -d %{buildroot}%{_sysconfdir}/jupyter/jupyter_server_config.d
96ba0af
mv -v %{buildroot}{%{_prefix},}%{_sysconfdir}/jupyter/jupyter_server_config.d/notebook.json
db5e28b
db5e28b
%check
96ba0af
%pytest -W ignore::DeprecationWarning --ignore notebook/tests/selenium
db5e28b
4004e0e
desktop-file-validate %{buildroot}%{_datadir}/applications/jupyter-notebook.desktop
db5e28b
89be135
a78ac8f
%files -n python3-notebook -f %{pyproject_files}
db5e28b
%doc README.md
d101ac6
%license LICENSE
db5e28b
%{_bindir}/jupyter-notebook
96ba0af
%config(noreplace) %{_sysconfdir}/jupyter/jupyter_server_config.d/notebook.json
96ba0af
%{_datadir}/jupyter/lab/schemas/@jupyter-notebook/
96ba0af
%{_datadir}/jupyter/labextensions/@jupyter-notebook/
4004e0e
%{_datadir}/applications/jupyter-notebook.desktop
4004e0e
%{_datadir}/icons/hicolor/scalable/apps/notebook.svg
db5e28b
db5e28b
%changelog
d6ea705
%autochangelog