diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f35e0a4..ab850cf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 diff --git a/HISTORY.rst b/HISTORY.rst index 7d004c1..3094ed8 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -12,6 +12,8 @@ Unreleased **Bugfixes** +* move from disutils (removed on python 3.12) to setuptools + **Improvements** * I18N overwrite option diff --git a/marabunta/config.py b/marabunta/config.py index 99dfb41..e0994f3 100644 --- a/marabunta/config.py +++ b/marabunta/config.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright 2016-2017 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) -from distutils.util import strtobool +from .strtobool import strtobool import argparse import os diff --git a/marabunta/strtobool.py b/marabunta/strtobool.py new file mode 100644 index 0000000..1a7ad55 --- /dev/null +++ b/marabunta/strtobool.py @@ -0,0 +1,21 @@ +_MAP = { + "y": True, + "yes": True, + "t": True, + "true": True, + "on": True, + "1": True, + "n": False, + "no": False, + "f": False, + "false": False, + "off": False, + "0": False, +} + + +def strtobool(value): + try: + return _MAP[str(value).lower()] + except KeyError as error: + raise ValueError(f'"{value}" is not a valid bool value') from error