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 crypt lib from testing #764

Merged
merged 1 commit into from
May 27, 2024
Merged

Conversation

martinhoyer
Copy link
Contributor

@martinhoyer martinhoyer commented May 7, 2024

crypt module is being deprecated in Python 3.13 (as well as spwd). It is being used for checking host.user().password. Replacing the crypt.crypt() with hashlib or passlib would not be trivial, due to generated salt, format of shadow, etc.

@martinhoyer
Copy link
Contributor Author

as for the CI failure, the new version of Salt requires timelib and that does fails to build. Installing gcc or locking salt version could help?

@martinhoyer
Copy link
Contributor Author

Any chance someone could take look please?

Copy link
Contributor

@philpep philpep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks test is failing. Even with passlib.hosts.linux_context.verify(). Maybe hash algorithm is not handled by passlib ?

@martinhoyer
Copy link
Contributor Author

Looks test is failing. Even with passlib.hosts.linux_context.verify(). Maybe hash algorithm is not handled by passlib ?

Thanks for looking into it. Checking what's wrong.

@martinhoyer
Copy link
Contributor Author

ok, turns out it's not as easy as I thought. crypt.crypt() does not have a replacement in Python and spwd was also deprecated in 3.13. How would you like to proceed?

@philpep
Copy link
Contributor

philpep commented May 27, 2024

ok, turns out it's not as easy as I thought. crypt.crypt() does not have a replacement in Python and spwd was also deprecated in 3.13. How would you like to proceed?

I think we can just assert host.user().password startswith $ and eventually has some expected len(). IIRC this should be constant, whereas encrypted password value might change between docker builds due do some random hash.

@martinhoyer martinhoyer changed the title Replace crypt with passlib in testing Remove crypt lib from testing May 27, 2024
@martinhoyer
Copy link
Contributor Author

I think we can just assert host.user().password startswith $ and eventually has some expected len(). IIRC this should be constant, whereas encrypted password value might change between docker builds due do some random hash.

Thanks, changed.

@philpep philpep merged commit fa48a25 into pytest-dev:main May 27, 2024
7 checks passed
@philpep
Copy link
Contributor

philpep commented May 27, 2024

Merged, thanks!

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.

2 participants