Blob Blame Raw
%global srcname traitlets
%if 0%{?fedora}
%global with_python3 1
%endif

Name:           python-%{srcname}
Version:        4.0.0
Release:        3%{?dist}
Summary:        A lightweight derivative of Enthought Traits for configuring Python objects

License:        BSD
URL:            https://github.com/ipython/traitlets
Source0:        https://github.com/ipython/traitlets/archive/%{version}.tar.gz#/%{srcname}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel
# For tests
BuildRequires:  pytest
BuildRequires:  python-nose
BuildRequires:  python-decorator
BuildRequires:  python-ipython_genutils
Requires:       python-decorator
Requires:       python-ipython_genutils
Provides:       python2-%{srcname} = %{version}-%{release}

%description
A lightweight pure-Python derivative of Enthought Traits, used for
configuring Python objects.

This package powers the config system of IPython and Jupyter.


%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary:        A lightweight derivative of Enthought Traits for configuring Python objects
BuildRequires:  python3-devel
# For tests
BuildRequires:  python3-pytest
BuildRequires:  python3-nose
BuildRequires:  python3-decorator
BuildRequires:  python3-ipython_genutils
Requires:       python3-decorator
Requires:       python3-ipython_genutils

%description -n python3-%{srcname}
A lightweight pure-Python derivative of Enthought Traits, used for
configuring Python objects.

This package powers the config system of IPython and Jupyter.
%endif


%prep
%setup -q -n %{srcname}-%{version}


%build
%{__python2} setup.py build
%if 0%{?with_python3}
%{__python3} setup.py build
%endif


%install
%{__python2} setup.py install --skip-build --root %{buildroot}
%if 0%{?with_python3}
%{__python3} setup.py install --skip-build --root %{buildroot}
%endif


%check
py.test-%{python2_version} -v %{srcname}/tests/
%if 0%{?with_python3}
py.test-%{python3_version} -v %{srcname}/tests/
%endif

 
%files
%doc README.md
%license COPYING.md
%{python2_sitelib}/*

%if 0%{?with_python3}
%files -n python3-%{srcname}
%doc README.md
%license COPYING.md
%{python3_sitelib}/*
%endif


%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Fri Jul 10 2015 Orion Poplawski <orion@cora.nwra.com> - 4.0.0-1
- Initial package