[packages/python-railroad] - new; py3-requires patch to avoid mock and funcsigs dependencies for python3
qboosh
qboosh at pld-linux.org
Sat Mar 5 15:12:10 CET 2022
commit 408ecdb1dd1193876cc95466bb67552bef7db26b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Mar 5 15:14:03 2022 +0100
- new; py3-requires patch to avoid mock and funcsigs dependencies for python3
python-railroad-py3-requires.patch | 67 +++++++++++++++++++++
python-railroad.spec | 118 +++++++++++++++++++++++++++++++++++++
2 files changed, 185 insertions(+)
---
diff --git a/python-railroad.spec b/python-railroad.spec
new file mode 100644
index 0000000..e351ba6
--- /dev/null
+++ b/python-railroad.spec
@@ -0,0 +1,118 @@
+#
+# Conditional build:
+%bcond_without tests # unit tests
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
+Summary: Functional library for data processing
+Summary(pl.UTF-8): Biblioteka funkcyjna do przetwarzania danych
+Name: python-railroad
+Version: 0.5.0
+Release: 1
+License: MIT
+Group: Libraries/Python
+#Source0Download: https://pypi.org/simple/railroad/
+Source0: https://files.pythonhosted.org/packages/source/r/railroad/railroad-%{version}.tar.gz
+# Source0-md5: 861f7b6c59eb087a5f3fbfd1fee2c805
+Patch0: %{name}-py3-requires.patch
+URL: https://pypi.org/project/railroad/
+%if %{with python2}
+BuildRequires: python-modules >= 1:2.7
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-boltons >= 16.5.0
+BuildRequires: python-funcsigs >= 1.0.2
+BuildRequires: python-mock
+BuildRequires: python-pytest
+BuildRequires: python-six >= 1.7.3
+BuildRequires: python-toolz >= 0.7.4
+%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-modules >= 1:3.3
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-boltons >= 16.5.0
+BuildRequires: python3-pytest
+BuildRequires: python3-six >= 1.7.3
+BuildRequires: python3-toolz >= 0.7.4
+%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
+Functional library for data processing.
+
+%description -l pl.UTF-8
+Biblioteka funkcyjna do przetwarzania danych.
+
+%package -n python3-railroad
+Summary: Functional library for data processing
+Summary(pl.UTF-8): Biblioteka funkcyjna do przetwarzania danych
+Group: Libraries/Python
+Requires: python3-modules >= 1:3.3
+
+%description -n python3-railroad
+Functional library for data processing.
+
+%description -n python3-railroad -l pl.UTF-8
+Biblioteka funkcyjna do przetwarzania danych.
+
+%prep
+%setup -q -n railroad-%{version}
+%patch0 -p1
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+%{__python} -m pytest test
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+%{__python3} -m pytest test
+%endif
+%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 AUTHORS.rst HISTORY.rst LICENSE README.rst
+%{py_sitescriptdir}/railroad
+%{py_sitescriptdir}/railroad-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-railroad
+%defattr(644,root,root,755)
+%doc AUTHORS.rst HISTORY.rst LICENSE README.rst
+%{py3_sitescriptdir}/railroad
+%{py3_sitescriptdir}/railroad-%{version}-py*.egg-info
+%endif
diff --git a/python-railroad-py3-requires.patch b/python-railroad-py3-requires.patch
new file mode 100644
index 0000000..fadd2c6
--- /dev/null
+++ b/python-railroad-py3-requires.patch
@@ -0,0 +1,67 @@
+--- railroad-0.5.0/setup.py.orig 2016-08-19 16:45:11.000000000 +0200
++++ railroad-0.5.0/setup.py 2022-03-05 14:22:07.481864648 +0100
+@@ -42,7 +42,7 @@ setup(
+ install_requires=[
+ 'six>=1.7.3',
+ 'toolz>=0.7.4',
+- 'funcsigs>=1.0.2',
++ 'funcsigs>=1.0.2;python_version<"3.6"',
+ 'boltons>=16.5.0',
+ ],
+ license='MIT',
+--- railroad-0.5.0/test/test_railroad.py.orig 2015-08-27 12:59:27.000000000 +0200
++++ railroad-0.5.0/test/test_railroad.py 2022-03-05 14:23:56.067943054 +0100
+@@ -3,7 +3,10 @@ Tests for `railroad` module.
+ """
+ import pytest
+
+-from mock import Mock, call
++try:
++ from mock import Mock, call
++except ImportError:
++ from unittest.mock import Mock, call
+
+ from railroad import (
+ prepare,
+--- railroad-0.5.0/test/test_actions.py.orig 2016-07-12 18:25:15.000000000 +0200
++++ railroad-0.5.0/test/test_actions.py 2022-03-05 14:24:11.321193753 +0100
+@@ -2,7 +2,10 @@
+
+ from random import randint
+
+-from mock import Mock, call
++try:
++ from mock import Mock, call
++except ImportError:
++ from unittest.mock import Mock, call
+ from toolz import cons
+
+ from railroad import actions, lift, result
+--- railroad-0.5.0/test/test_guard.py.orig 2016-08-19 16:11:04.000000000 +0200
++++ railroad-0.5.0/test/test_guard.py 2022-03-05 14:24:27.607772188 +0100
+@@ -2,7 +2,10 @@
+
+ import pytest
+
+-from mock import Mock, call
++try:
++ from mock import Mock, call
++except ImportError:
++ from unittest.mock import Mock, call
+
+ from railroad import guard, GuardError
+
+--- railroad-0.5.0/test/test_rescue.py.orig 2016-07-05 19:43:04.000000000 +0200
++++ railroad-0.5.0/test/test_rescue.py 2022-03-05 14:24:39.324375380 +0100
+@@ -2,7 +2,10 @@
+
+ import pytest
+
+-from mock import Mock, call
++try:
++ from mock import Mock, call
++except ImportError:
++ from unittest.mock import Mock, call
+
+ from railroad import rescue
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-railroad.git/commitdiff/408ecdb1dd1193876cc95466bb67552bef7db26b
More information about the pld-cvs-commit
mailing list