Skip to content

Python 3.12+ compatible, get rid of distutils in py #239

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

Merged
merged 1 commit into from
Jul 14, 2025

Conversation

maximvelichko
Copy link
Collaborator

@maximvelichko maximvelichko commented Jun 2, 2025

Remove distutils from Python code, so it can be used with Python 3.12+.
(Not converted distutils.sysconfig.get_python_lib to e.g. sysconfig.get_path)

Presently pyamcrest does not work with Home Assistant for recent months, as they now require Python 3.12+

@maximvelichko
Copy link
Collaborator Author

Hi @tchellomello , may I get a review, please?

@maximvelichko maximvelichko merged commit 5d44bcc into tchellomello:master Jul 14, 2025
3 checks passed
@maximvelichko maximvelichko deleted the py3.12+ branch July 14, 2025 04:35
@mweinelt
Copy link

This broke test_str2bool, because it expects ValueError for strings that are not trutyh/falsy.

___________________________ TestUtils.test_str2bool ____________________________

self = <tests.test_utils.TestUtils testMethod=test_str2bool>

    def test_str2bool(self):
        """Test return code from utils.str2bool."""
        self.assertTrue(str2bool('y'))
        self.assertTrue(str2bool('Y'))
        self.assertTrue(str2bool('yes'))
        self.assertTrue(str2bool(1))
        self.assertFalse(str2bool('n'))
        self.assertFalse(str2bool('N'))
        self.assertFalse(str2bool('no'))
        self.assertFalse(str2bool(0))
        self.assertTrue(str2bool(u'Y'))
>       self.assertRaises(ValueError, str2bool, 'amcrest')
E       AssertionError: ValueError not raised by str2bool

tests/test_utils.py:31: AssertionError

@maximvelichko
Copy link
Collaborator Author

test_str2bool

let me take a look, I did not realize the test does not run

@maximvelichko
Copy link
Collaborator Author

@mweinelt , #240

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 this pull request may close these issues.

3 participants