Blob Blame History Raw
%global pname Pympler

%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}

%global desc \
Pympler is a development tool to measure, monitor and analyze the memory\
behavior of Python objects in a running Python application.\
By pympling a Python application, detailed insight in the size and the lifetime\
of Python objects can be obtained. Undesirable or unexpected runtime behavior\
like memory bloat and other “pymples” can easily be identified.\
Pympler integrates three previously separate modules into a single,\
comprehensive profiling tool. The asizeof module provides basic size information\
for one or several Python objects, module muppy is used for on-line monitoring\
of a Python application and module Class Tracker provides off-line analysis of\
the lifetime of selected Python objects.

Name: python-%{pname}
Version: 0.5
Release: 1%{?dist}
Summary: Measure, monitor and analyze the memory behavior of Python objects
License: ASL 2.0 and BSD and MIT
# bundled stuff
# pympler/ BSD
# pympler/static/jquery.sparkline.min.js: BSD
# pympler/util/ MIT
# drop python shebang from
Patch2: %{name}-no-shebang.patch
BuildArch: noarch
BuildRequires: npm(Flot)


%package -n python2-%{pname}
Summary: %{summary}
BuildRequires: python-bottle
BuildRequires: python2-devel
BuildRequires: python2-matplotlib
BuildRequires: python2-setuptools
Requires: npm(Flot)
Requires: python-bottle
Provides: bundled(nodejs-flot-tooltip) = 0.8.4
Provides: bundled(nodejs-flot-sparkline) = 2.1.1
# required by, but doesn't throw an exception without
Recommends: python2-matplotlib
# pympler/ is an extension for django-debug-toolbar
Enhances: python3-django-debug-toolbar

%description -n python2-%{pname}

%package -n python3-%{pname}
Summary: %{summary}
BuildRequires: python3-bottle
BuildRequires: python3-devel
BuildRequires: python3-matplotlib
BuildRequires: python3-setuptools
Requires: npm(Flot)
Requires: python3-bottle
Provides: bundled(js-jquery-flot-tooltip) = 0.8.4
Provides: bundled(js-jquery-sparkline) = 2.1.1
# required by pympler/, but doesn't throw an exception without
Recommends: python3-matplotlib
# pympler/ is an extension for django-debug-toolbar
Enhances: python3-django-debug-toolbar

%description -n python3-%{pname}

%setup -q -n %{pname}-%{version}
rm pympler/util/
%patch2 -p1 -b .no-shebang



# use system nodejs-flot
for f in jquery.flot{,.stack}.min.js ; do
    for p in %{python2_sitelib} %{python3_sitelib} ; do
        rm %{buildroot}/$p/pympler/templates/$f
        ln -s /usr/lib/node_modules/flot/$f %{buildroot}/$p/pympler/templates/

PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} test
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} test

%files -n python2-%{pname}
%license LICENSE

%files -n python3-%{pname}
%license LICENSE

* Mon Jul 02 2018 Dominik Mierzejewski <> 0.5-1
- update to 0.5
- drop obsolete patches
- use pythonX_version macros in files list

* Thu Jul 27 2017 Fedora Release Engineering <> - 0.4.3-6
- Rebuilt for

* Sat Feb 11 2017 Fedora Release Engineering <> - 0.4.3-5
- Rebuilt for

* Mon Dec 19 2016 Miro Hrončok <> - 0.4.3-4
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <> - 0.4.3-3

* Fri Jun 10 2016 Dominik Mierzejewski <> 0.4.3-2
- drop CC-BY-SA-NC from license list and fix typo
- actually unbundle nodejs-flot
- add a weak dep for python{2,3}-django-debug-toolbar
- drop python shebang from

* Mon May 16 2016 Dominik Mierzejewski <> 0.4.3-1
- update to 0.4.3
- build for python3 as well
- unbundle python-bottle

* Sun Aug 09 2015 Dominik Mierzejewski <> 0.4.2-1
- initial build