diff --git a/distro-1.6.0.tar.gz b/distro-1.6.0.tar.gz deleted file mode 100644 index 7a2aa1a..0000000 Binary files a/distro-1.6.0.tar.gz and /dev/null differ diff --git a/distro-1.8.0.tar.gz b/distro-1.8.0.tar.gz new file mode 100644 index 0000000..752f907 Binary files /dev/null and b/distro-1.8.0.tar.gz differ diff --git a/fix-ModuleNoFoundError-in-test-case.patch b/fix-ModuleNoFoundError-in-test-case.patch new file mode 100644 index 0000000..31ee426 --- /dev/null +++ b/fix-ModuleNoFoundError-in-test-case.patch @@ -0,0 +1,34 @@ +From 313deda21e33fa7cafdf95e2c048fde1c3a65c2d Mon Sep 17 00:00:00 2001 +From: wang--ge +Date: Wed, 31 May 2023 16:26:34 +0800 +Subject: [PATCH] fix ModuleNoFoundError in test case + +--- + tests/test_distro.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/test_distro.py b/tests/test_distro.py +index 3dda970..dde0a7e 100644 +--- a/tests/test_distro.py ++++ b/tests/test_distro.py +@@ -33,6 +33,8 @@ DISTROS = [dist for dist in os.listdir(DISTROS_DIR) if dist != "__shared__"] + + IS_LINUX = sys.platform.startswith("linux") + if IS_LINUX: ++ path="./src" ++ sys.path.append(os.path.abspath(path)) + from distro import distro + + RELATIVE_UNIXCONFDIR = distro._UNIXCONFDIR[1:] +@@ -48,7 +50,7 @@ class TestNonLinuxPlatform: + assert "Unsupported platform" in str(ex) + + +-@pytest.mark.skipif(not IS_LINUX, reason="Irrelevant on non-linux") ++@pytest.mark.skipif(IS_LINUX, reason="Irrelevant on non-linux") + class TestCli: + def _parse(self, command: str) -> None: + sys.argv = command.split() +-- +2.33.0 + diff --git a/python-distro.spec b/python-distro.spec index 7d17487..e60f04a 100644 --- a/python-distro.spec +++ b/python-distro.spec @@ -1,12 +1,13 @@ Name: python-distro -Version: 1.6.0 -Release: 2 +Version: 1.8.0 +Release: 1 Summary: Linux Distribution - a Linux OS platform information API License: ASL 2.0 URL: https://github.com/nir0s/distro Source0: https://files.pythonhosted.org/packages/source/d/distro/distro-%{version}.tar.gz +Patch0: fix-ModuleNoFoundError-in-test-case.patch -BuildRequires: python3-devel python3-setuptools python3-pytest +BuildRequires: python3-devel python3-pytest python3-pip python3-wheel BuildArch: noarch %description @@ -40,10 +41,10 @@ Python3 version of distro. rm -rf distro.egg-info %build -%py3_build +%pyproject_build %install -%py3_install +%pyproject_install %check %{__python3} -m pytest tests -v @@ -55,6 +56,9 @@ rm -rf distro.egg-info %{_bindir}/distro %changelog +* Wed May 31 2023 Ge Wang - 1.8.0-1 +- update to 1.8.0 + * Tue Oct 25 2022 wangkerong - 1.6.0-2 - rebuild for next release