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

Name:           python-%{srcname}
Version:        4.3.1
Release:        1%{?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

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

This package powers the config system of IPython and Jupyter.


%package -n python2-%{srcname}
Summary:        A lightweight derivative of Enthought Traits for configuring Python objects
BuildRequires:  python2-devel
# For tests
BuildRequires:  pytest
BuildRequires:  python-nose
BuildRequires:  python-decorator
BuildRequires:  python-enum34
BuildRequires:  python-ipython_genutils
BuildRequires:  python-six
Requires:       python-decorator
Requires:       python-enum34
Requires:       python-ipython_genutils
Requires:       python-six
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
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 python%{python3_pkgversion}-%{srcname}
Summary:        A lightweight derivative of Enthought Traits for configuring Python objects
BuildRequires:  python%{python3_pkgversion}-devel
# For tests
BuildRequires:  python%{python3_pkgversion}-pytest
BuildRequires:  python%{python3_pkgversion}-nose
BuildRequires:  python%{python3_pkgversion}-decorator
BuildRequires:  python%{python3_pkgversion}-six
BuildRequires:  python%{python3_pkgversion}-ipython_genutils
BuildRequires:  python%{python3_pkgversion}-six
Requires:       python%{python3_pkgversion}-decorator
Requires:       python%{python3_pkgversion}-ipython_genutils
Requires:       python%{python3_pkgversion}-six
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}

%description -n python%{python3_pkgversion}-%{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
%py2_build
%if 0%{?with_python3}
%py3_build
%endif


%install
%py2_install
%if 0%{?with_python3}
%py3_install
%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 python%{python3_pkgversion}-%{srcname}
%doc README.md
%license COPYING.md
%{python3_sitelib}/*
%endif


%changelog
* Thu Oct 13 2016 Orion Poplawski <orion@cora.nwra.com> - 4.3.1-1
- Update to 4.3.1
- Modernize spec

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.0-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* 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