[packages/python-deprecation] - pl, apidocs and tests; release 4
qboosh
qboosh at pld-linux.org
Sat Nov 15 10:45:29 CET 2025
commit 12fa413b73da93d9990df9bf1c011210dbee6b67
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Nov 15 10:45:22 2025 +0100
- pl, apidocs and tests; release 4
python-deprecation.spec | 90 ++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 82 insertions(+), 8 deletions(-)
---
diff --git a/python-deprecation.spec b/python-deprecation.spec
index 1fbd967..dbe4209 100644
--- a/python-deprecation.spec
+++ b/python-deprecation.spec
@@ -1,26 +1,39 @@
#
# 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: A library to handle automated deprecations
+Summary(pl.UTF-8): Biblioteka obsługująca automatycznie przestarzałą funkcjonalność
Name: python-deprecation
Version: 2.1.0
-Release: 3
-License: Apache
+Release: 4
+License: Apache v2.0
Group: Libraries/Python
+#Source0Download: https://pypi.org/simple/deprecation/
Source0: https://pypi.debian.net/deprecation/deprecation-%{version}.tar.gz
# Source0-md5: 6b79c6572fb241e3cecbbd7d539bb66b
-URL: https://pypi.python.org/pypi/deprecation
+Patch0: deprecation-unittest.patch
+URL: https://pypi.org/project/deprecation/
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%if %{with python2}
+BuildRequires: python-modules >= 1:2.7
BuildRequires: python-setuptools
+%if %{with tests}
+BuildRequires: python-unittest2
+%endif
%endif
%if %{with python3}
+BuildRequires: python3-modules >= 1:3.5
BuildRequires: python3-setuptools
%endif
-Requires: python-modules
+%if %{with doc}
+BuildRequires: sphinx-pdg-3
+%endif
+Requires: python-modules >= 1:2.7
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -28,7 +41,6 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
The deprecation library provides a deprecated decorator and a
fail_if_not_removed decorator for your tests. Together, the two enable
the automation of several things:
-
- The docstring of a deprecated method gets the deprecation details
appended to the end of it. If you generate your API docs direct from
your source, you don't need to worry about writing your own
@@ -41,16 +53,31 @@ the automation of several things:
@fail_if_not_removed to raise an AssertionError, causing either your
unittest or py.test tests to fail.
+%description -l pl.UTF-8
+Biblioteka deprecation udostępnia dekorator deprecated oraz dekorator
+fail_if_not_removed dla testów. Oba łącznie pozwalają zautomatyzować
+kilka rzeczy:
+- docstring przestarzałej metody ma dodane na końcu szczegóły
+ przestarzałości. W przypadku generowania dokumentacji API
+ bezpośrednio ze źródeł nie trzeba się martwić o pisanie własnej
+ informacji, ani zapomnienie o niej.
+- zamiast pozostawiania kodu żywego na zawsze, ponieważ funkcja
+ została oznaczona jako przestarzała, ale nigdy nie wycofana, można
+ nakazać testom wskazać, kiedy będzie czas usunięcia kodu. Dekorator
+ @deprecated może mieć wskazane, kiedy będzie czas usunięcia kodu
+ całkowicie, co powoduje, że dekorator @fail_if_not_removed rzuca
+ wyjątek AssertionError, powodując niepowodzenie testów.
+
%package -n python3-deprecation
Summary: A library to handle automated deprecations
+Summary(pl.UTF-8): Biblioteka obsługująca automatycznie przestarzałą funkcjonalność
Group: Libraries/Python
-Requires: python3-modules
+Requires: python3-modules >= 1:3.5
%description -n python3-deprecation
The deprecation library provides a deprecated decorator and a
fail_if_not_removed decorator for your tests. Together, the two enable
the automation of several things:
-
- The docstring of a deprecated method gets the deprecation details
appended to the end of it. If you generate your API docs direct from
your source, you don't need to worry about writing your own
@@ -63,16 +90,57 @@ the automation of several things:
@fail_if_not_removed to raise an AssertionError, causing either your
unittest or py.test tests to fail.
+%description -n python3-deprecation -l pl.UTF-8
+Biblioteka deprecation udostępnia dekorator deprecated oraz dekorator
+fail_if_not_removed dla testów. Oba łącznie pozwalają zautomatyzować
+kilka rzeczy:
+- docstring przestarzałej metody ma dodane na końcu szczegóły
+ przestarzałości. W przypadku generowania dokumentacji API
+ bezpośrednio ze źródeł nie trzeba się martwić o pisanie własnej
+ informacji, ani zapomnienie o niej.
+- zamiast pozostawiania kodu żywego na zawsze, ponieważ funkcja
+ została oznaczona jako przestarzała, ale nigdy nie wycofana, można
+ nakazać testom wskazać, kiedy będzie czas usunięcia kodu. Dekorator
+ @deprecated może mieć wskazane, kiedy będzie czas usunięcia kodu
+ całkowicie, co powoduje, że dekorator @fail_if_not_removed rzuca
+ wyjątek AssertionError, powodując niepowodzenie testów.
+
+%package apidocs
+Summary: API documentation for Python deprecation module
+Summary(pl.UTF-8): Dokumentacja API modułu Pythona deprecation
+Group: Documentation
+
+%description apidocs
+API documentation for Python deprecation module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona deprecation.
+
%prep
%setup -q -n deprecation-%{version}
+%patch -P0 -p1
%build
%if %{with python2}
%py_build
+
+%if %{with tests}
+%{__python} -m unittest2 discover -s tests
+%endif
%endif
%if %{with python3}
%py3_build
+
+%if %{with tests}
+%{__python3} -m unittest discover -s tests
+%endif
+%endif
+
+%if %{with doc}
+PYTHONPATH=$(pwd) \
+%{__make} -C docs html \
+ SPHINXBUILD=sphinx-build-3
%endif
%install
@@ -104,6 +172,12 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc README.rst
%{py3_sitescriptdir}/deprecation.py
-%{py3_sitescriptdir}/__pycache__/*
+%{py3_sitescriptdir}/__pycache__/deprecation.cpython-*.py[co]
%{py3_sitescriptdir}/deprecation-%{version}-py*.egg-info
%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-deprecation.git/commitdiff/12fa413b73da93d9990df9bf1c011210dbee6b67
More information about the pld-cvs-commit
mailing list