# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1716291634 -7200
#      Tue May 21 13:40:34 2024 +0200
# Branch 16.0
# Node ID 5e2e34c1605d1c3815d9407236b82d70b85047b2
# Parent  2e7ef16d62994fd11b349e55ad24746ede576bbb
Update to build with hatchling

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -1,4 +1,3 @@
-=========
 Changelog
 =========
 
diff --git a/doc/autotodo.py b/doc/autotodo.py
--- a/doc/autotodo.py
+++ b/doc/autotodo.py
@@ -2,7 +2,7 @@
 ##############################################################################
 #
 #    OpenERP, Open Source Management Solution
-#    Copyright © 2014, 2018, 2022 XCG Consulting
+#    Copyright © 2014, 2018, 2022, 2023 XCG Consulting
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU Affero General Public License as
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -165,7 +165,6 @@
 sphinxodooautodoc_root_path = os.path.dirname(
     os.path.dirname(os.path.abspath(odoo.__file__))
 )
-# TODO devrait ne rien contenir si tout est bien installé comme voulu.tp
 # sphinxodooautodoc_addons_path : List of paths were Odoo addons to load are located
 c = None
 # find setup file of superproject, if any
@@ -177,7 +176,7 @@
         c.read(setup_path)
         if c.has_section("odoo_scripts"):
             # reload with odoo_scripts
-            c = Configuration(os.path.dirname(setup_path))
+            c = Configuration(directory)
         else:
             c = None
     if not c:
diff --git a/models/__init__.py b/models/__init__.py
--- a/models/__init__.py
+++ b/models/__init__.py
@@ -1,4 +1,4 @@
-from . import (  # noqa: F401
+from . import (
     account_chart_template,
     account_fiscal_year,
     account_move,
diff --git a/pyproject.toml b/pyproject.toml
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -9,6 +9,8 @@
 classifiers = [
   "Programming Language :: Python",
   "Programming Language :: Python :: 3",
+  "Programming Language :: Python :: 3.10",
+  "Programming Language :: Python :: 3.11",
   "Framework :: Odoo",
   "Framework :: Odoo :: 16.0",
   "License :: OSI Approved :: GNU Affero General Public License v3"
@@ -22,7 +24,7 @@
 ]
 
 [project.optional-dependencies]
-doc = ["sphinx", "sphinx-odoo-autodoc"]
+doc = ["sphinx", "sphinx-odoo-autodoc", "odoo-scripts"]
 test = []
 
 [project.urls]
@@ -30,19 +32,43 @@
 changelog = "https://orus.io/xcg/odoo-modules/account_period/-/blob/branch/16.0/NEWS.rst"
 
 [build-system]
-requires = ["setuptools >=64.0.0", "wheel", "setuptools_scm[toml] >=6.2"]
-build-backend = "setuptools.build_meta"
+requires = ["hatchling >=1.19", "hatch-vcs"]
+build-backend = "hatchling.build"
+
+[tool.hatch.build]
+exclude = [
+  "/doc/",
+  "/.editorconfig",
+  "/.eslintrc.yml",
+  "/.flake8",
+  "/.gitlab-ci.yml",
+  "/.hgignore",
+  "/.hgtags",
+  "/.prettierrc.yml",
+  "/.yamllint.yaml"
+]
 
-[tool.setuptools]
-package-dir = { "odoo.addons.account_period" = "." }
+[tool.hatch.build.targets.wheel]
+include = [
+  "*.csv",
+  "/i18n/",
+  "/static/",
+  "README.rst",
+  "*.xml",
+  "*.py",
+  "*.svg",
+  "*.png"
+]
 
-[tool.setuptools.package-data]
-"*" = ["*"]
+[tool.hatch.build.targets.wheel.sources]
+"" = "odoo/addons/account_period"
 
-[tool.setuptools_scm]
+[tool.hatch.version]
+source = "vcs"
 
 [tool.black]
-target = 3.10
+target-version = ["py310", "py311"]
+required-version = "22"
 
 [tool.isort]
 py_version = 310
diff --git a/wizards/__init__.py b/wizards/__init__.py
--- a/wizards/__init__.py
+++ b/wizards/__init__.py
@@ -1,1 +1,1 @@
-from . import account_period_close  # noqa: F401
+from . import account_period_close