From 7b915cd63269bd68a53710b61216eaa5ae0fde38 Mon Sep 17 00:00:00 2001 From: Pierre Verkest Date: Sat, 19 Oct 2024 16:13:56 +0200 Subject: [PATCH] modernize mock/odoo using pyproject and fix odoo.tests import --- tests/mock/odoo/odoo/__init__.py | 1 + tests/mock/odoo/pyproject.toml | 13 +++++++++++++ tests/mock/odoo/setup.py | 12 ------------ 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 tests/mock/odoo/pyproject.toml delete mode 100644 tests/mock/odoo/setup.py diff --git a/tests/mock/odoo/odoo/__init__.py b/tests/mock/odoo/odoo/__init__.py index f912ef4..ee74ad2 100644 --- a/tests/mock/odoo/odoo/__init__.py +++ b/tests/mock/odoo/odoo/__init__.py @@ -1,3 +1,4 @@ +from . import tests from mock import MagicMock registry = MagicMock() tools = MagicMock() diff --git a/tests/mock/odoo/pyproject.toml b/tests/mock/odoo/pyproject.toml new file mode 100644 index 0000000..f08fa8e --- /dev/null +++ b/tests/mock/odoo/pyproject.toml @@ -0,0 +1,13 @@ +[build-system] +requires = ["hatchling", "hatch-odoo"] +build-backend = "hatchling.build" + +[project] +name = "odoo" +version = "0.1.0" +description = "Fake odoo used in unitest to avoid testing against real odoo" +dependencies = [ +] + +[tool.hatch.build] +packages = ["odoo"] \ No newline at end of file diff --git a/tests/mock/odoo/setup.py b/tests/mock/odoo/setup.py deleted file mode 100644 index fbdd278..0000000 --- a/tests/mock/odoo/setup.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from setuptools import find_packages, setup - -setup( - name="odoo", - version="0.0.1", - packages=find_packages(), - package_dir={"odoo": "odoo"}, - install_requires="mock" -)