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

distutils is deprecated. distutils.util.strtobool needs replacement. #278

Open
itzwam opened this issue Oct 16, 2023 · 0 comments · May be fixed by #279
Open

distutils is deprecated. distutils.util.strtobool needs replacement. #278

itzwam opened this issue Oct 16, 2023 · 0 comments · May be fixed by #279

Comments

@itzwam
Copy link

itzwam commented Oct 16, 2023

As seen here: https://github.com/pypa/setuptools/blob/2384d915088b960999ca74fb81ce70bffd17b082/setuptools/dist.py#L23C6-L23C21, setuptools.dist is calling distutils.strtobool


As of Python 3.10, distutils has been deprecated, which results in this DeprecationWarning when using simple_settings:

lib/python3.10/site-packages/simple_settings/special_settings.py:5: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    from distutils.util import strtobool

To eliminate this warning, PEP 632 recomends copying the implementation into your own code, or reimplementing:

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

An alternative is to use str2bool from PyPI:

https://github.com/symonsoft/str2bool

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

Successfully merging a pull request may close this issue.

1 participant