14
0
forked from pool/python-parted

- Update to 3.13.0:

- Help the _ped module garbage collection in the test suite
  - Use 'return NULL' rather than 'return (PyObject *) NULL' in
    pydisk.c
  - Use Py_VISIT() in *_traverse() functions
  - Free allocated memory for temporary string buffers
  - Use Py_RETURN_NONE through the _ped module code
  - Coding style updates for the C code.
  - Some minor cleanups for the test case code
  - Remove DeprecationWarning in py_ped_constraint_duplicate()
  - Drop remaining Python 2.x handling from the Makefile drop six
  - Reformat all Python source code using Python black
  - Replace outdated Red Hat sample GPLv2+ boilerplates
  - Add support for loongarch
  - Add support for no_automount partition flag
  - Add new disk types - disk uuid and partition uuid
  - Fix start sector for test partition
  - Add example for viewing and changing GPT partition type UUID
  - Accept device path via argv for partition dump example
  - Add type ID / UUID to partition dump example
  - Map partition type ID / UUID accessors to Partition class
  - Bind low level APIs for type ID and UUID accessors
  - Add support for new libparted disk type features in
    parted-3.5
- Remove unnecessary patches:
  - more-features-exposed.patch
  - python-parted-featurestest.patch
  - python-parted-no-six.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parted?expand=0&rev=19
This commit is contained in:
2024-03-16 18:04:00 +00:00
committed by Git OBS Bridge
parent 873c543bee
commit d280d98c4c
9 changed files with 59 additions and 129 deletions

View File

