f5f077f
%global pypi_name importmagic
f5f077f
f5f077f
Name:           python-%{pypi_name}
5aa69d0
Version:        0.1.7
23e6fbd
Release:        20%{?dist}
f5f077f
Summary:        Python library to auto-magically add, remove and manage imports
f5f077f
f5f077f
License:        BSD
f5f077f
URL:            http://github.com/alecthomas/importmagic
e03c363
Source0:        https://pypi.python.org/packages/source/i/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
f5f077f
f5f077f
BuildArch:      noarch
e03c363
e03c363
%if 0%{fedora} >= 24
e03c363
%else
e03c363
BuildRequires:  pytest
e03c363
%endif
e03c363
f5f077f
BuildRequires:  python3-devel
f5f077f
BuildRequires:  python3-setuptools
f5f077f
BuildRequires:  python3-six
e03c363
BuildRequires:  python3-pytest
f5f077f
f5f077f
%description
f5f077f
The goal of this package is to be able to automatically manage imports
f5f077f
in Python. To that end it can:
f5f077f
f5f077f
o Build an index of all known symbols in all packages.
f5f077f
f5f077f
o Find unresolved references in source, and resolve them against the
f5f077f
  index, effectively automating imports.
f5f077f
f5f077f
o Automatically arrange imports according to PEP8.
f5f077f
f5f077f
It was originally written for the Sublime Text 2 Python Import Magic
f5f077f
plugin.
f5f077f
e03c363
e03c363
%package -n python3-%{pypi_name}
f5f077f
Summary:     Python library to auto-magically add, remove and manage imports
f5f077f
Requires:    python3-six
e03c363
%{?python_provide:%python_provide python3-%{pypi_name}}
f5f077f
f5f077f
%description -n python3-%{pypi_name}
f5f077f
The goal of this package is to be able to automatically manage imports
f5f077f
in Python. To that end it can:
f5f077f
f5f077f
o Build an index of all known symbols in all packages.
f5f077f
f5f077f
o Find unresolved references in source, and resolve them against the
f5f077f
  index, effectively automating imports.
f5f077f
f5f077f
o Automatically arrange imports according to PEP8.
f5f077f
f5f077f
It was originally written for the Sublime Text 2 Python Import Magic
f5f077f
plugin.
f5f077f
f5f077f
f5f077f
%prep
e03c363
%setup -q -n %{pypi_name}-%{version}
f5f077f
e03c363
rm -rf %{pypi_name}.egg-info
f5f077f
f5f077f
# Unbundle six.py
f5f077f
# https://github.com/alecthomas/importmagic/issues/23
e03c363
pushd %{pypi_name}
f5f077f
rm -f six.py
f5f077f
for i in *.py ; do
f5f077f
    sed -i -e 's/importmagic.six/six/g' ${i}
f5f077f
done
f5f077f
popd
f5f077f
34e7dda
# We're going to use py.test as packaged for Fedora rather than the
34e7dda
# bundled binary blob
34e7dda
rm -f runtests.py
34e7dda
7d9b8fb
# Move test files out of the importmagic directory so they don't get
7d9b8fb
# installed. Removing them after install would also require removing
7d9b8fb
# the __pycache__ files, so let's just avoid the faff.
7d9b8fb
mkdir test
7d9b8fb
mv %{pypi_name}/*test* test
f5f077f
f5f077f
%build
e03c363
%py3_build
f5f077f
f5f077f
f5f077f
%install
e03c363
%py3_install
f5f077f
f5f077f
f5f077f
%check
34e7dda
PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitelib} py.test-3 test
f5f077f
f5f077f
%files -n python3-%{pypi_name}
f5f077f
%doc README.md CHANGES
f5f077f
%{python3_sitelib}/%{pypi_name}
f5f077f
%{python3_sitelib}/%{pypi_name}*.egg-info
f5f077f
f5f077f
f5f077f
%changelog
23e6fbd
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-20
23e6fbd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
23e6fbd
4aa6827
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.1.7-19
4aa6827
- Rebuilt for Python 3.10
4aa6827
53f32e9
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-18
53f32e9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
53f32e9
f13c0d2
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-17
f13c0d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
f13c0d2
323b3a8
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.1.7-16
323b3a8
- Rebuilt for Python 3.9
323b3a8
c87b76a
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-15
c87b76a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c87b76a
ad25618
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.1.7-14
ad25618
- Rebuilt for Python 3.8.0rc1 (#1748018)
ad25618
0be6f9d
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.1.7-13
0be6f9d
- Rebuilt for Python 3.8
0be6f9d
c4b73e2
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-12
c4b73e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
c4b73e2
0985a3b
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-11
0985a3b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
0985a3b
2900b11
* Wed Oct 17 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.1.7-10
2900b11
- Subpackage python2-importmagic has been removed
2900b11
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
2900b11
6238da6
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-9
6238da6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
6238da6
c5317c8
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.1.7-8
c5317c8
- Rebuilt for Python 3.7
c5317c8
a7aabed
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-7
a7aabed
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a7aabed
397dc65
* Fri Jan 19 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.1.7-6
397dc65
- Update Python 2 dependency declarations to new packaging standards
397dc65
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
397dc65
0e02bd3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-5
0e02bd3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0e02bd3
30cf15f
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-4
30cf15f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
30cf15f
2baa9a5
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.1.7-3
2baa9a5
- Rebuild for Python 3.6
2baa9a5
66f64d7
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-2
66f64d7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
66f64d7
5aa69d0
* Thu Mar 24 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.7-1
5aa69d0
- Update to 0.1.7
5aa69d0
34e7dda
* Tue Mar  8 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.5-4
34e7dda
- Simplify testing logic to test files in buildroot
34e7dda
9a34317
* Mon Mar  7 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.5-3
9a34317
- Remove all files from the importmagic directory before linking
9a34317
  installed files
9a34317
7d9b8fb
* Mon Mar  7 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.5-2
7d9b8fb
- Don't leave __pycache__ entries installed for the test files
7d9b8fb
e03c363
* Mon Mar  7 2016 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.5-1
e03c363
- Update to 0.1.5
e03c363
- Remove Python 3 conditional building - always build
e03c363
- Use new standard Python build and install macros
e03c363
- No longer build in separate directories
e03c363
- Run tests against installed modules rather than sources
e03c363
58c12d9
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.3-6.033e3efgit
58c12d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
58c12d9
23b8721
* Sun Nov 15 2015 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.3-5.033e3efgit
23b8721
- Update to current git snapshot to fix Python 3.5 build and test issues
23b8721
13df685
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.3-4
13df685
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
13df685
f5f077f
* Sun Jul 12 2015 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.3-3
f5f077f
- Fix typo in %%check
f5f077f
- Remove macro from URL
f5f077f
- Unbundle python-six files
f5f077f
- Require and BuildRequire (for %%check) python[3]-six
f5f077f
- Remove tabs from spec file
f5f077f
f5f077f
* Sat Jul 11 2015 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.3-2
f5f077f
- Add BuildRequires for python-setuptools and python3-setuptools
f5f077f
f5f077f
* Fri Jul 10 2015 Jonathan Underwood <jonathan.underwood@gmail.com> - 0.1.3-1
f5f077f
- Initial package