1{ lib
2, buildPythonPackage
3, fetchFromGitLab
4, pythonOlder
5, flit-core
6, setuptools-scm
7, tomli
8}:
9
10buildPythonPackage rec {
11 pname = "flit-scm";
12 version = "1.7.0";
13 format = "pyproject";
14
15 src = fetchFromGitLab {
16 owner = "WillDaSilva";
17 repo = "flit_scm";
18 rev = "refs/tags/${version}";
19 hash = "sha256-2nx9kWq/2TzauOW+c67g9a3JZ2dhBM4QzKyK/sqWOPo=";
20 };
21
22 SETUPTOOLS_SCM_PRETEND_VERSION = version;
23
24 nativeBuildInputs = [
25 flit-core
26 setuptools-scm
27 ] ++ lib.optionals (pythonOlder "3.11") [
28 tomli
29 ];
30
31 propagatedBuildInputs = [
32 flit-core
33 setuptools-scm
34 ] ++ lib.optionals (pythonOlder "3.11") [
35 tomli
36 ];
37
38 pythonImportsCheck = [
39 "flit_scm"
40 ];
41
42
43 doCheck = false; # no tests
44
45 meta = with lib; {
46 description = "A PEP 518 build backend that uses setuptools_scm to generate a version file from your version control system, then flit to build the package.";
47 homepage = "https://gitlab.com/WillDaSilva/flit_scm";
48 license = licenses.mit;
49 maintainers = with maintainers; [ cpcloud ];
50 };
51}