@@ -1,31 +0,0 @@
Index: pyparted-3.12.0/tests/test__ped_disktype.py
===================================================================
--- pyparted-3.12.0.orig/tests/test__ped_disktype.py
+++ pyparted-3.12.0/tests/test__ped_disktype.py
@@ -75,11 +75,11 @@ class DiskTypeCheckFeatureTestCase(Requi
class DiskTypeStrTestCase(RequiresDiskTypes):
def runTest(self):
- self.assertEqual(str(self.disktype['msdos']), '_ped.DiskType instance --\n name: msdos features: 1')
+ self.assertEqual(str(self.disktype['msdos']), '_ped.DiskType instance --\n name: msdos features: 9')
self.assertEqual(str(self.disktype['aix']), '_ped.DiskType instance --\n name: aix features: 0')
self.assertEqual(str(self.disktype['sun']), '_ped.DiskType instance --\n name: sun features: 0')
self.assertEqual(str(self.disktype['amiga']), '_ped.DiskType instance --\n name: amiga features: 2')
- self.assertEqual(str(self.disktype['gpt']), '_ped.DiskType instance --\n name: gpt features: 2')
+ self.assertEqual(str(self.disktype['gpt']), '_ped.DiskType instance --\n name: gpt features: 18')
self.assertEqual(str(self.disktype['mac']), '_ped.DiskType instance --\n name: mac features: 6')
self.assertEqual(str(self.disktype['bsd']), '_ped.DiskType instance --\n name: bsd features: 0')
self.assertEqual(str(self.disktype['pc98']), '_ped.DiskType instance --\n name: pc98 features: 2')
Index: pyparted-3.12.0/tests/test_parted_partition.py
===================================================================
--- pyparted-3.12.0.orig/tests/test_parted_partition.py
+++ pyparted-3.12.0/tests/test_parted_partition.py
@@ -217,7 +217,7 @@ class PartitionGetFlagsAsStringTestCase(
as comma separated list.
'''
def runTest(self):
- self.assertEqual(self.part.getFlagsAsString(), 'boot, raid, type')
+ self.assertEqual(self.part.getFlagsAsString(), 'boot, raid')
@unittest.skip("Unimplemented test case.")
class PartitionGetMaxGeometryTestCase(unittest.TestCase):

View File

@@ -1,7 +1,10 @@
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-pyparted-3.10/src/parted/disk.py ./src/parted/disk.py
--- ../orig-pyparted-3.10/src/parted/disk.py 2013-04-09 17:31:40.000000000 +0200
+++ ./src/parted/disk.py 2014-02-09 09:49:31.693576602 +0100
@@ -486,4 +486,7 @@
---
src/parted/disk.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/src/parted/disk.py
+++ b/src/parted/disk.py
@@ -474,4 +474,7 @@ while __readFlags:
if not __flag:
__readFlags = False
else:

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b06b1624ebd1200de24672ee5b0f85b8fa547a437b24780930e2790d42bef343
size 106440

3
pyparted-3.13.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9d69d822f2679e3b5c8279bb23d2a1b736ff15b34bd95833e317787f73794701
size 105838

View File

@@ -1,26 +0,0 @@
Index: pyparted-3.11.1/tests/test__ped_disktype.py
===================================================================
--- pyparted-3.11.1.orig/tests/test__ped_disktype.py
+++ pyparted-3.11.1/tests/test__ped_disktype.py
@@ -80,7 +80,7 @@ class DiskTypeStrTestCase(RequiresDiskTy
self.assertEqual(str(self.disktype['sun']), '_ped.DiskType instance --\n name: sun features: 0')
self.assertEqual(str(self.disktype['amiga']), '_ped.DiskType instance --\n name: amiga features: 2')
self.assertEqual(str(self.disktype['gpt']), '_ped.DiskType instance --\n name: gpt features: 2')
- self.assertEqual(str(self.disktype['mac']), '_ped.DiskType instance --\n name: mac features: 2')
+ self.assertEqual(str(self.disktype['mac']), '_ped.DiskType instance --\n name: mac features: 6')
self.assertEqual(str(self.disktype['bsd']), '_ped.DiskType instance --\n name: bsd features: 0')
self.assertEqual(str(self.disktype['pc98']), '_ped.DiskType instance --\n name: pc98 features: 2')
self.assertEqual(str(self.disktype['loop']), '_ped.DiskType instance --\n name: loop features: 0')
Index: pyparted-3.11.1/tests/test_parted_partition.py
===================================================================
--- pyparted-3.11.1.orig/tests/test_parted_partition.py
+++ pyparted-3.11.1/tests/test_parted_partition.py
@@ -179,7 +179,7 @@ class PartitionGetFlagsAsStringTestCase(
as comma separated list.
'''
def runTest(self):
- self.assertEqual(self.part.getFlagsAsString(), 'boot, raid')
+ self.assertEqual(self.part.getFlagsAsString(), 'boot, raid, type')
@unittest.skip("Unimplemented test case.")
class PartitionGetMaxGeometryTestCase(unittest.TestCase):

View File

@@ -1,46 +0,0 @@
Index: pyparted-3.12.0/.github/workflows/test.yml
===================================================================
--- pyparted-3.12.0.orig/.github/workflows/test.yml
+++ pyparted-3.12.0/.github/workflows/test.yml
@@ -34,5 +34,4 @@ jobs:
python3-pytest \
python3-types-six \
udev
- pip install six
env PYTHON=python3 make test coverage COVERAGE=coverage
Index: pyparted-3.12.0/src/parted/disk.py
===================================================================
--- pyparted-3.12.0.orig/src/parted/disk.py
+++ pyparted-3.12.0/src/parted/disk.py
@@ -56,12 +56,10 @@ class Disk(object):
self._partitions = CachedList(lambda : self.__getPartitions())
def _hasSameParts(self, other):
- import six
-
if len(self.partitions) != len(other.partitions):
return False
- partIter = six.moves.zip(self.partitions, other.partitions)
+ partIter = zip(self.partitions, other.partitions)
while True:
try:
(left, right) = next(partIter)
Index: pyparted-3.12.0/tests/test__ped_geometry.py
===================================================================
--- pyparted-3.12.0.orig/tests/test__ped_geometry.py
+++ pyparted-3.12.0/tests/test__ped_geometry.py
@@ -19,7 +19,6 @@
#
import _ped
-import six
from tests.baseclass import RequiresDevice
# One class per method, multiple tests per class. For these simple methods,
@@ -375,4 +374,4 @@ class GeometryStrTestCase(RequiresDevice
lines = str(self.g).split('\n')
self.assertEqual(lines[0], '_ped.Geometry instance --')
self.assertEqual(lines[1], ' start: 10 end: 109 length: 100')
- six.assertRegex(self, lines[2], '^ device: <_ped.Device object at .*')
+ self.assertRegex(lines[2], '^ device: <_ped.Device object at .*')

View File

@@ -1,8 +1,10 @@
Index: pyparted-3.11.7/tests/baseclass.py
===================================================================
--- pyparted-3.11.7.orig/tests/baseclass.py
+++ pyparted-3.11.7/tests/baseclass.py
@@ -72,7 +72,7 @@ class RequiresFileSystem(unittest.TestCa
---
tests/baseclass.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/tests/baseclass.py
+++ b/tests/baseclass.py
@@ -71,7 +71,7 @@ class RequiresFileSystem(unittest.TestCa
os.write(self.fd, b"0")
self.f.close()
@@ -11,16 +13,16 @@ Index: pyparted-3.11.7/tests/baseclass.py
self._device = _ped.device_get(self.path)
self._geometry = _ped.Geometry(self._device, 0, self._device.length - 1)
@@ -137,7 +137,7 @@ class RequiresDeviceAlignment(RequiresDe
@@ -136,7 +136,7 @@ class RequiresDeviceAlignment(RequiresDe
class RequiresLabeledDevice(RequiresDevice):
def setUp(self):
RequiresDevice.setUp(self)
super().setUp()
- os.system("parted -s %s mklabel msdos" % (self.path,))
+ os.system("/usr/sbin/parted -s %s mklabel msdos" % (self.path,))
# Base class for any test case that requires a _ped.Disk or parted.Disk.
class RequiresDisk(RequiresDevice):
@@ -161,7 +161,7 @@ class RequiresMount(RequiresDevice):
@@ -171,7 +171,7 @@ class RequiresMount(RequiresDevice):
self.mountpoint = None
def mkfs(self):

View File

@@ -1,3 +1,35 @@
-------------------------------------------------------------------
Sat Mar 16 17:37:54 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Update to 3.13.0:
- Help the _ped module garbage collection in the test suite
- Use 'return NULL' rather than 'return (PyObject *) NULL' in
pydisk.c
- Use Py_VISIT() in *_traverse() functions
- Free allocated memory for temporary string buffers
- Use Py_RETURN_NONE through the _ped module code
- Coding style updates for the C code.
- Some minor cleanups for the test case code
- Remove DeprecationWarning in py_ped_constraint_duplicate()
- Drop remaining Python 2.x handling from the Makefile drop six
- Reformat all Python source code using Python black
- Replace outdated Red Hat sample GPLv2+ boilerplates
- Add support for loongarch
- Add support for no_automount partition flag
- Add new disk types - disk uuid and partition uuid
- Fix start sector for test partition
- Add example for viewing and changing GPT partition type UUID
- Accept device path via argv for partition dump example
- Add type ID / UUID to partition dump example
- Map partition type ID / UUID accessors to Partition class
- Bind low level APIs for type ID and UUID accessors
- Add support for new libparted disk type features in
parted-3.5
- Remove unnecessary patches:
- more-features-exposed.patch
- python-parted-featurestest.patch
- python-parted-no-six.patch
-------------------------------------------------------------------
Tue Apr 25 07:49:04 UTC 2023 - pgajdos@suse.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-parted
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%define srcname pyparted
Name: python-parted
Version: 3.12.0
Version: 3.13.0
Release: 0
Summary: Python module for GNU parted
License: GPL-2.0-or-later
@@ -26,11 +26,7 @@ URL: https://github.com/dcantrell/pyparted/
Source0: https://github.com/dcantrell/pyparted/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
# catch exception for unknown 'disk flag', kkaempf@suse.de
Patch0: pyparted-3.10.patch
Patch3: python-parted-parted-binary.patch
Patch4: python-parted-featurestest.patch
Patch5: more-features-exposed.patch
# https://github.com/dcantrell/pyparted/pull/101
Patch6: python-parted-no-six.patch
Patch1: python-parted-parted-binary.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
@@ -62,10 +58,10 @@ partition tables.
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m unittest discover -v
%files %{python_files}
%license COPYING
%doc AUTHORS NEWS README TODO
%license LICENSE
%doc AUTHORS NEWS README.md TODO
%{python_sitearch}/_ped*.so
%{python_sitearch}/parted
%{python_sitearch}/%{srcname}-%{version}-*.egg-info
%{python_sitearch}/%{srcname}-%{version}*-info
%changelog