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