mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
mbutil: drop nose dependency
This commit is contained in:
parent
f97145f837
commit
d90ab78b6e
@ -1,25 +1,36 @@
|
||||
{ lib, buildPythonApplication, fetchFromGitHub, nose }:
|
||||
{
|
||||
lib,
|
||||
buildPythonApplication,
|
||||
fetchFromGitHub,
|
||||
setuptools,
|
||||
pytestCheckHook,
|
||||
}:
|
||||
|
||||
buildPythonApplication rec {
|
||||
pname = "mbutil";
|
||||
version = "0.3.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mapbox";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "06d62r89h026asaa4ryzb23m86j0cmbvy54kf4zl5f35sgiha45z";
|
||||
repo = "mbutil";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-vxAF49NluEI/cZMUv1dlQBpUh1jfZ6KUVkYAmFAWphk=";
|
||||
};
|
||||
|
||||
nativeCheckInputs = [ nose ];
|
||||
checkPhase = "nosetests";
|
||||
patches = [ ./migrate_to_pytest.patch ];
|
||||
|
||||
meta = with lib; {
|
||||
build-system = [ setuptools ];
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
pytestFlagsArray = [ "test/test.py" ];
|
||||
|
||||
meta = {
|
||||
description = "Importer and exporter for MBTiles";
|
||||
mainProgram = "mb-util";
|
||||
homepage = "https://github.com/mapbox/mbutil";
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ sikmir ];
|
||||
license = lib.licenses.bsd3;
|
||||
platforms = lib.platforms.unix;
|
||||
maintainers = with lib.maintainers; [ sikmir ];
|
||||
};
|
||||
}
|
||||
|
30
pkgs/applications/misc/mbutil/migrate_to_pytest.patch
Normal file
30
pkgs/applications/misc/mbutil/migrate_to_pytest.patch
Normal file
@ -0,0 +1,30 @@
|
||||
diff --git a/test/test.py b/test/test.py
|
||||
index e02e259..1452fda 100644
|
||||
--- a/test/test.py
|
||||
+++ b/test/test.py
|
||||
@@ -1,13 +1,24 @@
|
||||
import os, shutil
|
||||
import sys
|
||||
import json
|
||||
-from nose import with_setup
|
||||
from mbutil import mbtiles_to_disk, disk_to_mbtiles
|
||||
|
||||
def clear_data():
|
||||
try: shutil.rmtree('test/output')
|
||||
except Exception: pass
|
||||
|
||||
+
|
||||
+def with_setup(setup_func, teardown_func):
|
||||
+ def wrapper(func):
|
||||
+ def wrapped(*args, **kwargs):
|
||||
+ setup_func()
|
||||
+ func(*args, **kwargs)
|
||||
+ teardown_func()
|
||||
+
|
||||
+ return wrapped
|
||||
+ return wrapper
|
||||
+
|
||||
+
|
||||
@with_setup(clear_data, clear_data)
|
||||
def test_mbtiles_to_disk():
|
||||
mbtiles_to_disk('test/data/one_tile.mbtiles', 'test/output')
|
Loading…
Reference in New Issue
Block a user