Compare commits

...
Sign in to create a new pull request.

32 commits

Author SHA1 Message Date
Python Maint
f00b886f17 Rebuilt for Python 3.15.0b4 ABI change 2026-07-22 10:51:18 +02:00
Fedora Release Engineering
d1e72e3677 Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild 2026-07-16 17:55:18 +00:00
Python Maint
df740093cc Rebuilt for Python 3.15 2026-06-03 17:46:10 +02:00
Fedora Release Engineering
0ad0fbeef9 Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-17 06:00:48 +00:00
Python Maint
2e82ee90f0 Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 12:40:14 +02:00
Python Maint
bd307c7d69 Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 13:09:13 +02:00
Brian C. Lane
d5724a4b25 tests: Move pyparted tests from sti to tmt
This converts to using tmt style tests, and adds a test that actually
uses the installed pyparted library to manipulate a temporary disk
image.

Resolves: rhbz#2383021
2025-07-25 10:09:24 -07:00
Fedora Release Engineering
e753df8da2 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 06:23:09 +00:00
Yaakov Selkowitz
f5a2e7a5d4 Drop unused six dependency
six is unused as of 3.13.0:

2f58eaea26
2025-06-15 12:59:31 -04:00
Python Maint
f6172d0db0 Rebuilt for Python 3.14 2025-06-02 21:23:35 +02:00
Fedora Release Engineering
a5d5cf52a2 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-18 11:17:57 +00:00
Fedora Release Engineering
7db2b45750 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-19 08:56:04 +00:00
Python Maint
2164058f95 Rebuilt for Python 3.13 2024-06-07 09:50:44 +02:00
Fedora Release Engineering
28afbe9415 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-26 00:38:54 +00:00
Fedora Release Engineering
b43cea136d Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 22:47:14 +00:00
Fedora Release Engineering
68b2466ffd Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-21 06:46:37 +00:00
Python Maint
560c551e0c Rebuilt for Python 3.12 2023-06-22 14:22:46 +02:00
David Cantrell
a4238a2a12 Upgrade to pyparted-3.13.0
Signed-off-by: David Cantrell <dcantrell@redhat.com>
2023-06-22 07:19:58 -04:00
Python Maint
5cc8e359da Rebuilt for Python 3.12 2023-06-15 15:07:14 +02:00
David Cantrell
305aca41de Use non-deprecated syntax for the %patch macros
Signed-off-by: David Cantrell <dcantrell@redhat.com>
2023-06-14 11:12:32 -04:00
Python Maint
1f78cfc5da Rebuilt for Python 3.12 2023-06-13 21:37:29 +02:00
David Cantrell
6d94398a54 Fix FTBFS with _ped.disktype test case for gpt (#2171656)
Update License tag to SPDX expression

Signed-off-by: David Cantrell <dcantrell@redhat.com>
2023-03-02 12:01:05 -05:00
Fedora Release Engineering
c779229780 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-20 10:42:21 +00:00
Fedora Release Engineering
b71463d9af Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 15:50:35 +00:00
David Cantrell
52a1c8bfaf Patch pyparted to handle PED_DISK_TYPE_PARTITION_TYPE_ID for the
msdos disk type and PED_DISK_TYPE_PARTITION_TYPE_UUID for the gpt
  label (#2098792)

Signed-off-by: David Cantrell <dcantrell@redhat.com>
2022-06-21 15:22:04 -04:00
Adam Williamson
d32b10b877 Backport PR #92 to fix tests with parted 3.5 (#2098792) 2022-06-20 13:24:26 -07:00
Python Maint
e8f5fc9089 Rebuilt for Python 3.11 2022-06-13 16:02:42 +02:00
David Cantrell
791a789e24 BR python3-setuptools
Signed-off-by: David Cantrell <dcantrell@redhat.com>
2022-03-07 14:45:25 -05:00
David Cantrell
775cb0e480 Upgrade to pyparted-3.12.0
Signed-off-by: David Cantrell <dcantrell@redhat.com>
2022-03-07 14:22:47 -05:00
Fedora Release Engineering
0ae7d75235 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-21 09:51:49 +00:00
Fedora Release Engineering
10bc59882e - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 04:29:12 +00:00
Python Maint
b244549e30 Rebuilt for Python 3.10 2021-06-03 13:33:21 +02:00
8 changed files with 223 additions and 164 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

4
.gitignore vendored
View file

@ -10,3 +10,7 @@
/pyparted-3.11.5.tar.gz.asc
/pyparted-3.11.7.tar.gz
/pyparted-3.11.7.tar.gz.asc
/pyparted-3.12.0.tar.gz
/pyparted-3.12.0.tar.gz.asc
/pyparted-3.13.0.tar.gz
/pyparted-3.13.0.tar.gz.asc

9
plans/run-tests.fmf Normal file
View file

@ -0,0 +1,9 @@
summary: Run pyparted tests
prepare:
how: install
package:
- python3-pyparted
execute:
script: |
fallocate -l 1G $PWD/disk.img
./tests/scripts/pyparted-tests $PWD/disk.img

View file

@ -1,154 +1,155 @@
%if 0%{?rhel}
%if %{rhel} <= 7
# disable python3 by default
%bcond_with python3
%else
%bcond_without python3
%endif
Summary: Python module for GNU parted
Name: pyparted
Epoch: 1
Version: 3.13.0
Release: 17%{?dist}
License: GPL-2.0-or-later
URL: https://github.com/dcantrell/pyparted
%if %{rhel} > 7
# disable python2 by default
%bcond_with python2
%else
%bcond_without python2
%endif
%endif
%if 0%{?fedora}
%if %{fedora} < 23
# disable python3 by default
%bcond_with python3
%else
%bcond_without python3
%endif
%if %{fedora} > 31
# disable python2 by default
%bcond_with python2
%else
%bcond_without python2
%endif
%endif
Summary: Python module for GNU parted
Name: pyparted
Epoch: 1
Version: 3.11.7
Release: 2%{?dist}
License: GPLv2+
URL: https://github.com/dcantrell/pyparted
Source0: https://github.com/dcantrell/pyparted/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1: https://github.com/dcantrell/pyparted/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc
Source2: keyring.gpg
Source3: trustdb.gpg
Source0: https://github.com/dcantrell/pyparted/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1: https://github.com/dcantrell/pyparted/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc
Source2: keyring.gpg
Source3: trustdb.gpg
BuildRequires: make
BuildRequires: gcc
BuildRequires: parted-devel >= 3.3
BuildRequires: parted-devel >= 3.4
BuildRequires: pkgconfig
BuildRequires: e2fsprogs
BuildRequires: gnupg2
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-six
%endif
BuildRequires: python3-setuptools
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-six
%endif
%global _description\
Python module for the parted library. It is used for manipulating\
%description
Python module for the parted library. It is used for manipulating
partition tables.
%description %_description
%if %{with python2}
%package -n python2-pyparted
Summary: %summary
%{?python_provide:%python_provide python2-pyparted}
# Remove before F30
Provides: pyparted = %{epoch}:%{version}-%{release}
Provides: pyparted%{?_isa} = %{epoch}:%{version}-%{release}
Obsoletes: pyparted < %{epoch}:%{version}-%{release}
%description -n python2-pyparted %_description
%endif
%if %{with python3}
%package -n python3-pyparted
Summary: Python 3 module for GNU parted
%description -n python3-pyparted
Python module for the parted library. It is used for manipulating
partition tables. This package provides Python 3 bindings for parted.
%endif
%prep
# Verify source archive signature
gpg --no-default-keyring --keyring %{SOURCE2} --trustdb-name %{SOURCE3} --verify %{SOURCE1} %{SOURCE0} || exit 1
%setup -q
%if %{with python3}
everything=$(ls)
mkdir -p py3dir
cp -a $everything py3dir
%endif
%autosetup
%build
%if %{with python2}
PYTHON=python2 %make_build CFLAGS="%{optflags} -fcommon"
%endif
%if %{with python3}
pushd py3dir
PYTHON=python3 %make_build CFLAGS="%{optflags} -fcommon"
popd
%endif
%make_build CFLAGS="%{optflags} -fcommon"
%check
%if %{with python2}
PYTHON=python2 make test
%endif
%if %{with python3}
pushd py3dir
PYTHON=python3 make test
popd
%endif
make test
%install
%if %{with python2}
PYTHON=python2 %make_install
%endif
%make_install
%if %{with python3}
pushd py3dir
PYTHON=python3 %make_install
popd
%endif
%if %{with python2}
%files -n python2-pyparted
%doc AUTHORS COPYING NEWS README TODO
%{python2_sitearch}/_ped.so
%{python2_sitearch}/parted
%{python2_sitearch}/%{name}-%{version}-*.egg-info
%endif
%if %{with python3}
%files -n python3-pyparted
%doc AUTHORS COPYING NEWS README TODO
%doc AUTHORS HACKING NEWS README.md RELEASE TODO
%license LICENSE
%{python3_sitearch}/_ped.*.so
%{python3_sitearch}/parted
%{python3_sitearch}/%{name}-%{version}-*.egg-info
%endif
%changelog
* Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 1:3.13.0-17
- Rebuilt for Python 3.15.0b4 ABI change
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
* Wed Jun 03 2026 Python Maint <python-maint@redhat.com> - 1:3.13.0-15
- Rebuilt for Python 3.15
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 1:3.13.0-13
- Rebuilt for Python 3.14.0rc3 bytecode
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 1:3.13.0-12
- Rebuilt for Python 3.14.0rc2 bytecode
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Sun Jun 15 2025 Yaakov Selkowitz <yselkowi@redhat.com> - 1:3.13.0-10
- Drop unused six dependency
* Mon Jun 02 2025 Python Maint <python-maint@redhat.com> - 1:3.13.0-9
- Rebuilt for Python 3.14
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 1:3.13.0-6
- Rebuilt for Python 3.13
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.13.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jun 22 2023 Python Maint <python-maint@redhat.com> - 1:3.13.0-2
- Rebuilt for Python 3.12
* Wed Jun 21 2023 David Cantrell <dcantrell@redhat.com> - 1:3.13.0-1
- Upgrade to pyparted-3.13.0
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 1:3.12.0-11
- Rebuilt for Python 3.12
* Wed Jun 14 2023 David Cantrell <dcantrell@redhat.com> - 1:3.12.0-10
- Use non-deprecated syntax for the %%patch macros
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 1:3.12.0-9
- Rebuilt for Python 3.12
* Thu Mar 02 2023 David Cantrell <dcantrell@redhat.com> - 1:3.12.0-8
- Fix FTBFS with _ped.disktype test case for gpt (#2171656)
- Update License tag to SPDX expression
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.12.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.12.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jun 21 2022 David Cantrell <dcantrell@redhat.com> - 1:3.12.0-5
- Patch pyparted to handle PED_DISK_TYPE_PARTITION_TYPE_ID for the
msdos disk type and PED_DISK_TYPE_PARTITION_TYPE_UUID for the gpt
label (#2098792)
* Mon Jun 20 2022 Adam Williamson <awilliam@redhat.com> - 1:3.12.0-4
- Backport PR #92 to fix tests with parted 3.5 (#2098792)
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1:3.12.0-3
- Rebuilt for Python 3.11
* Mon Mar 07 2022 David Cantrell <dcantrell@redhat.com> - 3.12.0-2
- BR python3-setuptools
* Mon Mar 07 2022 David Cantrell <dcantrell@redhat.com> - 3.12.0-1
- Upgrade to pyparted-3.12.0
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.7-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Jun 03 2021 Python Maint <python-maint@redhat.com> - 1:3.11.7-3
- Rebuilt for Python 3.10
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.11.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

View file

@ -1,2 +1,2 @@
SHA512 (pyparted-3.11.7.tar.gz) = 41018989c21aab577cd1d51f521128d072b346afb9dcdcc27490cdbc2ed4382a854e4bd16780da72a0a95bbd521f14ee0e7f02816f34656cbae734d43a4f0b83
SHA512 (pyparted-3.11.7.tar.gz.asc) = 669770930307f57bfd8b1d11418f3fbc1415747aec5cde001efe7b132724996e42271f4df79148e616c2ba76527dfafceeeb1d3374cbd14a16bd545dd716c15c
SHA512 (pyparted-3.13.0.tar.gz) = a9162afdbee48de5474de98ae8c08df028d485e122fcafae8421dddd47c9ed00d8dd9f40d854b14d4582483d8ea3469128a912491371385e4f18a0dbbbafbfd5
SHA512 (pyparted-3.13.0.tar.gz.asc) = 6f3e973b52584450c3eed97d64266df832d8820a6a72f731fbb9fbd9be06f93f2d53b47bcae01b78a831e3e3cedca3ae8629dc5f9fe35dcc3ed11226a11fd952

88
tests/scripts/pyparted-tests Executable file
View file

@ -0,0 +1,88 @@
#!/usr/bin/python3
import parted
import sys
def init_disk(disk_img):
# Make a disklabel (failures here will raise an error)
dev = parted.getDevice(disk_img)
disk = parted.freshDisk(dev, "gpt")
# Make a partition
geom = parted.Geometry(device=dev,
start=2048,
end=50*2048)
fs = parted.FileSystem(type="ext4", geometry=geom)
part = parted.Partition(disk=disk,
type=parted.PARTITION_NORMAL,
fs=fs,
geometry=geom)
disk.addPartition(partition=part,
constraint=dev.optimalAlignedConstraint)
part.setFlag(parted.PARTITION_BOOT)
disk.commit()
def read_disk(disk_img):
# Read the disk and check the partitions
dev = parted.getDevice(disk_img)
disk = parted.newDisk(dev)
if dev.length == 0:
print("ERROR: Disk has no length", file=sys.stderr)
sys.exit(1)
if len(disk.partitions) != 1:
print("ERROR: Wrong number of partitions", file=sys.stderr)
sys.exit(1)
part = disk.partitions[0]
if part.geometry.end != 50*2048:
print("ERROR: Partition is wrong length", file=sys.stderr)
sys.exit(1)
if part.geometry.start != 2048:
print("ERROR: Parition doesn't start at sector 2048", file=sys.stderr)
sys.exit(1)
def remove_partition(disk_img):
# Remove partition and check disk
dev = parted.getDevice(disk_img)
disk = parted.newDisk(dev)
if len(disk.partitions) != 1:
print("ERROR: Wrong number of partitions", file=sys.stderr)
sys.exit(1)
disk.removePartition(partition=disk.partitions[0])
disk.commit()
dev = parted.getDevice(disk_img)
disk = parted.newDisk(dev)
if len(disk.partitions) != 0:
print("ERROR: Failed to delete partition", file=sys.stderr)
sys.exit(1)
def main(disk_img):
print(f"Running tests on {disk_img}")
try:
init_disk(disk_img)
read_disk(disk_img)
remove_partition(disk_img)
except Exception as e:
print(f"ERROR: {str(e)}", file=sys.stderr)
sys.exit(1)
print("PASS", file=sys.stderr)
sys.exit(0)
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Usage: %s <disk.img>" % sys.argv[0], file=sys.stderr)
sys.exit(1)
main(sys.argv[1])

View file

@ -1,29 +0,0 @@
#!/bin/sh
PATH=/usr/bin
TMPDIR="$(mktemp -d)"
CWD="$(pwd)"
PACKAGE=pyparted
BRANCH=
# clone the dist-git tree for this package
cd ${TMPDIR}
fedpkg co ${PACKAGE}
cd ${PACKAGE}
[ -z "${BRANCH}" ] || fedpkg switch-branch ${BRANCH}
fedpkg prep
# scramble together the extracted source tree name
SRCDIR="${PACKAGE}-$(grep Version: ${PACKAGE}.spec | cut -d ' ' -f 2)"
# run the tests
cd ${SRCDIR}
#make check # this runs pylint, which is sometimes wrong/noisy
make test
RET=$?
# clean up and exit
cd ${CWD}
rm -rf ${TMPDIR}
exit ${RET}

View file

@ -1,15 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
required_packages:
- fedpkg
tests:
- simple:
dir: scripts/
run: ./run_tests.sh