Skip to content

Commit af9b1b5

Browse files
committed
Improved implementation - no need for setuptools either
1 parent c8f6243 commit af9b1b5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ authors = ["John Doe <[email protected]>"]
77
[tool.poetry.dependencies]
88
python = ">=3.9,<3.13"
99
nautobot = "2.3.6"
10-
setuptools = ">=75.6.0"
1110

1211
# nautobot-example-plugin = {path = "plugins/plugin_example", develop = true}
1312

tasks.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Development Tasks."""
22

3-
from distutils.util import strtobool
43
from time import sleep
54
import os
65
import toml
@@ -19,7 +18,14 @@ def is_truthy(arg):
1918
"""
2019
if isinstance(arg, bool):
2120
return arg
22-
return bool(strtobool(arg))
21+
22+
val = str(arg).lower()
23+
if val in ("y", "yes", "t", "true", "on", "1"):
24+
return True
25+
elif val in ("n", "no", "f", "false", "off", "0"):
26+
return False
27+
else:
28+
raise ValueError(f"Invalid truthy value: `{arg}`")
2329

2430

2531
# Use pyinvoke configuration for default values, see http://docs.pyinvoke.org/en/stable/concepts/configuration.html

0 commit comments

Comments
 (0)