]>
Commit | Line | Data |
---|---|---|
b3ea5b35 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
a57c4d1f | 4 | %bcond_with python3 # CPython 3.x module (built from python3-path.spec) |
b3ea5b35 JB |
5 | %bcond_without doc # Sphinx documentation |
6 | %bcond_without tests # py.test unit tests | |
bd259503 | 7 | |
b3ea5b35 JB |
8 | Summary: Python 2 module wrapper for os.path |
9 | Summary(pl.UTF-8): Moduł Pythona 2 obudowujący os.path | |
bd259503 | 10 | Name: python-path |
045df15a JB |
11 | # keep 11.x here for python2 support |
12 | Version: 11.5.2 | |
34a1d6d1 | 13 | Release: 4 |
b3ea5b35 | 14 | License: MIT |
bd259503 | 15 | Group: Libraries/Python |
bdd88fba JB |
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 | |
045df15a | 18 | # Source0-md5: f7330990e70574d917630c157eeb639a |
b3ea5b35 | 19 | URL: https://github.com/jaraco/path.py |
bdd88fba | 20 | %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?) |
b3ea5b35 JB |
21 | BuildRequires: glibc-localedb-all |
22 | %endif | |
23 | %if %{with python2} | |
24 | BuildRequires: python >= 1:2.7 | |
25 | BuildRequires: python-modules >= 1:2.7 | |
045df15a | 26 | BuildRequires: python-setuptools >= 1:31.0.1 |
b3ea5b35 JB |
27 | BuildRequires: python-setuptools_scm >= 1.15.0 |
28 | %if %{with tests} | |
29 | BuildRequires: python-appdirs | |
045df15a JB |
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 | |
bdd88fba | 35 | BuildRequires: python-pytest-flake8 |
b3ea5b35 JB |
36 | %endif |
37 | %endif | |
38 | %if %{with python3} | |
bdd88fba JB |
39 | BuildRequires: python3 >= 1:3.4 |
40 | BuildRequires: python3-modules >= 1:3.4 | |
045df15a | 41 | BuildRequires: python3-setuptools >= 1:31.0.1 |
b3ea5b35 JB |
42 | BuildRequires: python3-setuptools_scm >= 1.15.0 |
43 | %if %{with tests} | |
44 | BuildRequires: python3-appdirs | |
045df15a JB |
45 | BuildRequires: python3-importlib_metadata >= 0.5 |
46 | BuildRequires: python3-packaging | |
47 | BuildRequires: python3-pygments | |
48 | BuildRequires: python3-pytest >= 3.5 | |
bdd88fba | 49 | BuildRequires: python3-pytest-flake8 |
b3ea5b35 JB |
50 | %endif |
51 | %endif | |
49131dd8 | 52 | BuildRequires: rpm-pythonprov |
b3ea5b35 JB |
53 | BuildRequires: rpmbuild(macros) >= 1.714 |
54 | %if %{with doc} | |
045df15a JB |
55 | BuildRequires: sphinx-pdg-2 |
56 | BuildRequires: python-alabaster | |
57 | BuildRequires: python-jaraco.packaging >= 3.2 | |
58 | BuildRequires: python-rst.linker >= 1.9 | |
b3ea5b35 JB |
59 | %endif |
60 | Requires: python-modules >= 1:2.7 | |
bd259503 | 61 | BuildArch: noarch |
10ccf03a | 62 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
bd259503 JB |
63 | |
64 | %description | |
b3ea5b35 JB |
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. | |
bd259503 | 68 | |
170d9002 | 69 | %description -l pl.UTF-8 |
b3ea5b35 JB |
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 | |
bdd88fba | 78 | Requires: python3-modules >= 1:3.4 |
b3ea5b35 JB |
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. | |
bd259503 JB |
100 | |
101 | %prep | |
b3ea5b35 | 102 | %setup -q -n path.py-%{version} |
b3ea5b35 JB |
103 | |
104 | %build | |
105 | %if %{with python2} | |
106 | %py_build | |
107 | ||
108 | %if %{with tests} | |
bdd88fba | 109 | LC_ALL=C.UTF-8 \ |
045df15a JB |
110 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
111 | PYTEST_PLUGINS="pytest_flake8" \ | |
bdd88fba | 112 | %{__python} -m pytest test_path.py |
b3ea5b35 JB |
113 | %endif |
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
117 | %py3_build | |
118 | ||
119 | %if %{with tests} | |
bdd88fba | 120 | LC_ALL=C.UTF-8 \ |
045df15a JB |
121 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
122 | PYTEST_PLUGINS="pytest_flake8" \ | |
bdd88fba | 123 | %{__python3} -m pytest test_path.py |
b3ea5b35 JB |
124 | %endif |
125 | %endif | |
126 | ||
127 | %if %{with doc} | |
69bf8988 JB |
128 | # disable warnings (-W in SPHINXOPTS) to ignore objects.inv fetching error on builders |
129 | %{__make} -C docs html \ | |
045df15a | 130 | SPHINXBUILD=sphinx-build-2 \ |
69bf8988 | 131 | SPHINXOPTS= |
b3ea5b35 | 132 | %endif |
bd259503 JB |
133 | |
134 | %install | |
135 | rm -rf $RPM_BUILD_ROOT | |
136 | ||
b3ea5b35 JB |
137 | %if %{with python2} |
138 | %py_install | |
139 | ||
140 | %py_postclean | |
b3ea5b35 | 141 | %endif |
bd259503 | 142 | |
b3ea5b35 JB |
143 | %if %{with python3} |
144 | %py3_install | |
b3ea5b35 | 145 | %endif |
bd259503 JB |
146 | |
147 | %clean | |
148 | rm -rf $RPM_BUILD_ROOT | |
149 | ||
b3ea5b35 | 150 | %if %{with python2} |
bd259503 JB |
151 | %files |
152 | %defattr(644,root,root,755) | |
045df15a | 153 | %doc CHANGES.rst LICENSE README.rst |
b3ea5b35 JB |
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) | |
045df15a | 161 | %doc CHANGES.rst LICENSE README.rst |
b3ea5b35 JB |
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 |