1{
2 lib,
3 buildPythonPackage,
4 dunamai,
5 fetchFromGitHub,
6 jinja2,
7 poetry-core,
8 poetry,
9 pytestCheckHook,
10 pythonOlder,
11 tomlkit,
12}:
13
14buildPythonPackage rec {
15 pname = "poetry-dynamic-versioning";
16 version = "1.9.1";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "mtkennerly";
23 repo = "poetry-dynamic-versioning";
24 tag = "v${version}";
25 hash = "sha256-SKVx20RrwhCpdDIc2Pu1oFaXWe2d2GnbJGUX7KqMvo0=";
26 };
27
28 nativeBuildInputs = [ poetry-core ];
29
30 propagatedBuildInputs = [
31 dunamai
32 jinja2
33 tomlkit
34 ];
35
36 nativeCheckInputs = [
37 pytestCheckHook
38 poetry
39 ];
40
41 # virtualenv: error: argument dest: the destination . is not write-able at /
42 doCheck = false;
43
44 disabledTests = [
45 # these require .git, but leaveDotGit = true doesn't help
46 "test__get_version__defaults"
47 "test__get_version__format_jinja"
48 # these expect to be able to run the poetry cli which fails in test hook
49 "test_integration"
50 ];
51
52 pythonImportsCheck = [ "poetry_dynamic_versioning" ];
53
54 setupHook = ./setup-hook.sh;
55
56 meta = with lib; {
57 description = "Plugin for Poetry to enable dynamic versioning based on VCS tags";
58 mainProgram = "poetry-dynamic-versioning";
59 homepage = "https://github.com/mtkennerly/poetry-dynamic-versioning";
60 changelog = "https://github.com/mtkennerly/poetry-dynamic-versioning/blob/${src.tag}/CHANGELOG.md";
61 license = licenses.mit;
62 maintainers = with maintainers; [ cpcloud ];
63 };
64}