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

Support portalocker >=2 #94

Closed
dhirschfeld opened this issue Aug 18, 2021 · 3 comments · Fixed by #97
Closed

Support portalocker >=2 #94

dhirschfeld opened this issue Aug 18, 2021 · 3 comments · Fixed by #97
Labels
enhancement New feature or request

Comments

@dhirschfeld
Copy link

The current constraints restrict portalocker to <2:

"portalocker~=1.6;platform_system=='Windows'",
"portalocker~=1.0;platform_system!='Windows'",

IIUC the major version bump was just to remove py2 support so this library should be compatible with portalocker>=1.6

@dhirschfeld
Copy link
Author

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

rayluo commented Aug 20, 2021

Thanks, Dave, for bringing this to our attention.

Hi Rick (@wolph), would you please confirm whether Portalocker 2.x contains breaking change in its API when comparing to 1.x? The 2.0.0 release log mentioned the removal of Python 2 support. We wonder whether our usage of Portalocker 1.x API would continue to work with Portalocker 2.x, when running on Python 3.5+.

@wolph
Copy link

wolph commented Aug 20, 2021

Hi Ray,

The major differences between Portalocker 2.x and 1.x are currently:

  1. Full type hinting support
  2. Related to the type hinting, there is now a LockFlags enum that can be used: https://portalocker.readthedocs.io/en/latest/portalocker.constants.html?highlight=lockflags#portalocker.constants.LockFlags
  3. Support for locks across multiple machines using Redis

For all intents and purposes all Portalocker 1.x code still works on Portalocker 2.x and will continue to do so.

Portalocker 1.x (and Python 2 support) is considered end-of-life but there are no known issues currently. And to maintain both forwards and backwards compatibility I could even backport the LockFlags if desired.

Long story short: yes, you can safely upgrade :)

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
3 participants