1
0
python-jupyter-core/python-jupyter-core.spec

144 lines
4.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-jupyter-core
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define skip_python39 1
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
- Update to 5.1.1 * Only prefer envs owned by the current user #323 (@minrk) * Don't treat the conda root env as an env #324 (@minrk) - Release 5.1.0 * Add run_sync and ensure_async functions #315 (@davidbrochart) - Release 5.0.0 ## Major Changes * Prefer Environment Level Configuration. We now make the assumption that if we are running in a virtual environment, we * should prioritize the environment-level sys.prefix over the user-level paths. Users can opt out of this behavior by setting JUPYTER_PREFER_ENV_PATH, which takes precedence over our autodetection. * Migrate to Standard Platform Directories. In version 5, we introduce a JUPYTER_PLATFORM_DIRS environment variable to opt in * to using more appropriate platform-specific directories. We raise a deprecation warning if the variable is not set. In version 6, JUPYTER_PLATFORM_DIRS will be opt-out. In version 7, we will remove the environment variable checks and old directory logic. * Drop Support for Python 3.7 * We are dropping support for Python 3.7 ahead of its official end of life, to reduce * maintenance burden as we add support for Python 3.11. * Use platformdirs for path locations #292 (@blink1073) * Try to detect if we are in a virtual environment and change path precedence * accordingly #286 (@jasongrout) * Add current working directory as first config path #291 (@blink1073) * Fix inclusion of jupyter file and check in CI #276 (@blink1073) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyter-core?expand=0&rev=28
2022-12-25 20:40:52 +00:00
Name: python-jupyter-core%{psuffix}
Version: 5.7.2
Release: 0
Summary: Base package on which Jupyter projects rely
License: BSD-3-Clause
URL: https://github.com/jupyter/jupyter_core
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
- Update to 5.1.1 * Only prefer envs owned by the current user #323 (@minrk) * Don't treat the conda root env as an env #324 (@minrk) - Release 5.1.0 * Add run_sync and ensure_async functions #315 (@davidbrochart) - Release 5.0.0 ## Major Changes * Prefer Environment Level Configuration. We now make the assumption that if we are running in a virtual environment, we * should prioritize the environment-level sys.prefix over the user-level paths. Users can opt out of this behavior by setting JUPYTER_PREFER_ENV_PATH, which takes precedence over our autodetection. * Migrate to Standard Platform Directories. In version 5, we introduce a JUPYTER_PLATFORM_DIRS environment variable to opt in * to using more appropriate platform-specific directories. We raise a deprecation warning if the variable is not set. In version 6, JUPYTER_PLATFORM_DIRS will be opt-out. In version 7, we will remove the environment variable checks and old directory logic. * Drop Support for Python 3.7 * We are dropping support for Python 3.7 ahead of its official end of life, to reduce * maintenance burden as we add support for Python 3.11. * Use platformdirs for path locations #292 (@blink1073) * Try to detect if we are in a virtual environment and change path precedence * accordingly #286 (@jasongrout) * Add current working directory as first config path #291 (@blink1073) * Fix inclusion of jupyter file and check in CI #276 (@blink1073) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyter-core?expand=0&rev=28
2022-12-25 20:40:52 +00:00
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: fdupes
BuildRequires: python-rpm-macros >= 20210929
- Update to 5.1.1 * Only prefer envs owned by the current user #323 (@minrk) * Don't treat the conda root env as an env #324 (@minrk) - Release 5.1.0 * Add run_sync and ensure_async functions #315 (@davidbrochart) - Release 5.0.0 ## Major Changes * Prefer Environment Level Configuration. We now make the assumption that if we are running in a virtual environment, we * should prioritize the environment-level sys.prefix over the user-level paths. Users can opt out of this behavior by setting JUPYTER_PREFER_ENV_PATH, which takes precedence over our autodetection. * Migrate to Standard Platform Directories. In version 5, we introduce a JUPYTER_PLATFORM_DIRS environment variable to opt in * to using more appropriate platform-specific directories. We raise a deprecation warning if the variable is not set. In version 6, JUPYTER_PLATFORM_DIRS will be opt-out. In version 7, we will remove the environment variable checks and old directory logic. * Drop Support for Python 3.7 * We are dropping support for Python 3.7 ahead of its official end of life, to reduce * maintenance burden as we add support for Python 3.11. * Use platformdirs for path locations #292 (@blink1073) * Try to detect if we are in a virtual environment and change path precedence * accordingly #286 (@jasongrout) * Add current working directory as first config path #291 (@blink1073) * Fix inclusion of jupyter file and check in CI #276 (@blink1073) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyter-core?expand=0&rev=28
2022-12-25 20:40:52 +00:00
Requires: python-platformdirs >= 2.5
Requires: python-traitlets >= 5.3
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
Recommends: python-ipython
Provides: python-jupyter_core = %{version}-%{release}
Obsoletes: python-jupyter_core < %{version}-%{release}
%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3"
Provides: jupyter-jupyter-core = %{version}-%{release}
Obsoletes: jupyter-jupyter-core < %{version}-%{release}
Provides: jupyter-jupyter_core = %{version}-%{release}
Obsoletes: jupyter-jupyter_core < %{version}-%{release}
%endif
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module ipykernel}
BuildRequires: %{python_module jupyter-core = %{version}}
BuildRequires: %{python_module pytest >= 7 with %python-pytest < 8}
BuildRequires: %{python_module pytest-timeout}
%endif
%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
%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|@_distconfdir_jupyter_@|%{_distconfdir}/jupyter|" jupyter_core/paths.py
sed -i "/addopts/,/]/ s/--color=yes//" pyproject.toml
%if !%{with test}
%build
%pyproject_wheel
%endif
%if !%{with test}
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/jupyter
%python_clone -a %{buildroot}%{_bindir}/jupyter-migrate
%python_clone -a %{buildroot}%{_bindir}/jupyter-troubleshoot
%{python_expand chmod a+x %{buildroot}%{$python_sitelib}/jupyter_core/troubleshoot.py
sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|" %{buildroot}%{$python_sitelib}/jupyter_core/troubleshoot.py
}
%python_compileall
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%if %{with test}
%check
- Update to 5.1.1 * Only prefer envs owned by the current user #323 (@minrk) * Don't treat the conda root env as an env #324 (@minrk) - Release 5.1.0 * Add run_sync and ensure_async functions #315 (@davidbrochart) - Release 5.0.0 ## Major Changes * Prefer Environment Level Configuration. We now make the assumption that if we are running in a virtual environment, we * should prioritize the environment-level sys.prefix over the user-level paths. Users can opt out of this behavior by setting JUPYTER_PREFER_ENV_PATH, which takes precedence over our autodetection. * Migrate to Standard Platform Directories. In version 5, we introduce a JUPYTER_PLATFORM_DIRS environment variable to opt in * to using more appropriate platform-specific directories. We raise a deprecation warning if the variable is not set. In version 6, JUPYTER_PLATFORM_DIRS will be opt-out. In version 7, we will remove the environment variable checks and old directory logic. * Drop Support for Python 3.7 * We are dropping support for Python 3.7 ahead of its official end of life, to reduce * maintenance burden as we add support for Python 3.11. * Use platformdirs for path locations #292 (@blink1073) * Try to detect if we are in a virtual environment and change path precedence * accordingly #286 (@jasongrout) * Add current working directory as first config path #291 (@blink1073) * Fix inclusion of jupyter file and check in CI #276 (@blink1073) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyter-core?expand=0&rev=28
2022-12-25 20:40:52 +00:00
# does not work outside venvs: gh#jupyter/jupyter_core#208
donttest="test_jupyter_path_prefer_env or test_jupyter_config_path_prefer_env"
# we changed the xdg path
donttest="$donttest or test_config_dir_linux"
# async failure
donttest="$donttest or test_ensure_async"
- Update to 5.1.1 * Only prefer envs owned by the current user #323 (@minrk) * Don't treat the conda root env as an env #324 (@minrk) - Release 5.1.0 * Add run_sync and ensure_async functions #315 (@davidbrochart) - Release 5.0.0 ## Major Changes * Prefer Environment Level Configuration. We now make the assumption that if we are running in a virtual environment, we * should prioritize the environment-level sys.prefix over the user-level paths. Users can opt out of this behavior by setting JUPYTER_PREFER_ENV_PATH, which takes precedence over our autodetection. * Migrate to Standard Platform Directories. In version 5, we introduce a JUPYTER_PLATFORM_DIRS environment variable to opt in * to using more appropriate platform-specific directories. We raise a deprecation warning if the variable is not set. In version 6, JUPYTER_PLATFORM_DIRS will be opt-out. In version 7, we will remove the environment variable checks and old directory logic. * Drop Support for Python 3.7 * We are dropping support for Python 3.7 ahead of its official end of life, to reduce * maintenance burden as we add support for Python 3.11. * Use platformdirs for path locations #292 (@blink1073) * Try to detect if we are in a virtual environment and change path precedence * accordingly #286 (@jasongrout) * Add current working directory as first config path #291 (@blink1073) * Fix inclusion of jupyter file and check in CI #276 (@blink1073) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-jupyter-core?expand=0&rev=28
2022-12-25 20:40:52 +00:00
%pytest -k "not ($donttest)"
%endif
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative jupyter
%post
%python_install_alternative jupyter jupyter-migrate jupyter-troubleshoot
%postun
%python_uninstall_alternative jupyter
%if !%{with test}
%files %{python_files}
%license LICENSE
%python_alternative %{_bindir}/jupyter
%python_alternative %{_bindir}/jupyter-migrate
%python_alternative %{_bindir}/jupyter-troubleshoot
%{python_sitelib}/jupyter.py*
%pycache_only %{python_sitelib}/__pycache__/jupyter.*.py*
%{python_sitelib}/jupyter_core/
%{python_sitelib}/jupyter_core-%{version}*-info
%endif
%changelog