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

Consider removing portalocker dependency #96

Open
chlowell opened this issue Aug 20, 2021 · 3 comments · May be fixed by #117
Open

Consider removing portalocker dependency #96

chlowell opened this issue Aug 20, 2021 · 3 comments · May be fixed by #117
Labels
enhancement New feature or request

Comments

@chlowell
Copy link
Contributor

Primarily because it requires pywin32, which has been a troublesome (transitive) dependency. See for example these Azure SDK issues:

AssertionError upon importing pywin32 in Azure Function: Azure/azure-sdk-for-python#19989
Can't run python after installing pywin32 226: Azure/azure-sdk-for-python#8573
DLL load fails on Python 3.8: Azure/azure-sdk-for-python#8292

@rayluo rayluo added the enhancement New feature or request label Aug 20, 2021
@rayluo
Copy link
Contributor

rayluo commented Aug 20, 2021

Thanks for providing lots of materials here. We will take a look, and possibly re-open the previous research effort on relevant topics here and there.

Currently, the file locking is the reason we use portalocker, because we do not want to get ourselves into the file locking business. We will need some investigation to see what we can do here.

@glaubitz
Copy link

glaubitz commented Nov 22, 2024

Has there been any update on this? Upstream portalocker is now at 3.0.0 which conflicts with the version constraint in setup.py. Since most Linux distributions will always update to the latest upstream version of the packages they maintain, this breaks the msal-extensions package.

@rayluo
Copy link
Contributor

rayluo commented Nov 23, 2024

Has there been any update on this? Upstream portalocker is now at 3.0.0 which conflicts with the version constraint in setup.py. Since most Linux distributions will always update to the latest upstream version of the packages they maintain, this breaks the msal-extensions package.

The PR #117 was a ready-to-test 2 years ago, but it seems there was no strong interest. Now I rebased the PR and further polished it. @glaubitz or everyone interested can briefly test it by:

  1. Start from a clean virtual environment and then pip install https://github.com/AzureAD/microsoft-authentication-extensions-for-python/archive/refs/heads/optional-portalocker.zip. Run pip list to confirm that portalocker is not intalled.

  2. Run this one-liner to further confirm MSAL-Extensions is using the new file-based lock.

    python -c "from msal_extensions import CrossPlatLock as L; print(L)"
    <class 'msal_extensions.filelock.CrossPlatLock'>
    
  3. You can actually use this branch with your MSAL-powered app and see whether it still works normally without portalocker.

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

Successfully merging a pull request may close this issue.

3 participants