python312Packages.fnllm: 0.0.11 -> 0.0.12 (#364582)
[NixPkgs.git] / pkgs / development / python-modules / setuptools-odoo / default.nix
blob9f59ac71afce689ed5d0a9ce16214de69541fbb0
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   git,
6   pytestCheckHook,
7   pythonOlder,
8   distutils,
9   setuptools-scm,
10   writeScript,
13 buildPythonPackage rec {
14   pname = "setuptools-odoo";
15   version = "3.3";
16   format = "setuptools";
18   disabled = pythonOlder "3.7";
20   src = fetchFromGitHub {
21     owner = "acsone";
22     repo = pname;
23     rev = "refs/tags/${version}";
24     hash = "sha256-38YlkDH/PuJ1yvQ43OYmdnRd1SGJULv6fC/+fitLDJ8=";
25   };
27   nativeBuildInputs = [ distutils ];
29   propagatedBuildInputs = [ setuptools-scm ];
31   # HACK https://github.com/NixOS/nixpkgs/pull/229460
32   patchPhase = ''
33     runHook prePatch
35     old_manifest="$(cat MANIFEST.in 2>/dev/null || true)"
36     echo 'global-include **' > MANIFEST.in
37     echo "$old_manifest" >> MANIFEST.in
39     runHook postPatch
40   '';
42   pythonImportsCheck = [ "setuptools_odoo" ];
44   setupHook = writeScript "setupHook.sh" ''
45     setuptoolsOdooHook() {
46       # Don't look for a version suffix from git when building addons
47       export SETUPTOOLS_ODOO_POST_VERSION_STRATEGY_OVERRIDE=none
49       # Let setuptools-odoo know which files to install, when Git is missing
50       # HACK https://github.com/acsone/setuptools-odoo/issues/20#issuecomment-340192355
51       echo 'recursive-include odoo/addons/* **' >> MANIFEST.in
53       # Make sure you can import the built addon
54       for manifest in $(find -L . -name __manifest__.py); do
55         export pythonImportsCheck="$pythonImportsCheck odoo.addons.$(basename $(dirname $manifest))"
56       done
57     }
59     preBuildHooks+=(setuptoolsOdooHook)
60   '';
62   nativeCheckInputs = [
63     pytestCheckHook
64     git
65   ];
67   disabledTests = [
68     "test_addon1_uncommitted_change"
69     "test_addon1"
70     "test_addon2_uncommitted_version_change"
71     "test_odoo_addon1_sdist"
72     "test_odoo_addon1"
73     "test_odoo_addon5_wheel"
74   ];
76   meta = with lib; {
77     description = "Setuptools plugin for Odoo addons";
78     homepage = "https://github.com/acsone/setuptools-odoo";
79     changelog = "https://github.com/acsone/setuptools-odoo/blob/${version}/CHANGES.rst";
80     license = licenses.lgpl3Only;
81     maintainers = with maintainers; [ yajo ];
82   };