pythonPackages.pyparted: 3.10.4 -> 3.11.4

This commit is contained in:
Lancelot SIX 2020-02-18 20:19:16 +01:00 committed by Jon
parent 3f448f08aa
commit 490615ef63
2 changed files with 41 additions and 6 deletions

View File

@ -1,18 +1,22 @@
{ stdenv { stdenv
, fetchFromGitHub
, buildPythonPackage , buildPythonPackage
, isPyPy , isPyPy
, pkgs , pkgs
, python , python
, six
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pyparted"; pname = "pyparted";
version = "3.10.7"; version = "3.11.4";
disabled = isPyPy; disabled = isPyPy;
src = pkgs.fetchurl { src = fetchFromGitHub {
url = "https://github.com/rhinstaller/pyparted/archive/v${version}.tar.gz"; repo = pname;
sha256 = "0c9ljrdggwawd8wdzqqqzrna9prrlpj6xs59b0vkxzip0jkf652r"; owner = "dcantrell";
rev = "v${version}";
sha256 = "0wd0xhv1y1zw7djzcnimj8irif3mg0shbhgz0jn5yi914is88h6n";
}; };
postPatch = '' postPatch = ''
@ -26,11 +30,16 @@ buildPythonPackage rec {
tests/test__ped_ped.py tests/test__ped_ped.py
''; '';
patches = [
./fix-test-pythonpath.patch
];
preConfigure = '' preConfigure = ''
PATH="${pkgs.parted}/sbin:$PATH" PATH="${pkgs.parted}/sbin:$PATH"
''; '';
nativeBuildInputs = [ pkgs.pkgconfig ]; nativeBuildInputs = [ pkgs.pkgconfig ];
checkInputs = [ six ];
propagatedBuildInputs = [ pkgs.parted ]; propagatedBuildInputs = [ pkgs.parted ];
checkPhase = '' checkPhase = ''
@ -39,10 +48,10 @@ buildPythonPackage rec {
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = "https://fedorahosted.org/pyparted/"; homepage = "https://github.com/dcantrell/pyparted/";
description = "Python interface for libparted"; description = "Python interface for libparted";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = with maintainers; [ lsix ];
}; };
} }

View File

@ -0,0 +1,26 @@
diff -ur a/Makefile b/Makefile
--- a/Makefile 1980-01-02 00:00:00.000000000 +0100
+++ b/Makefile 2020-02-18 20:04:14.068243263 +0100
@@ -39,19 +39,19 @@
@$(PYTHON) setup.py build
test: all
- @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src \
+ @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src:$$PYTHONPATH \
$(PYTHON) -m unittest discover -v
coverage: all
@echo "*** Running unittests with $(COVERAGE) for $(PYTHON) ***"
- @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src \
+ @env PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src:$$PYTHONPATH \
$(COVERAGE) run --branch -m unittest discover -v
$(COVERAGE) report --include="build/lib.*/parted/*" --show-missing
$(COVERAGE) report --include="build/lib.*/parted/*" > coverage-report.log
check: clean
env PYTHON=python3 $(MAKE) ; \
- env PYTHON=python3 PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src \
+ env PYTHON=python3 PYTHONPATH=$$(find $$(pwd) -name "*.so" | head -n 1 | xargs dirname):src/parted:src:$$PYTHONPATH \
tests/pylint/runpylint.py
dist: