Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / baserow / default.nix
blobbfc905175084c0e45344202f7cc57aa29c7cc859
1 { lib
2 , fetchFromGitLab
3 , makeWrapper
4 , python3
5 , antlr4_9
6 }:
8 let
10   python = python3.override {
11     packageOverrides = self: super: {
12       antlr4-python3-runtime = super.antlr4-python3-runtime.override {
13         antlr4 = antlr4_9;
14       };
16       baserow_premium = self.buildPythonPackage rec {
17         pname = "baserow_premium";
18         version = "1.12.1";
19         format = "setuptools";
21         src = fetchFromGitLab {
22           owner = "bramw";
23           repo = pname;
24           rev = "refs/tags/${version}";
25           hash = "sha256-zT2afl3QNE2dO3JXjsZXqSmm1lv3EorG3mYZLQQMQ2Q=";
26         };
28         sourceRoot = "${src.name}/premium/backend";
30         doCheck = false;
31       };
33       django = super.django_3;
34     };
35   };
38 with python.pkgs; buildPythonApplication rec {
39   pname = "baserow";
40   version = "1.12.1";
41   format = "setuptools";
43   src = fetchFromGitLab {
44     owner = "bramw";
45     repo = pname;
46     rev = "refs/tags/${version}";
47     hash = "sha256-zT2afl3QNE2dO3JXjsZXqSmm1lv3EorG3mYZLQQMQ2Q=";
48   };
50   sourceRoot = "${src.name}/backend";
52   postPatch = ''
53     # use input files to not depend on outdated peer dependencies
54     mv requirements/base.{in,txt}
55     mv requirements/dev.{in,txt}
57     # remove dependency constraints
58     sed -i requirements/base.txt \
59       -e 's/[~<>=].*//' -i requirements/base.txt \
60       -e 's/zope-interface/zope.interface/' \
61       -e 's/\[standard\]//'
62   '';
64   nativeBuildInputs = [
65     makeWrapper
66   ];
68   propagatedBuildInputs = [
69     autobahn
70     advocate
71     antlr4-python3-runtime
72     boto3
73     cached-property
74     celery-redbeat
75     channels
76     channels-redis
77     daphne
78     dj-database-url
79     django-celery-beat
80     django-celery-email
81     django-cors-headers
82     django-health-check
83     django-redis
84     django-storages
85     drf-jwt
86     drf-spectacular
87     faker
88     gunicorn
89     importlib-resources
90     itsdangerous
91     pillow
92     pyparsing
93     psutil
94     psycopg2
95     redis
96     regex
97     requests
98     service-identity
99     setuptools
100     tqdm
101     twisted
102     unicodecsv
103     uvicorn
104     watchgod
105     zipp
106   ] ++ uvicorn.optional-dependencies.standard;
108   postInstall = ''
109     wrapProgram $out/bin/baserow \
110       --prefix PYTHONPATH : "$PYTHONPATH" \
111       --prefix DJANGO_SETTINGS_MODULE : "baserow.config.settings.base"
112   '';
114   nativeCheckInputs = [
115     baserow_premium
116     boto3
117     freezegun
118     httpretty
119     openapi-spec-validator
120     pyinstrument
121     pytestCheckHook
122     pytest-django
123     pytest-unordered
124     responses
125     zope-interface
126   ];
128   fixupPhase = ''
129     cp -r src/baserow/contrib/database/{api,action,trash,formula,file_import} \
130       $out/${python.sitePackages}/baserow/contrib/database/
131     cp -r src/baserow/core/management/backup $out/${python.sitePackages}/baserow/core/management/
132   '';
134   disabledTests = [
135     # Disable linting checks
136     "flake8_plugins"
137   ];
139   disabledTestPaths = [
140     # Disable premium tests
141     "../premium/backend/src/baserow_premium"
142     "../premium/backend/tests/baserow_premium"
143     # Disable database related tests
144     "tests/baserow/contrib/database"
145     "tests/baserow/api"
146     "tests/baserow/core"
147     "tests/baserow/ws"
148   ];
150   DJANGO_SETTINGS_MODULE = "baserow.config.settings.test";
152   meta = with lib; {
153     description = "No-code database and Airtable alternative";
154     homepage = "https://baserow.io";
155     license = licenses.mit;
156     maintainers = with maintainers; [ onny ];
157     mainProgram = "baserow";
158   };