Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated distutils #61

Closed
zerwes opened this issue Nov 28, 2023 · 3 comments
Closed

remove deprecated distutils #61

zerwes opened this issue Nov 28, 2023 · 3 comments
Assignees

Comments

@zerwes
Copy link
Owner

zerwes commented Nov 28, 2023

hiyapyco/__init__.py:25:0: W4901: Deprecated module 'distutils.util' (deprecated-module)

caused by strtobool

https://peps.python.org/pep-0632/#migration-advice

so we can use a own implementation or use:

@zerwes zerwes self-assigned this Nov 28, 2023
@zerwes zerwes changed the title remove deprectaed distutils remove deprecated distutils Nov 28, 2023
@zerwes
Copy link
Owner Author

zerwes commented Dec 16, 2023

minimal own implementation would look like

def strtobool(val):
    val = val.lower()
    if val in ("y", "yes", "t", "true", "on", "1"):
        return 1
    elif val in ("n", "no", "f", "false", "off", "0"):
        return 0
    else:
        raise ValueError("invalid truth value %r" % (val,))

! strtobool returns int, not bool :-?

>>> distutils.util.strtobool('y')
1
>>> type(distutils.util.strtobool('y'))
<class 'int'>

@zerwes
Copy link
Owner Author

zerwes commented May 10, 2024

fixed in PR #70

@zerwes zerwes closed this as completed May 10, 2024
@zerwes
Copy link
Owner Author

zerwes commented May 11, 2024

release 0.5.6 including the fixes from pr #70 has been released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant