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