Skip to content

Commit

Permalink
feat: remove distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
vrenaville committed Nov 28, 2024
1 parent 9ee3405 commit e976a79
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Unreleased

**Bugfixes**

* move from disutils (removed on python 3.12) to setuptools

**Improvements**

* I18N overwrite option
Expand Down
2 changes: 1 addition & 1 deletion marabunta/config.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
21 changes: 21 additions & 0 deletions marabunta/strtobool.py
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"ruamel.yaml>=0.15.1",
"pexpect",
"werkzeug",
"setuptools",
"future",
],
setup_requires=[
Expand Down

0 comments on commit e976a79

Please sign in to comment.