Skip to content

Consider removing portalocker dependency #96

Closed

Description

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

Activity

  1. added
    enhancement
    on Aug 20, 2021
  2. rayluo commented on Aug 20, 2021

    @rayluo
    Contributor

    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.

  3. linked a pull request that will close this issueMake portalocker optional #117on Sep 17, 2023
  4. glaubitz commented on Nov 22, 2024

    @glaubitz

    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.

  5. rayluo commented on Nov 23, 2024

    @rayluo
    Contributor

    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. John Paul Adrian Glaubitz (@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions