3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 Summary: Filesystem abstraction layer for Python 2
9 Summary(pl.UTF-8): Warstwa abstrakcji systemu plików dla Pythona 2
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/fs/
16 Source0: https://files.pythonhosted.org/packages/source/f/fs/fs-%{version}.tar.gz
17 # Source0-md5: 2c9dae3d52950407fe265c3576396c33
18 URL: https://pypi.org/project/fs/
19 %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
20 BuildRequires: glibc-localedb-all
23 BuildRequires: python-modules >= 1:2.7
24 BuildRequires: python-setuptools >= 1:38.3.0
26 BuildRequires: python-appdirs >= 1.4.3
27 BuildRequires: python-backports.os >= 0.1
28 BuildRequires: python-enum34 >= 1.1.6
29 BuildRequires: python-mock >= 3.0
30 BuildRequires: python-parameterized >= 0.8
31 BuildRequires: python-psutil >= 5.0
32 BuildRequires: python-pyftpdlib >= 1.5
33 BuildRequires: python-pysendfile >= 2.0
34 BuildRequires: python-pytest >= 4.6
35 BuildRequires: python-pytest-randomly >= 1.2
36 BuildRequires: python-pytz
37 BuildRequires: python-scandir >= 1.5
38 BuildRequires: python-six >= 1.10.0
39 BuildRequires: python-typing >= 3.6
43 BuildRequires: python3-modules >= 1:3.4
44 BuildRequires: python3-setuptools >= 1:38.3.0
46 BuildRequires: python3-appdirs >= 1.4.3
47 BuildRequires: python3-parameterized >= 0.8
48 BuildRequires: python3-psutil >= 5.0
49 BuildRequires: python3-pyftpdlib >= 1.5
50 BuildRequires: python3-pytest >= 4.6
51 BuildRequires: python3-pytest-randomly >= 1.2
52 BuildRequires: python3-pytz
53 %if "%{ver_lt '%{py3_ver}' '3.5'}" == "1"
54 BuildRequires: python3-scandir >= 1.5
56 BuildRequires: python3-six >= 1.10.0
57 %if "%{ver_lt '%{py3_ver}' '3.6'}" == "1"
58 BuildRequires: python3-typing >= 3.6
63 BuildRequires: python3-recommonmark >= 0.6
64 BuildRequires: python3-sphinx_rtd_theme >= 0.5.1
65 BuildRequires: sphinx-pdg-3 >= 3.0
67 BuildRequires: rpm-pythonprov
68 BuildRequires: rpmbuild(macros) >= 1.714
69 Requires: python-modules >= 1:2.7
71 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74 A filesystem abstraction library, successor to PyFilesystem.
76 %description -l pl.UTF-8
77 Biblioteka abstrakcji systemu plików, następca PyFilesystem.
79 %package -n python3-fs
80 Summary: Filesystem abstraction layer for Python 3
81 Summary(pl.UTF-8): Warstwa abstrakcji systemu plików dla Pythona 3
82 Group: Libraries/Python
83 Requires: python3-modules >= 1:3.4
85 %description -n python3-fs
86 A filesystem abstraction library, successor to PyFilesystem.
88 %description -n python3-fs -l pl.UTF-8
89 Biblioteka abstrakcji systemu plików, następca PyFilesystem.
92 Summary: API documentation for Python fs module
93 Summary(pl.UTF-8): Dokumentacja API modułu Pythona fs
97 API documentation for Python fs module.
99 %description apidocs -l pl.UTF-8
100 Dokumentacja API modułu Pythona fs.
103 %setup -q -n fs-%{version}
105 # relies on pyftpdlib tests
106 %{__rm} tests/test_ftpfs.py
113 # 3 tests apparently fail with python2.7
115 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
117 %{__python} -m pytest tests \
118 -k 'not test_move_file_same_fs_read_only_source and not test_move_dir and not test_move_file'
119 # -k 'not TestMove.test_move_file_same_fs_read_only_source and not TestWrapReadOnlySyspath.test_move_dir and not TestWrapReadOnlySyspath.test_move_file'
127 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
129 %{__python3} -m pytest tests
134 %{__make} -C docs html \
135 SPHINXBUILD=sphinx-build-3
139 rm -rf $RPM_BUILD_ROOT
152 rm -rf $RPM_BUILD_ROOT
156 %defattr(644,root,root,755)
157 %doc LICENSE README.md
158 %{py_sitescriptdir}/fs
159 %{py_sitescriptdir}/fs-%{version}-py*.egg-info
164 %defattr(644,root,root,755)
165 %doc LICENSE README.md
166 %{py3_sitescriptdir}/fs
167 %{py3_sitescriptdir}/fs-%{version}-py*.egg-info
172 %defattr(644,root,root,755)
173 %doc docs/build/html/{_modules,_static,reference,*.html,*.js}