]> git.pld-linux.org Git - packages/python-fields.git/commitdiff
- new
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 9 Dec 2018 13:57:09 +0000 (14:57 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 9 Dec 2018 13:57:09 +0000 (14:57 +0100)
python-fields-docs.patch [new file with mode: 0644]
python-fields-tests.patch [new file with mode: 0644]
python-fields.spec [new file with mode: 0644]

diff --git a/python-fields-docs.patch b/python-fields-docs.patch
new file mode 100644 (file)
index 0000000..25bd0c0
--- /dev/null
@@ -0,0 +1,12 @@
+napoleon is included in sphinx >= 1.3 as ext.napoleon
+--- fields-5.0.0/docs/conf.py.orig     2016-04-13 22:51:23.000000000 +0200
++++ fields-5.0.0/docs/conf.py  2018-08-01 22:09:38.229491885 +0200
+@@ -11,7 +11,7 @@
+     'sphinx.ext.coverage',
+     'sphinx.ext.ifconfig',
+     'sphinx.ext.viewcode',
+-    'sphinxcontrib.napoleon'
++    'sphinx.ext.napoleon'
+ ]
+ if os.getenv('SPELLCHECK'):
+     extensions += 'sphinxcontrib.spelling',
diff --git a/python-fields-tests.patch b/python-fields-tests.patch
new file mode 100644 (file)
index 0000000..6f3b837
--- /dev/null
@@ -0,0 +1,10 @@
+--- fields-5.0.0/setup.cfg.orig        2016-04-13 22:51:43.000000000 +0200
++++ fields-5.0.0/setup.cfg     2018-08-02 05:39:20.335850460 +0200
+@@ -31,7 +31,6 @@
+       --doctest-modules
+       --doctest-glob=\*.rst
+       --tb=short
+-      --benchmark-disable
+ [isort]
+ force_single_line = True
diff --git a/python-fields.spec b/python-fields.spec
new file mode 100644 (file)
index 0000000..8ca8720
--- /dev/null
@@ -0,0 +1,163 @@
+#
+# Conditional build:
+%bcond_without doc     # Sphinx documentation
+%bcond_without tests   # unit tests
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
+Summary:       Container class boilerplate killer
+Summary(pl.UTF-8):     Zabójca ramowego kodu klas kontenerów
+Name:          python-fields
+Version:       5.0.0
+Release:       1
+License:       BSD
+Group:         Libraries/Python
+#Source0Download: https://pypi.org/simple/fields/
+Source0:       https://files.pythonhosted.org/packages/source/f/fields/fields-%{version}.tar.gz
+# Source0-md5: 4b3a60ddaad146f698979cf4da2639d4
+Patch0:                %{name}-docs.patch
+Patch1:                %{name}-tests.patch
+URL:           https://github.com/ionelmc/python-fields
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with python2}
+BuildRequires: python-modules >= 1:2.6
+BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-pytest
+BuildRequires: python-pytest-benchmark
+%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-modules >= 1:3.3
+BuildRequires: python3-setuptools
+%if %{with tests}
+BuildRequires: python3-pytest
+BuildRequires: python3-pytest-benchmark
+%endif
+%endif
+%if %{with doc}
+BuildRequires: python3-sphinx_py3doc_enhanced_theme
+# with sphinx.ext.napoleon
+BuildRequires: sphinx-pdg-3 >= 1.3
+%endif
+Requires:      python-modules >= 1:2.6
+BuildArch:     noarch
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Container class boilerplate killer. Features:
+- Human-readable __repr__
+- Complete set of comparison methods
+- Keyword and positional argument support. Works like a normal class -
+  you can override just about anything in the subclass (eg: a custom
+  __init__).
+
+%description -l pl.UTF-8
+Zabójca ramowego kodu klas kontenerów. Możliwości:
+- __repr__ czytelne dla człowieka
+- pełny zbiór metod porównujących
+- obsługa argumentów pozycyjnych i słownikowych; działa jak zwykła
+  klasa - można przeciążać prawie wszystko w podklasie (np. własny
+  __init__).
+
+%package -n python3-fields
+Summary:       Container class boilerplate killer
+Summary(pl.UTF-8):     Zabójca ramowego kodu klas kontenerów
+Group:         Libraries/Python
+Requires:      python3-modules >= 1:3.3
+
+%description -n python3-fields
+Container class boilerplate killer. Features:
+- Human-readable __repr__
+- Complete set of comparison methods
+- Keyword and positional argument support. Works like a normal class -
+  you can override just about anything in the subclass (eg: a custom
+  __init__).
+
+%description -n python3-fields -l pl.UTF-8
+Zabójca ramowego kodu klas kontenerów. Możliwości:
+- __repr__ czytelne dla człowieka
+- pełny zbiór metod porównujących
+- obsługa argumentów pozycyjnych i słownikowych; działa jak zwykła
+  klasa - można przeciążać prawie wszystko w podklasie (np. własny
+  __init__).
+
+%package apidocs
+Summary:       API documentation for Python fields module
+Summary(pl.UTF-8):     Dokumentacja API modułu Pythona fields
+Group:         Documentation
+
+%description apidocs
+API documentation for Python fields module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona fields.
+
+%prep
+%setup -q -n fields-%{version}
+%patch0 -p1
+%patch1 -p1
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd)/src \
+%{__python} -m pytest tests
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd)/src \
+%{__python3} -m pytest tests
+%endif
+%endif
+
+%if %{with doc}
+cd docs
+PYTHONPATH=$(pwd)/../src \
+sphinx-build-3 -b html . _build/html
+%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 CHANGELOG.rst LICENSE README.rst
+%{py_sitescriptdir}/fields
+%{py_sitescriptdir}/fields-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-fields
+%defattr(644,root,root,755)
+%doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
+%{py3_sitescriptdir}/fields
+%{py3_sitescriptdir}/fields-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_modules,_static,reference,*.html,*.js}
+%endif
This page took 0.107641 seconds and 4 git commands to generate.