#
# Conditional build:
-%bcond_without tests # do not perform "make test"
+%bcond_with tests # unit tests (some failing)
%bcond_without python2 # CPython 2.x module
%bcond_without python3 # CPython 3.x module
Summary: Filesystem abstraction layer for Python 2
Summary(pl.UTF-8): Warstwa abstrakcji systemu plików dla Pythona 2
Name: python-fs
-Version: 2.0.2
-Release: 2
-License: BSD
+Version: 2.4.11
+Release: 1
+License: MIT
Group: Libraries/Python
-#Source0Download: https://pypi.python.org/simple/fs/
+#Source0Download: https://pypi.org/simple/fs/
Source0: https://files.pythonhosted.org/packages/source/f/fs/fs-%{version}.tar.gz
-# Source0-md5: 419760a993e45a585e5db939e731d435
+# Source0-md5: 01b2e57b3622aa49cbaa668c81a87cb7
Patch0: %{name}-py3-requires.patch
-URL: https://pypi.python.org/pypi/fs/
-%if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?)
+URL: https://pypi.org/project/fs/
+%if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
BuildRequires: glibc-localedb-all
%endif
%if %{with python2}
BuildRequires: python-modules >= 1:2.7
BuildRequires: python-setuptools
%if %{with tests}
-BuildRequires: python-appdirs >= 1.4.0
+BuildRequires: python-appdirs >= 1.4.3
+BuildRequires: python-backports.os >= 0.1
BuildRequires: python-enum34 >= 1.1.6
BuildRequires: python-mock
BuildRequires: python-pyftpdlib
BuildRequires: python-pytz
BuildRequires: python-scandir >= 1.5
BuildRequires: python-six >= 1.10.0
+BuildRequires: python-typing >= 3.6
%endif
%endif
%if %{with python3}
-BuildRequires: python3-modules >= 1:3.3
+BuildRequires: python3-modules >= 1:3.4
BuildRequires: python3-setuptools
%if %{with tests}
-BuildRequires: python3-appdirs >= 1.4.0
-%if "%{py3_ver}" < "3.4"
-BuildRequires: python3-enum34 >= 1.1.6
-%endif
-#BuildRequires: python3-mock
+BuildRequires: python3-appdirs >= 1.4.3
BuildRequires: python3-pyftpdlib
BuildRequires: python3-pytz
%if "%{py3_ver}" < "3.5"
BuildRequires: python3-scandir >= 1.5
%endif
BuildRequires: python3-six >= 1.10.0
+%if "%{py3_ver}" < "3.6"
+BuildRequires: python3-typing >= 3.6
+%endif
%endif
%endif
BuildRequires: rpm-pythonprov
Summary: Filesystem abstraction layer for Python 3
Summary(pl.UTF-8): Warstwa abstrakcji systemu plików dla Pythona 3
Group: Libraries/Python
-Requires: python3-modules >= 1:3.3
+Requires: python3-modules >= 1:3.4
%description -n python3-fs
A filesystem abstraction library, successor to PyFilesystem.
%setup -q -n fs-%{version}
%patch0 -p1
-%build
-# for tests
-export PYTHONPATH=$(pwd) LC_ALL=C.UTF-8
+# relies on pyftpdlib tests
+%{__rm} tests/test_ftpfs.py
+%build
%if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+%if %{with tests}
+LC_ALL=C.UTF-8 PYTHONPATH=$(pwd) \
+%{__python} -m unittest discover -s tests
+%endif
%endif
%if %{with python3}
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+LC_ALL=C.UTF-8 PYTHONPATH=$(pwd) \
+%{__python3} -m unittest discover -s tests
+%endif
%endif
%install
%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc README.txt
+%doc LICENSE README.md
%{py_sitescriptdir}/fs
%{py_sitescriptdir}/fs-%{version}-py*.egg-info
%endif
%if %{with python3}
%files -n python3-fs
%defattr(644,root,root,755)
-%doc README.txt
+%doc LICENSE README.md
%{py3_sitescriptdir}/fs
%{py3_sitescriptdir}/fs-%{version}-py*.egg-info
%endif