[packages/python-pycontracts] - new

qboosh qboosh at pld-linux.org
Sun Jun 29 11:41:54 CEST 2025


commit be1009c1d7f4e78dc6a6e53a60cc82675b944cbd
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Jun 29 11:43:12 2025 +0200

    - new

 python-pycontracts.spec | 164 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 164 insertions(+)
---
diff --git a/python-pycontracts.spec b/python-pycontracts.spec
new file mode 100644
index 0000000..60ec499
--- /dev/null
+++ b/python-pycontracts.spec
@@ -0,0 +1,164 @@
+#
+# Conditional build:
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
+%bcond_without	python2 # CPython 2.x module
+%bcond_with	python3 # CPython 3.x module (doesn't work properly with 3.9+)
+
+Summary:	Python package to declare constraints on function parameters and return values
+Summary(pl.UTF-8):	Pakiet Pythona do deklarowania ograniczeń na parametry funkcji i zwracane wartości
+Name:		python-pycontracts
+Version:	1.8.12
+Release:	1
+License:	LGPL v3
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/pycontracts/
+Source0:	https://files.pythonhosted.org/packages/source/p/pycontracts/PyContracts-%{version}.tar.gz
+# Source0-md5:	115db6de6493f5964496df7116231e50
+URL:		https://pypi.org/project/pycontracts/
+%if %{with python2}
+BuildRequires:	python-modules >= 1:2.5
+BuildRequires:	python-setuptools
+%if %{with tests}
+BuildRequires:	python-decorator
+BuildRequires:	python-future
+BuildRequires:	python-nose
+BuildRequires:	python-pyparsing
+BuildRequires:	python-six
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3-modules >= 1:3.2
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-decorator
+BuildRequires:	python3-pynose
+BuildRequires:	python3-pyparsing
+BuildRequires:	python3-six
+%endif
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+BuildRequires:	sed >= 4.0
+%if %{with doc}
+BuildRequires:	sphinx-pdg-2
+%endif
+Requires:	python-modules >= 1:2.5
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+PyContracts is a Python package that allows to declare constraints on
+function parameters and return values. It supports a basic type
+system, variables binding, arithmetic constraints, and has several
+specialized contracts (notably for Numpy arrays).
+
+%description -l pl.UTF-8
+PyContracts to pakiet Pythona pozwalający deklarować ograniczenia na
+parametry funkcji oraz zwracane wartości. Obsługuje podstawowy system
+typów, wiązania zmiennych, ograniczenia arytmetyczne i ma kilka
+specjalizowanych kontraktów (w szczególności dla tablic Numpy).
+
+%package -n python3-pycontracts
+Summary:	Python package to declare constraints on function parameters and return values
+Summary(pl.UTF-8):	Pakiet Pythona do deklarowania ograniczeń na parametry funkcji i zwracane wartości
+Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.2
+
+%description -n python3-pycontracts
+PyContracts is a Python package that allows to declare constraints on
+function parameters and return values. It supports a basic type
+system, variables binding, arithmetic constraints, and has several
+specialized contracts (notably for Numpy arrays).
+
+%description -n python3-pycontracts -l pl.UTF-8
+PyContracts to pakiet Pythona pozwalający deklarować ograniczenia na
+parametry funkcji oraz zwracane wartości. Obsługuje podstawowy system
+typów, wiązania zmiennych, ograniczenia arytmetyczne i ma kilka
+specjalizowanych kontraktów (w szczególności dla tablic Numpy).
+
+%package apidocs
+Summary:	API documentation for Python pycontracts module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona pycontracts
+Group:		Documentation
+
+%description apidocs
+API documentation for Python pycontracts module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona pycontracts.
+
+%prep
+%setup -q -n PyContracts-%{version}
+
+%{__sed} -i -e 's/sphinx\.ext\.pngmath/sphinx.ext.imgmath/' docs/source/conf.py
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+nosetests-%{py_ver} src --exclude-dir=src/contracts-py3k-test
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+nosetests-%{py3_ver} src
+%endif
+%endif
+
+%if %{with doc}
+sphinx-autogen-2 -o docs/source/api docs/source/*.rst
+sphinx-apidoc-2 -o docs/source/api src
+PYTHONPATH=$(pwd)/docs:$(pwd)/src \
+sphinx-build-2 -E -n -a -b html docs/source docs/_build/html
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}
+cp -pr demos $RPM_BUILD_ROOT%{_examplesdir}/python-pycontracts-%{version}
+%endif
+
+%if %{with python3}
+%py3_install
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}
+cp -pr demos $RPM_BUILD_ROOT%{_examplesdir}/python3-pycontracts-%{version}
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc README.rst
+%{py_sitescriptdir}/contracts
+%{py_sitescriptdir}/PyContracts-%{version}-py*.egg-info
+%{_examplesdir}/python-pycontracts-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-pycontracts
+%defattr(644,root,root,755)
+%doc README.rst
+%{py3_sitescriptdir}/contracts
+%{py3_sitescriptdir}/PyContracts-%{version}-py*.egg-info
+%{_examplesdir}/python3-pycontracts-%{version}
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{api,modules,static,*.html,*.js}
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pycontracts.git/commitdiff/be1009c1d7f4e78dc6a6e53a60cc82675b944cbd



More information about the pld-cvs-commit mailing list