]>
Commit | Line | Data |
---|---|---|
ef7bdd8f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # py.test unit tests | |
5 | ||
6 | Summary: Python 2 module wrapper for os.path | |
7 | Summary(pl.UTF-8): Moduł Pythona 2 obudowujący os.path | |
8 | Name: python3-path | |
b98409c9 | 9 | Version: 16.4.0 |
acc999da | 10 | Release: 3 |
ef7bdd8f JB |
11 | License: MIT |
12 | Group: Libraries/Python | |
13 | #Source0Download: https://pypi.python.org/simple/path/ | |
14 | Source0: https://files.pythonhosted.org/packages/source/p/path/path-%{version}.tar.gz | |
b98409c9 | 15 | # Source0-md5: a5b935b554ffa3889bb88fd19fc2669b |
ef7bdd8f JB |
16 | URL: https://github.com/jaraco/path |
17 | BuildRequires: python3 >= 1:3.6 | |
18 | BuildRequires: python3-modules >= 1:3.6 | |
19 | BuildRequires: python3-setuptools >= 1:31.0.1 | |
20 | BuildRequires: python3-setuptools_scm >= 3.4.1 | |
21 | BuildRequires: python3-toml | |
22 | %if %{with tests} | |
23 | BuildRequires: python3-appdirs | |
24 | BuildRequires: python3-packaging | |
25 | BuildRequires: python3-pygments | |
26 | BuildRequires: python3-pytest >= 3.5 | |
27 | BuildRequires: python3-pytest-black >= 0.3.7 | |
28 | BuildRequires: python3-pytest-cov | |
29 | BuildRequires: python3-pytest-flake8 | |
30 | %endif | |
31 | BuildRequires: rpm-pythonprov | |
32 | BuildRequires: rpmbuild(macros) >= 1.714 | |
33 | %if %{with doc} | |
34 | BuildRequires: sphinx-pdg-3 | |
ef7bdd8f | 35 | BuildRequires: python3-jaraco.packaging >= 8.2 |
b98409c9 JB |
36 | #BuildRequires: python3-jaraco.packaging >= 9 # when available |
37 | BuildRequires: python3-jaraco.tidelift >= 1.4 | |
ef7bdd8f JB |
38 | BuildRequires: python3-rst.linker >= 1.9 |
39 | %endif | |
40 | Requires: python3-modules >= 1:3.6 | |
41 | BuildArch: noarch | |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
44 | %description | |
45 | path implements a path objects as first-class entities, allowing | |
46 | common operations on files to be invoked on those path objects | |
47 | directly. | |
48 | ||
49 | %description -l pl.UTF-8 | |
50 | path implementuje obiekty ścieżek jako instancje pierwszoklasowe, | |
51 | pozwalające na wykonywanie ogólnych operacji na plikach bezpośrednio | |
52 | na tych ścieżkach. | |
53 | ||
54 | %package apidocs | |
55 | Summary: Documentation for Python path module | |
56 | Summary(pl.UTF-8): Dokumentacja modułu Pythona path | |
57 | Group: Documentation | |
58 | ||
59 | %description apidocs | |
60 | Documentation for Python path module. | |
61 | ||
62 | %description apidocs -l pl.UTF-8 | |
63 | Dokumentacja modułu Pythona path. | |
64 | ||
65 | %prep | |
66 | %setup -q -n path-%{version} | |
67 | ||
b98409c9 JB |
68 | # stub for setuptools |
69 | cat >setup.py <<EOF | |
70 | from setuptools import setup | |
71 | setup() | |
72 | EOF | |
73 | ||
ef7bdd8f JB |
74 | %build |
75 | %py3_build | |
76 | ||
77 | %if %{with tests} | |
78 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
79 | PYTEST_PLUGINS="pytest_black,pytest_cov.plugin,pytest_flake8" \ | |
80 | %{__python3} -m pytest test_path.py | |
81 | %endif | |
82 | ||
83 | %if %{with doc} | |
84 | # disable warnings (-W in SPHINXOPTS) to ignore objects.inv fetching error on builders | |
b98409c9 | 85 | PYTHONPATH=$(pwd) \ |
ef7bdd8f JB |
86 | %{__make} -C docs html \ |
87 | SPHINXBUILD=sphinx-build-3 \ | |
88 | SPHINXOPTS= | |
89 | %endif | |
90 | ||
91 | %install | |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
94 | %py3_install | |
95 | ||
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %doc CHANGES.rst LICENSE README.rst | |
102 | %{py3_sitescriptdir}/path | |
103 | %{py3_sitescriptdir}/path-%{version}-py*.egg-info | |
104 | ||
105 | %if %{with doc} | |
106 | %files apidocs | |
107 | %defattr(644,root,root,755) | |
108 | %doc docs/_build/html/{_static,*.html,*.js} | |
109 | %endif |