diff --git a/python-hwdata-2.4.3-1.tar.gz b/python-hwdata-2.4.3-1.tar.gz deleted file mode 100644 index 7a52a43981b676be20a17f15db3c6e85d4fc9504..0000000000000000000000000000000000000000 Binary files a/python-hwdata-2.4.3-1.tar.gz and /dev/null differ diff --git a/python-hwdata-2.4.3-2.4.1.tar.gz b/python-hwdata-2.4.3-2.4.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/python-hwdata.spec b/python-hwdata.spec index 9ba9202232363f09b0c20d0a6cc54b02862be3e8..a8109e6ca01ded427356a8ea13c12463545b1dca 100644 --- a/python-hwdata.spec +++ b/python-hwdata.spec @@ -1,15 +1,22 @@ %bcond_without python2 +%global _empty_manifest_terminate_build 0 +%undefine _python_dist_allow_version_zero Name: python-hwdata -Version: 2.4.3 +Version: 2.4.1 Release: 1 Summary: Python bindings to hwdata package License: GPLv2 URL: https://github.com/xsuchy/python-hwdata -Source0: https://github.com/xsuchy/python-hwdata/archive/%{name}-%{version}-1.tar.gz +Source0: https://files.pythonhosted.org/packages/source/p/python-hwdata-2.4.3/python-hwdata-2.4.3-%{version}.tar.gz BuildArch: noarch +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-build +BuildRequires: python3-devel + %description Provide python interface to database stored in hwdata package. It allows you to get human readable description of USB and PCI devices. @@ -17,7 +24,6 @@ It allows you to get human readable description of USB and PCI devices. %package -n python3-hwdata Summary: Python bindings to hwdata package -BuildRequires: python3-devel Requires: hwdata %{?python_provide:%python_provide python3-hwdata} @@ -29,15 +35,33 @@ It allows you to get human readable description of USB and PCI devices. %package_help %prep %autosetup -n %{name}-%{name}-%{version}-1 -p1 + +# Fix setuptools_scm version issue +if [ -f pyproject.toml ]; then + sed -i '/^version *=/d' pyproject.toml + sed -i '/^\[project\]/a version = "%{version}"' pyproject.toml + sed -i '/dynamic *= *\[.*version.*\]/d' pyproject.toml + if grep -q '^\[tool\.setuptools_scm\]' pyproject.toml; then + sed -i '/^\[tool\.setuptools_scm\]/,/^\[/ {/^write_to *=/d}' pyproject.toml + sed -i '/^\[tool\.setuptools_scm\]/a fallback_version = "%{version}"' pyproject.toml + fi +fi rm -rf %{py3dir} cp -a . %{py3dir} %build +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" pushd %{py3dir} %_bindir/python3 setup.py build '--executable=%_bindir/python3 -s' popd %install +export PYTHONDONTWRITEBYTECODE=1 + +# Clean __pycache__ directories and .pyc/.pyo files +find %{buildroot} -name '*.py[co]' -delete +find %{buildroot} -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" pushd %{py3dir} %_bindir/python3 setup.py install -O1 --skip-build --root %buildroot popd @@ -55,6 +79,9 @@ popd %doc example.py README.md html %changelog +* Thu Nov 27 2025 zhangzeyang0718 - 2.4.1-1 +- Update package to version 2.4.1 + * Mon Aug 4 2025 zhang_wenyu - 2.4.3-1 - update to version 2.4.3 - do not run linter in check section