Support build python3.x version in openSUSE 12/296612/6 accepted/tools_devbase_tools devel master sandbox/wangbiao/py3_version accepted/tools/devbase/tools/20250527.103817 accepted/tools/devbase/tools/20250528.062253
authorbiao716.wang <biao716.wang@samsung.com>
Wed, 2 Aug 2023 06:06:06 +0000 (15:06 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Wed, 2 Aug 2023 07:19:32 +0000 (16:19 +0900)
writing "PBR_VERSION=X.Y.Z" to fix build error:
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository.
It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to
pbr.version.VersionInfo. Project name jenkinsapi was given, but was not able to be found

Change-Id: Ifbabf252febcdabd1d35f384da528730399ae45f
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
packaging/python-jenkinsapi.spec
setup.py

index d9bcbe7f6c4cc30c422f8b7a5e09eb0e759493b8..c00a0837f08f3050e351c9548a51ffee5a045624 100644 (file)
@@ -24,17 +24,19 @@ Group:          Development/Languages/Python
 Url:            https://github.com/salimfadhley/jenkinsapi
 Source:         https://pypi.python.org/packages/source/j/jenkinsapi/jenkinsapi-%{version}.tar.gz
 
-BuildRequires:  python-setuptools
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-pytz
+BuildRequires:  python3-pbr
 
 %if 0%{?suse_version} || 0%{?fedora}
-BuildRequires:  python-requests
-Requires:       python-requests
+BuildRequires:  python3-requests
+Requires:       python3-requests
 %endif
 
 %if 0%{?fedora} || 0%{?centos_ver}
 Requires:       pytz
 %else
-Requires:       python-pytz
+Requires:       python3-pytz
 %endif
 
 %description
@@ -64,19 +66,19 @@ This library can help you:
 %setup -q
 
 %build
-python setup.py build
+PBR_VERSION=X.Y.Z python3 setup.py build
 %if 0%{?fedora} == 23
 cp -f find-debuginfo.sh /usr/lib/rpm/find-debuginfo.sh
 %endif
 
 %install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+PBR_VERSION=X.Y.Z python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 
 %files
 %defattr(-,root,root,-)
 %doc README.rst
 %{_bindir}/*
-%{python_sitelib}/*
+%{python3_sitelib}/*
 
 %changelog
 
index 8674709d253264a64aa2c175ba13b6cf10b10414..c39ef30f94f4b1f9e30d48f503f0e206b134f9b2 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,5 @@ from setuptools import setup
 
 
 setup(
-    setup_requires=['pbr'],
+    setup_requires=['pbr>=2.0.0'],
     pbr=True)
-