]> git.pld-linux.org Git - SPECS.git/blob - python-setuptools_scm.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-setuptools_scm.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # py.test tests
4 %bcond_with     tests_scm       # py.test tests using SCM programs (git, hg)
5 %bcond_without  python2         # CPython 2.x module
6 %bcond_without  python3         # CPython 3.x module
7
8 Summary:        Python 2 package to manager versions by scm tags
9 Summary(pl.UTF-8):      Pakiet Pythona 2 do zarządzania wersjami poprzez etykiety systemu kontroli wersji
10 Name:           python-setuptools_scm
11 Version:        5.0.1
12 Release:        3
13 License:        MIT
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/setuptools_scm/
16 Source0:        https://files.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-%{version}.tar.gz
17 # Source0-md5:  c11bf23d80224691a46ee5deb84c42db
18 URL:            https://github.com/pypa/setuptools_scm
19 %if %{with python2}
20 BuildRequires:  python-modules >= 1:2.7
21 BuildRequires:  python-setuptools >= 42
22 %if %{with tests}
23 BuildRequires:  python-py >= 1.4.26
24 BuildRequires:  python-pytest >= 3.1.0
25 BuildRequires:  python-toml
26 %endif
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-modules >= 1:3.5
30 BuildRequires:  python3-setuptools >= 42
31 %if %{with tests}
32 BuildRequires:  python3-py >= 1.4.26
33 BuildRequires:  python3-pytest >= 3.1.0
34 BuildRequires:  python3-toml
35 %endif
36 %endif
37 BuildRequires:  rpm-pythonprov
38 BuildRequires:  rpmbuild(macros) >= 1.714
39 %if %{with tests_scm}
40 BuildRequires:  git-core
41 BuildRequires:  mercurial
42 %endif
43 Requires:       python-setuptools
44 Requires:       python-toml
45 BuildArch:      noarch
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %description
49 setuptools_scm is a simple utility for the setup_requires feature of
50 setuptools for use in Mercurial and Git based projects.
51
52 %description -l pl.UTF-8
53 setuptools_scm to proste narzędzie dla funkcji setup_requires modułu
54 setuptools przeznaczone do stosowania w projektach opatych na
55 systemach kontroli wersji Mercurial i Git.
56
57 %package -n python3-setuptools_scm
58 Summary:        Python 3 package to manager versions by scm tags
59 Summary(pl.UTF-8):      Pakiet Pythona 3 do zarządzania wersjami poprzez etykiety systemu kontroli wersji
60 Group:          Libraries/Python
61 Requires:       python3-setuptools
62 Requires:       python3-toml
63
64 %description -n python3-setuptools_scm
65 setuptools_scm is a simple utility for the setup_requires feature of
66 setuptools for use in Mercurial and Git based projects.
67
68 %description -n python3-setuptools_scm -l pl.UTF-8
69 setuptools_scm to proste narzędzie dla funkcji setup_requires modułu
70 setuptools przeznaczone do stosowania w projektach opatych na
71 systemach kontroli wersji Mercurial i Git.
72
73 %prep
74 %setup -q -n setuptools_scm-%{version}
75
76 %if %{without tests_scm}
77 %{__rm} testing/test_{file_finder,git,mercurial,regressions}.py
78 %endif
79
80 # tries to install using pip
81 %{__rm} testing/test_setuptools_support.py
82
83 %build
84 %if %{with python2}
85 %py_build
86
87 %if %{with tests}
88 PYTHONPATH=$(pwd)/src \
89 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
90 %{__python} -m pytest testing
91 %endif
92 %endif
93
94 %if %{with python3}
95 %py3_build
96
97 %if %{with tests}
98 PYTHONPATH=$(pwd)/src \
99 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
100 %{__python3} -m pytest testing
101 %endif
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python2}
108 %py_install
109
110 %py_postclean
111 %endif
112
113 %if %{with python3}
114 %py3_install
115 %endif
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %if %{with python2}
121 %files
122 %defattr(644,root,root,755)
123 %doc CHANGELOG.rst LICENSE README.rst
124 %{py_sitescriptdir}/setuptools_scm
125 %{py_sitescriptdir}/setuptools_scm-%{version}-py*.egg-info
126 %endif
127
128 %if %{with python3}
129 %files -n python3-setuptools_scm
130 %defattr(644,root,root,755)
131 %doc CHANGELOG.rst LICENSE README.rst
132 %{py3_sitescriptdir}/setuptools_scm
133 %{py3_sitescriptdir}/setuptools_scm-%{version}-py*.egg-info
134 %endif
This page took 2.404985 seconds and 3 git commands to generate.