Unverified Commit d7b8d5f1 authored by Jairo Llopis's avatar Jairo Llopis
Browse files

python3Packages.whool: init at 1.0.1

@moduon MT-1075
parent 966d2e80
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
{
  buildPythonPackage,
  fetchFromGitHub,
  git,
  hatch-vcs,
  lib,
  manifestoo-core,
  pytestCheckHook,
  pythonOlder,
  tomli,
  wheel,
}:

buildPythonPackage rec {
  pname = "whool";
  version = "1.0.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "sbidoul";
    repo = "whool";
    rev = "refs/tags/v${version}";
    hash = "sha256-skJoMDIgZgRjfp4tsc6TKYVe09XBvg8Fk2BQfqneCYI=";
  };

  build-system = [ hatch-vcs ];

  dependencies = [
    manifestoo-core
    wheel
  ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];

  pythonImportsCheck = [ "whool" ];

  nativeCheckInputs = [
    pytestCheckHook
    git
  ];

  setupHook = ./setup-hook.sh;

  meta = {
    description = "Standards-compliant Python build backend to package Odoo addons";
    homepage = "https://github.com/sbidoul/whool";
    changelog = "https://github.com/sbidoul/whool/blob/${version}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.yajo ];
  };
}
+16 −0
Original line number Diff line number Diff line
# Avoid using git to auto-bump the addon version
# DOCS https://github.com/sbidoul/whool/?tab=readme-ov-file#configuration
whool-post-version-strategy-hook() {
    # DOCS https://stackoverflow.com/a/13864829/1468388
    if [ -z ${WHOOL_POST_VERSION_STRATEGY_OVERRIDE+x} ]; then
        echo Setting WHOOL_POST_VERSION_STRATEGY_OVERRIDE to none
        export WHOOL_POST_VERSION_STRATEGY_OVERRIDE=none
    fi

    # Make sure you can import the built addon
    for manifest in $(find -L . -name __manifest__.py); do
        export pythonImportsCheck="$pythonImportsCheck odoo.addons.$(basename $(dirname $(realpath $manifest)))"
    done
}

preBuildHooks+=(whool-post-version-strategy-hook)
+2 −0
Original line number Diff line number Diff line
@@ -17248,6 +17248,8 @@ self: super: with self; {
  whoisdomain = callPackage ../development/python-modules/whoisdomain { };
  whool = callPackage ../development/python-modules/whool { };
  whoosh = callPackage ../development/python-modules/whoosh { };
  widgetsnbextension = callPackage ../development/python-modules/widgetsnbextension { };