]> git.pld-linux.org Git - packages/python-isort.git/blob - python-isort.spec
new package
[packages/python-isort.git] / python-isort.spec
1 #
2 # Conditional build:
3 %bcond_with     tests   # do perform tests (broken in 4.2.15)
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module  isort
8 Summary:        Python utility / library to sort imports alphabetically
9 Name:           python-%{module}
10 Version:        4.2.15
11 Release:        1
12 License:        MIT
13 Group:          Libraries/Python
14 Source0:        https://files.pythonhosted.org/packages/source/i/%{module}/%{module}-%{version}.tar.gz
15 # Source0-md5:  34915a2ce60e6fe3dbcbf5982deef9b4
16 URL:            https://github.com/timothycrosley/isort
17 BuildRequires:  rpm-pythonprov
18 BuildRequires:  rpmbuild(macros) >= 1.714
19 %if %{with python2}
20 BuildRequires:  python-setuptools
21 %endif
22 %if %{with python3}
23 BuildRequires:  python3-setuptools
24 %endif
25 Requires:       python-modules
26 BuildArch:      noarch
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 isort is a Python utility / library to sort imports alphabetically,
31 and automatically separated into sections. It provides a command line
32 utility, Python library and plugins for various editors to quickly
33 sort all your imports. It currently cleanly supports Python 2.7 - 3.6
34 without any dependencies.
35
36 %package -n python3-%{module}
37 Summary:        Python utility / library to sort imports alphabetically
38 Group:          Libraries/Python
39 Requires:       python3-modules
40
41 %description -n python3-%{module}
42 isort is a Python utility / library to sort imports alphabetically,
43 and automatically separated into sections. It provides a command line
44 utility, Python library and plugins for various editors to quickly
45 sort all your imports. It currently cleanly supports Python 2.7 - 3.6
46 without any dependencies.
47
48 %package -n isort
49 Summary:        Python utility / library to sort imports alphabetically
50 Group:          Development/Tools
51 %if %{with python3}
52 Requires:       python3-%{module} = %{version}-%{release}
53 %else
54 Requires:       python-%{module} = %{version}-%{release}
55 %endif
56
57 %description -n isort
58 isort is a Python utility / library to sort imports alphabetically,
59 and automatically separated into sections. It provides a command line
60 utility, Python library and plugins for various editors to quickly
61 sort all your imports. It currently cleanly supports Python 2.7 - 3.6
62 without any dependencies.
63
64 %prep
65 %setup -q -n %{module}-%{version}
66
67 %build
68 %if %{with python2}
69 %py_build %{?with_tests:test}
70 %endif
71
72 %if %{with python3}
73 %py3_build %{?with_tests:test}
74 %endif
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78
79 %if %{with python2}
80 %py_install
81
82 # when files are installed in other way that standard 'setup.py
83 # they need to be (re-)compiled
84 # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages!
85 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
86 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
87
88 %py_postclean
89 %endif
90
91 %if %{with python3}
92 %py3_install
93 %endif
94
95 %clean
96 rm -rf $RPM_BUILD_ROOT
97
98 %if %{with python2}
99 %files
100 %defattr(644,root,root,755)
101 %doc ACKNOWLEDGEMENTS.md CHANGELOG.md README.rst
102 %{py_sitescriptdir}/%{module}
103 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
104 %endif
105
106 %if %{with python3}
107 %files -n python3-%{module}
108 %defattr(644,root,root,755)
109 %doc ACKNOWLEDGEMENTS.md CHANGELOG.md README.rst
110 %{py3_sitescriptdir}/%{module}
111 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
112 %endif
113
114 %files -n isort
115 %defattr(644,root,root,755)
116 %attr(755,root,root) %{_bindir}/isort
This page took 0.121992 seconds and 4 git commands to generate.