[packages/python3-testpath] - python-testpath.spec updated to 0.6.0 for python 3.5+ - hacked to build using setuptools

qboosh qboosh at pld-linux.org
Sun Mar 20 20:07:57 CET 2022


commit 5a4603a252388f09854a8c83f0a706a3c1130b19
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 20 20:09:54 2022 +0100

    - python-testpath.spec updated to 0.6.0 for python 3.5+
    - hacked to build using setuptools

 python-testpath.spec => python3-testpath.spec | 105 ++++++++++----------------
 1 file changed, 38 insertions(+), 67 deletions(-)
---
diff --git a/python-testpath.spec b/python3-testpath.spec
similarity index 56%
rename from python-testpath.spec
rename to python3-testpath.spec
index 3abbcf1..b36449b 100644
--- a/python-testpath.spec
+++ b/python3-testpath.spec
@@ -2,39 +2,29 @@
 # 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:	Test utilities for code working with files and commands
 Summary(pl.UTF-8):	Narzędzia testowe dla kodu działającego na plikach i poleceniach
-Name:		python-testpath
-Version:	0.4.4
-Release:	2
+Name:		python3-testpath
+Version:	0.6.0
+Release:	1
 License:	BSD
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/testpath/
 Source0:	https://files.pythonhosted.org/packages/source/t/testpath/testpath-%{version}.tar.gz
-# Source0-md5:	297100d49a6f20859383434a182cf426
+# Source0-md5:	9fd4339f76da12d15bc718e4aa2566e9
 URL:		https://pypi.org/project/testpath/
-%if %{with python2}
-BuildRequires:	python-modules >= 1:2.7
-%if %{with tests}
-BuildRequires:	python-pathlib2
-BuildRequires:	python-pytest
-%endif
-%endif
-%if %{with python3}
 BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-setuptools
 %if %{with tests}
 BuildRequires:	python3-pytest
 %endif
-%endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 %if %{with doc}
-BuildRequires:	sphinx-pdg
+BuildRequires:	sphinx-pdg-3
 %endif
-Requires:	python-modules >= 1:2.7
+Requires:	python3-modules >= 1:3.5
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -53,27 +43,6 @@ Zawiera funkcje do sprawdzania elementów w systemie plików oraz
 narzędzia do tworzenia atrap poleceń systemowych i zapisywania ich
 wywołań.
 
-%package -n python3-testpath
-Summary:	Test utilities for code working with files and commands
-Summary(pl.UTF-8):	Narzędzia testowe dla kodu działającego na plikach i poleceniach
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.5
-
-%description -n python3-testpath
-Testpath is a collection of utilities for Python code working with
-files and commands.
-
-It contains functions to check things on the filesystem, and tools for
-mocking system commands and recording calls to those.
-
-%description -n python3-testpath -l pl.UTF-8
-Testpath to zbiór narzędzi dla kodu w Pythonie działającego na plikach
-i poleceniach.
-
-Zawiera funkcje do sprawdzania elementów w systemie plików oraz
-narzędzia do tworzenia atrap poleceń systemowych i zapisywania ich
-wywołań.
-
 %package apidocs
 Summary:	API documentation for Python testpath module
 Summary(pl.UTF-8):	Dokumentacja API modułu Pythona testpath
@@ -88,58 +57,60 @@ Dokumentacja API modułu Pythona testpath.
 %prep
 %setup -q -n testpath-%{version}
 
-%build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-%{__python} -m pytest tests
-%endif
-%endif
+# setuptools stub
+cat >setup.py <<EOF
+from setuptools import setup
+setup()
+EOF
+
+# until we have flit...
+# (extracted from pyproject.toml - keep in sync!)
+cat >setup.cfg <<'EOF'
+[metadata]
+name = testpath
+version = %{version}
+description = Test utilities for code working with files and commands
+author = Jupyter Development Team
+author_email = jupyter at googlegroups.com
+license = BSD
+license_file = LICENSE
+classifiers =
+    Intended Audience :: Developers
+    License :: OSI Approved :: BSD License
+    Programming Language :: Python
+    Programming Language :: Python :: 3
+    Topic :: Software Development :: Testing
+[options]
+packages = testpath
+python_requires = >=3.5
+EOF
 
-%if %{with python3}
+%build
 %py3_build
 
 %if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
 %{__python3} -m pytest tests
 %endif
-%endif
 
 %if %{with doc}
-%{__make} -C doc html
+%{__make} -C doc html \
+	SPHINXBUILD=sphinx-build-3
 %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 LICENSE README.rst
-%{py_sitescriptdir}/testpath
-%{py_sitescriptdir}/testpath-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-testpath
-%defattr(644,root,root,755)
-%doc LICENSE README.rst
 %{py3_sitescriptdir}/testpath
 %{py3_sitescriptdir}/testpath-%{version}-py*.egg-info
-%endif
 
 %if %{with doc}
 %files apidocs
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-testpath.git/commitdiff/5a4603a252388f09854a8c83f0a706a3c1130b19



More information about the pld-cvs-commit mailing list