2018-05-03 04:59:22 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-line_profiler
|
|
|
|
|
#
|
2019-01-02 12:36:36 +00:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2018-05-03 04:59:22 +00:00
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2019-01-02 12:36:36 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-05-03 04:59:22 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
|
Name: python-line_profiler
|
|
|
|
|
Version: 2.1.2
|
|
|
|
|
Release: 0
|
|
|
|
|
Summary: Line-by-line profiler
|
|
|
|
|
License: BSD-3-Clause
|
|
|
|
|
Group: Development/Languages/Python
|
2019-01-02 12:36:36 +00:00
|
|
|
URL: https://github.com/rkern/line_profiler
|
2018-05-03 06:51:26 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/l/line_profiler/line_profiler-%{version}.tar.gz
|
2018-05-03 04:59:22 +00:00
|
|
|
BuildRequires: %{python_module Cython}
|
|
|
|
|
BuildRequires: %{python_module devel}
|
2018-07-19 15:07:12 +00:00
|
|
|
BuildRequires: %{python_module jupyter_ipython}
|
|
|
|
|
BuildRequires: %{python_module pytest}
|
2018-05-03 04:59:22 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2018-07-19 15:07:12 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2018-05-10 15:27:11 +00:00
|
|
|
BuildRequires: python3-devel >= 3.5
|
2019-01-02 12:36:36 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
|
Requires(postun): update-alternatives
|
2018-05-10 15:27:11 +00:00
|
|
|
%ifpython3
|
|
|
|
|
Requires: python3-base >= 3.5
|
|
|
|
|
%endif
|
2018-05-03 04:59:22 +00:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
line_profiler will profile the time individual lines of code take to execute.
|
|
|
|
|
The profiler is implemented in C via Cython in order to reduce the overhead of
|
|
|
|
|
profiling.
|
|
|
|
|
|
|
|
|
|
Also included is the script kernprof.py which can be used to conveniently
|
|
|
|
|
profile Python applications and scripts either with line_profiler or with the
|
|
|
|
|
function-level profiling tools in the Python standard library.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n line_profiler-%{version}
|
|
|
|
|
|
|
|
|
|
%build
|
2019-01-02 12:36:36 +00:00
|
|
|
# fix wrongly generated cyx files
|
|
|
|
|
find . -name '*.pyx' -exec cython {} \;
|
|
|
|
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
2018-05-03 04:59:22 +00:00
|
|
|
%python_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%python_install
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/kernprof
|
|
|
|
|
%{python_expand chmod a+x %{buildroot}%{$python_sitearch}/*.py
|
2019-01-02 12:36:36 +00:00
|
|
|
sed -i "s|#!%{_bindir}/env python|#!%__$python|" %{buildroot}%{$python_sitearch}/*.py
|
2018-05-03 04:59:22 +00:00
|
|
|
$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}
|
|
|
|
|
$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}
|
|
|
|
|
%fdupes %{buildroot}%{$python_sitearch}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%python_install_alternative kernprof
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%python_uninstall_alternative kernprof
|
|
|
|
|
|
|
|
|
|
%check
|
2018-07-19 15:07:12 +00:00
|
|
|
# https://github.com/rkern/line_profiler/issues/128
|
2019-01-02 12:36:36 +00:00
|
|
|
# %%{python_expand export PYTHONPATH="%%{buildroot}%%{$python_sitearch}"
|
2018-07-19 15:07:12 +00:00
|
|
|
# py.test-%%{$python_bin_suffix} tests
|
|
|
|
|
# }
|
2018-05-03 04:59:22 +00:00
|
|
|
|
|
|
|
|
%files %{python_files}
|
2018-05-03 16:16:55 +00:00
|
|
|
%doc README.rst
|
|
|
|
|
%license LICENSE.txt LICENSE_Python.txt
|
2018-05-03 04:59:22 +00:00
|
|
|
%python_alternative %{_bindir}/kernprof
|
|
|
|
|
%{python_sitearch}/line_profiler-%{version}-py*.egg-info
|
|
|
|
|
%{python_sitearch}/kernprof.py*
|
2018-07-19 15:07:12 +00:00
|
|
|
%{python_sitearch}/line_profiler*.py*
|
2018-05-03 04:59:22 +00:00
|
|
|
%{python_sitearch}/_line_profiler*.so
|
|
|
|
|
%python3_only %{python_sitearch}/line_profiler_py35.py*
|
|
|
|
|
%pycache_only %{python_sitearch}/__pycache__/kernprof*.py*
|
|
|
|
|
%pycache_only %{python_sitearch}/__pycache__/line_profiler*.py*
|
|
|
|
|
|
|
|
|
|
%changelog
|