[packages/python-fs] - new - added py3-requires patch to avoid unnecessary standalone modules with python 3.3-3.5 and fix
qboosh
qboosh at pld-linux.org
Sun Apr 2 09:46:18 CEST 2017
commit 20ef4f7885e00aee2a959c816dabdc60db8e32b8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Apr 2 09:42:07 2017 +0200
- new
- added py3-requires patch to avoid unnecessary standalone modules with python 3.3-3.5 and fix PLD dependency generation
python-fs-py3-requires.patch | 71 ++++++++++++++++++++++++++
python-fs.spec | 119 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 190 insertions(+)
---
diff --git a/python-fs.spec b/python-fs.spec
new file mode 100644
index 0000000..79f98f7
--- /dev/null
+++ b/python-fs.spec
@@ -0,0 +1,119 @@
+#
+# Conditional build:
+%bcond_without tests # do not perform "make test"
+%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.1
+Release: 1
+License: BSD
+Group: Libraries/Python
+#Source0Download: https://pypi.python.org/simple/fs/
+Source0: https://files.pythonhosted.org/packages/source/f/fs/fs-%{version}.tar.gz
+# Source0-md5: 7e2c2d22b96ca0b0fbf8c0d1c8e5fd81
+Patch0: %{name}-py3-requires.patch
+URL: https://pypi.python.org/pypi/fs/
+%if %{with python2}
+BuildRequires: python-modules >= 1:2.7
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-appdirs >= 1.4.0
+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
+%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-modules >= 1:3.3
+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-pyftpdlib
+BuildRequires: python3-pytz
+%if "%{py3_ver}" < "3.5"
+BuildRequires: python3-scandir >= 1.5
+%endif
+BuildRequires: python3-six >= 1.10.0
+%endif
+%endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+Requires: python-modules >= 1:2.7
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+A filesystem abstraction library, successor to PyFilesystem.
+
+%description -l pl.UTF-8
+Biblioteka abstrakcji systemu plików, następca PyFilesystem.
+
+%package -n python3-fs
+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
+
+%description -n python3-fs
+A filesystem abstraction library, successor to PyFilesystem.
+
+%description -n python3-fs -l pl.UTF-8
+Biblioteka abstrakcji systemu plików, następca PyFilesystem.
+
+%prep
+%setup -q -n fs-%{version}
+%patch0 -p1 -b .orig
+
+%build
+# for tests
+export PYTHONPATH=$(pwd)
+
+%if %{with python2}
+%py_build %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%py3_build %{?with_tests:test}
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc README.txt
+%{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
+%{py3_sitescriptdir}/fs
+%{py3_sitescriptdir}/fs-%{version}-py*.egg-info
+%endif
diff --git a/python-fs-py3-requires.patch b/python-fs-py3-requires.patch
new file mode 100644
index 0000000..a2e76e6
--- /dev/null
+++ b/python-fs-py3-requires.patch
@@ -0,0 +1,71 @@
+--- fs-2.0.1/tests/test_osfs.py.orig 2016-12-06 00:55:46.000000000 +0100
++++ fs-2.0.1/tests/test_osfs.py 2017-04-02 08:12:15.073189718 +0200
+@@ -2,7 +2,10 @@
+
+ import io
+ import os
+-import mock
++try:
++ import mock
++except ImportError:
++ from unittest import mock
+ import shutil
+ import tempfile
+ import unittest
+--- fs-2.0.1/tests/test_tempfs.py.orig 2016-10-14 21:17:36.000000000 +0200
++++ fs-2.0.1/tests/test_tempfs.py 2017-04-02 08:12:57.226522570 +0200
+@@ -4,7 +4,10 @@
+
+ from fs.tempfs import TempFS
+ from fs import errors
+-import mock
++try:
++ import mock
++except ImportError:
++ from unittest import mock
+
+ from .test_osfs import TestOSFS
+
+--- fs-2.0.1/setup.py.orig 2017-03-11 21:31:26.000000000 +0100
++++ fs-2.0.1/setup.py 2017-04-02 09:06:19.216486011 +0200
+@@ -1,5 +1,6 @@
+ #!/usr/bin/env python
+
++import sys
+ from setuptools import setup, find_packages
+
+ with open('fs/_version.py') as f:
+@@ -23,12 +24,11 @@
+ DESCRIPTION = f.read()
+
+ REQUIREMENTS = [
+- "appdirs~=1.4.0",
+- "enum34~=1.1.6",
++ "appdirs>=1.4.0",
+ "pytz",
+ "setuptools",
+- "six~=1.10.0",
+-]
++ "six>=1.10.0",
++] + (["enum34>=1.1.6"] if sys.version_info[:2] < (3, 4) else []) + (["scandir>=1.5"] if sys.version_info[:2] < (3, 5) else [])
+
+ setup(
+ author="Will McGugan",
+@@ -36,16 +36,13 @@
+ classifiers=CLASSIFIERS,
+ description="Filesystem abstraction layer",
+ install_requires=REQUIREMENTS,
+- extras_require={
+- ":python_version<'3.5'": ['scandir~=1.5'],
+- },
+ license="BSD",
+ long_description=DESCRIPTION,
+ name='fs',
+ packages=find_packages(exclude=("tests",)),
+ platforms=['any'],
+ test_suite="nose.collector",
+- tests_require=['appdirs', 'mock', 'pytz', 'pyftpdlib'],
++ tests_require=['appdirs', 'pytz', 'pyftpdlib'] + (['mock'] if sys.version_info[:2] < (3, 3) else []),
+ url="http://pypi.python.org/pypi/fs/",
+ version=__version__,
+ )
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-fs.git/commitdiff/20ef4f7885e00aee2a959c816dabdc60db8e32b8
More information about the pld-cvs-commit
mailing list