1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, poetry-core
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "timeslot";
11 version = "0.1.2";
12
13 # pypi distribution doesn't include tests, so build from source instead
14 src = fetchFromGitHub {
15 owner = "ErikBjare";
16 repo = pname;
17 rev = "af35445e96cbb2f3fb671a75aac6aa93e4e7e7a6";
18 sha256 = "sha256-GEhg2iMsYMfalT7L9TCd1KHU6oa/wTl5m3mRC0zOH9Q=";
19 };
20
21 format = "pyproject";
22
23 disabled = pythonOlder "3.6";
24
25 nativeBuildInputs = [
26 poetry-core
27 ];
28
29 nativeCheckInputs = [
30 pytestCheckHook
31 ];
32
33 pytestFlagsArray = [
34 # The pyproject.toml specifies the flag `--cov=timeslot`,
35 # This causes an error when running without pytest-cov,
36 # so use this flag to override that option, as we don't need coverage.
37 "--override-ini addopts=''"
38 ];
39
40 pythonImportsCheck = [ "timeslot" ];
41
42 meta = with lib; {
43 description = "Data type for representing time slots with a start and end";
44 homepage = "https://github.com/ErikBjare/timeslot";
45 maintainers = with maintainers; [ huantian ];
46 license = licenses.mit;
47 };
48}