diff --git a/hy_odoo/__init__.py b/hy_odoo/__init__.py index 1f8d69c..084964e 100644 --- a/hy_odoo/__init__.py +++ b/hy_odoo/__init__.py @@ -16,4 +16,3 @@ # along with this program. If not, see . import hy -from . import odoo, xml_base, utils diff --git a/hy_odoo/macros/__init__.hy b/hy_odoo/macros/__init__.hy deleted file mode 100644 index cd924c2..0000000 --- a/hy_odoo/macros/__init__.hy +++ /dev/null @@ -1,18 +0,0 @@ -;; -*- coding: utf-8 -*- -;; -;; Copyright 2021 Fabien Bourgeois -;; -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU Affero General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU Affero General Public License for more details. -;; -;; You should have received a copy of the GNU Affero General Public License -;; along with this program. If not, see . - -; (require [hy-odoo.macros [general odoo test]]) diff --git a/hy_odoo/macros/general.hy b/hy_odoo/mgeneral.hy similarity index 100% rename from hy_odoo/macros/general.hy rename to hy_odoo/mgeneral.hy diff --git a/hy_odoo/macros/odoo.hy b/hy_odoo/modoo.hy similarity index 100% rename from hy_odoo/macros/odoo.hy rename to hy_odoo/modoo.hy diff --git a/hy_odoo/macros/test.hy b/hy_odoo/mtest.hy similarity index 100% rename from hy_odoo/macros/test.hy rename to hy_odoo/mtest.hy diff --git a/hy_odoo/odoo.hy b/hy_odoo/odoo.hy index 5d3a869..c33a2e7 100644 --- a/hy_odoo/odoo.hy +++ b/hy_odoo/odoo.hy @@ -18,7 +18,7 @@ " Odoo macros and helpers " (import os [path] - hy-odoo.xml_base [xmlroot xmln]) + hy-odoo.xml [xmlroot xmln]) ; Global helpers diff --git a/hy_odoo/tests/test_xml_base.hy b/hy_odoo/tests/test_xml_base.hy index 2c8b08f..07bd422 100644 --- a/hy_odoo/tests/test_xml_base.hy +++ b/hy_odoo/tests/test_xml_base.hy @@ -19,13 +19,13 @@ (require hyrule.control [defmain] - hy-odoo.macros.test *) + hy-odoo.mtest *) (import unittest functools [partial] xml.etree.ElementTree :as ET os [unlink] - hy-odoo.xml-base [XMLDictElement xmln xmlroot xmlchild xml-write]) + hy-odoo.xml [XMLDictElement xmln xmlroot xmlchild xml-write]) (defclass TextXMLBase [(. unittest TestCase)] "XML Helpers tests" diff --git a/hy_odoo/xml_base.hy b/hy_odoo/xml.hy similarity index 97% rename from hy_odoo/xml_base.hy rename to hy_odoo/xml.hy index 629ae92..e8877c9 100644 --- a/hy_odoo/xml_base.hy +++ b/hy_odoo/xml.hy @@ -17,8 +17,8 @@ " XML helpers and macros " -(require hy-odoo.macros.general [instance?] - hy-odoo.macros.odoo [pdb]) +(require hy-odoo.mgeneral [instance?] + hy-odoo.modoo [pdb]) (import collections [namedtuple] functools [partial] os [path] diff --git a/setup.py b/setup.py index 4bdb734..3bdfc53 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,20 @@ from setuptools import setup, find_packages +from setuptools.command.install import install + +class install(install): + """ From hyrule, thanks """ + def run(self): + super().run() + import py_compile + + import hy # for compile hooks + + for path in set(self.get_outputs()): + if path.endswith(".hy"): + py_compile.compile( + path, + invalidation_mode=py_compile.PycInvalidationMode.CHECKED_HASH, + ) setup( name="hy_odoo", @@ -7,6 +23,7 @@ setup( package_data={ 'hy_odoo': ['*.hy'], }, + setup_requires=["hy==0.24.*", "hyrule==0.2.*"], install_requires=["hy==0.24.*", "hyrule==0.2.*"], author="Fabien Bourgeois", author_email="fabien@yaltik.com", @@ -23,5 +40,6 @@ setup( 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', - ] + ], + cmdclass={'install': install} )