python310Packages.fleep: init at 1.0.1
This commit is contained in:
parent
9ee5692c81
commit
d66e1ac810
@ -0,0 +1,48 @@
|
||||
From 716fcfa3203bc881b543916bdb9a17460951cd26 Mon Sep 17 00:00:00 2001
|
||||
From: "P. R. d. O" <d.ol.rod@protonmail.com>
|
||||
Date: Fri, 26 Nov 2021 07:13:32 -0600
|
||||
Subject: [PATCH] Fixing paths on tests
|
||||
|
||||
---
|
||||
tests/maintest.py | 7 ++++++-
|
||||
tests/speedtest.py | 7 ++++++-
|
||||
2 files changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/maintest.py b/tests/maintest.py
|
||||
index 0e24ca4..3484437 100644
|
||||
--- a/tests/maintest.py
|
||||
+++ b/tests/maintest.py
|
||||
@@ -1,6 +1,11 @@
|
||||
import fleep
|
||||
+import os
|
||||
|
||||
-with open("testfile", "rb") as file:
|
||||
+current_dir = os.path.realpath(os.path.join(os.getcwd(),
|
||||
+ os.path.dirname(__file__)))
|
||||
+
|
||||
+with open(os.path.join(current_dir, "./testfile"),
|
||||
+ "rb") as file:
|
||||
info = fleep.get(file.read(128))
|
||||
|
||||
assert info.type == ["raster-image"]
|
||||
diff --git a/tests/speedtest.py b/tests/speedtest.py
|
||||
index 89338ab..829d563 100644
|
||||
--- a/tests/speedtest.py
|
||||
+++ b/tests/speedtest.py
|
||||
@@ -1,7 +1,12 @@
|
||||
import time
|
||||
import fleep
|
||||
+import os
|
||||
|
||||
-with open("testfile", "rb") as file:
|
||||
+current_dir = os.path.realpath(os.path.join(os.getcwd(),
|
||||
+ os.path.dirname(__file__)))
|
||||
+
|
||||
+with open(os.path.join(current_dir, "./testfile"),
|
||||
+ "rb") as file:
|
||||
stream = file.read(128)
|
||||
|
||||
times = []
|
||||
--
|
||||
2.33.1
|
||||
|
36
pkgs/development/python-modules/fleep/default.nix
Normal file
36
pkgs/development/python-modules/fleep/default.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, python
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "fleep";
|
||||
version = "1.0.1";
|
||||
|
||||
# Pypi version does not have tests
|
||||
src = fetchFromGitHub {
|
||||
owner = "floyernick";
|
||||
repo = "fleep-py";
|
||||
rev = "994bc2c274482d80ab13d89d8f7343eb316d3e44";
|
||||
sha256 = "sha256-TaU7njx98nxkhZawGMFqWj4g+yCtIX9aPWQHoamzfMY=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./0001-Fixing-paths-on-tests.patch
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
${python.interpreter} tests/maintest.py
|
||||
${python.interpreter} tests/speedtest.py
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [ "fleep" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "File format determination library";
|
||||
homepage = "https://github.com/floyernick/fleep-py";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ wolfangaukang ];
|
||||
};
|
||||
}
|
@ -3029,6 +3029,8 @@ in {
|
||||
|
||||
flax = callPackage ../development/python-modules/flax { };
|
||||
|
||||
fleep = callPackage ../development/python-modules/fleep { };
|
||||
|
||||
flexmock = callPackage ../development/python-modules/flexmock { };
|
||||
|
||||
flickrapi = callPackage ../development/python-modules/flickrapi { };
|
||||
|
Loading…
Reference in New Issue
Block a user