]> git.pld-linux.org Git - packages/python-path.git/blob - python-path.spec
- release 2 (by relup.sh)
[packages/python-path.git] / python-path.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  doc     # Sphinx documentation
6 %bcond_without  tests   # py.test unit tests
7
8 Summary:        Python 2 module wrapper for os.path
9 Summary(pl.UTF-8):      Moduł Pythona 2 obudowujący os.path
10 Name:           python-path
11 # keep 11.x here for python2 support
12 Version:        11.5.2
13 Release:        2
14 License:        MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.python.org/simple/path-py/
17 Source0:        https://files.pythonhosted.org/packages/source/p/path.py/path.py-%{version}.tar.gz
18 # Source0-md5:  f7330990e70574d917630c157eeb639a
19 URL:            https://github.com/jaraco/path.py
20 %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
21 BuildRequires:  glibc-localedb-all
22 %endif
23 %if %{with python2}
24 BuildRequires:  python >= 1:2.7
25 BuildRequires:  python-modules >= 1:2.7
26 BuildRequires:  python-setuptools >= 1:31.0.1
27 BuildRequires:  python-setuptools_scm >= 1.15.0
28 %if %{with tests}
29 BuildRequires:  python-appdirs
30 BuildRequires:  python-backports.os
31 BuildRequires:  python-importlib_metadata >= 0.5
32 BuildRequires:  python-packaging
33 BuildRequires:  python-pygments
34 BuildRequires:  python-pytest >= 3.5
35 BuildRequires:  python-pytest-flake8
36 %endif
37 %endif
38 %if %{with python3}
39 BuildRequires:  python3 >= 1:3.4
40 BuildRequires:  python3-modules >= 1:3.4
41 BuildRequires:  python3-setuptools >= 1:31.0.1
42 BuildRequires:  python3-setuptools_scm >= 1.15.0
43 %if %{with tests}
44 BuildRequires:  python3-appdirs
45 BuildRequires:  python3-importlib_metadata >= 0.5
46 BuildRequires:  python3-packaging
47 BuildRequires:  python3-pygments
48 BuildRequires:  python3-pytest >= 3.5
49 BuildRequires:  python3-pytest-flake8
50 %endif
51 %endif
52 BuildRequires:  rpm-pythonprov
53 BuildRequires:  rpmbuild(macros) >= 1.714
54 %if %{with doc}
55 BuildRequires:  sphinx-pdg-2
56 BuildRequires:  python-alabaster
57 BuildRequires:  python-jaraco.packaging >= 3.2
58 BuildRequires:  python-rst.linker >= 1.9
59 %endif
60 Requires:       python-modules >= 1:2.7
61 BuildArch:      noarch
62 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63
64 %description
65 path.py implements a path objects as first-class entities, allowing
66 common operations on files to be invoked on those path objects
67 directly.
68
69 %description -l pl.UTF-8
70 path.py implementuje obiekty ścieżek jako instancje pierwszoklasowe,
71 pozwalające na wykonywanie ogólnych operacji na plikach bezpośrednio
72 na tych ścieżkach.
73
74 %package -n python3-path
75 Summary:        Python 3 module wrapper for os.path
76 Summary(pl.UTF-8):      Moduł Pythona 3 obudowujący os.path
77 Group:          Libraries/Python
78 Requires:       python3-modules >= 1:3.4
79
80 %description -n python3-path
81 path.py implements a path objects as first-class entities, allowing
82 common operations on files to be invoked on those path objects
83 directly.
84
85 %description -n python3-path -l pl.UTF-8
86 path.py implementuje obiekty ścieżek jako instancje pierwszoklasowe,
87 pozwalające na wykonywanie ogólnych operacji na plikach bezpośrednio
88 na tych ścieżkach.
89
90 %package apidocs
91 Summary:        Documentation for Python path.py module
92 Summary(pl.UTF-8):      Dokumentacja modułu Pythona path.py
93 Group:          Documentation
94
95 %description apidocs
96 Documentation for Python path.py module.
97
98 %description apidocs -l pl.UTF-8
99 Dokumentacja modułu Pythona path.py.
100
101 %prep
102 %setup -q -n path.py-%{version}
103
104 %build
105 %if %{with python2}
106 %py_build
107
108 %if %{with tests}
109 LC_ALL=C.UTF-8 \
110 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
111 PYTEST_PLUGINS="pytest_flake8" \
112 %{__python} -m pytest test_path.py
113 %endif
114 %endif
115
116 %if %{with python3}
117 %py3_build
118
119 %if %{with tests}
120 LC_ALL=C.UTF-8 \
121 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
122 PYTEST_PLUGINS="pytest_flake8" \
123 %{__python3} -m pytest test_path.py
124 %endif
125 %endif
126
127 %if %{with doc}
128 # disable warnings (-W in SPHINXOPTS) to ignore objects.inv fetching error on builders
129 %{__make} -C docs html \
130         SPHINXBUILD=sphinx-build-2 \
131         SPHINXOPTS=
132 %endif
133
134 %install
135 rm -rf $RPM_BUILD_ROOT
136
137 %if %{with python2}
138 %py_install
139
140 %py_postclean
141 %endif
142
143 %if %{with python3}
144 %py3_install
145 %endif
146
147 %clean
148 rm -rf $RPM_BUILD_ROOT
149
150 %if %{with python2}
151 %files
152 %defattr(644,root,root,755)
153 %doc CHANGES.rst LICENSE README.rst
154 %{py_sitescriptdir}/path.py[co]
155 %{py_sitescriptdir}/path.py-%{version}-py*.egg-info
156 %endif
157
158 %if %{with python3}
159 %files -n python3-path
160 %defattr(644,root,root,755)
161 %doc CHANGES.rst LICENSE README.rst
162 %{py3_sitescriptdir}/path.py
163 %{py3_sitescriptdir}/__pycache__/path.cpython-*.py[co]
164 %{py3_sitescriptdir}/path.py-%{version}-py*.egg-info
165 %endif
166
167 %if %{with doc}
168 %files apidocs
169 %defattr(644,root,root,755)
170 %doc docs/_build/html/{_static,*.html,*.js}
171 %endif
This page took 0.132647 seconds and 3 git commands to generate.