Skip to content

Commit 9d7636e

Browse files
committed
Set lower bound 1.4 for portalocker dependency, drop packaging as a result
1 parent 4d37293 commit 9d7636e

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

msal_extensions/cache_lock.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import logging
77

88
import portalocker
9-
from packaging.version import Version
109

1110

1211
logger = logging.getLogger(__name__)
@@ -19,9 +18,6 @@ class CrossPlatLock(object):
1918
"""
2019
def __init__(self, lockfile_path):
2120
self._lockpath = lockfile_path
22-
# Support for passing through arguments to the open syscall was added in v1.4.0
23-
open_kwargs = ({'buffering': 0}
24-
if Version(portalocker.__version__) >= Version("1.4.0") else {})
2521
self._lock = portalocker.Lock(
2622
lockfile_path,
2723
mode='wb+',
@@ -30,7 +26,10 @@ def __init__(self, lockfile_path):
3026
# More information here:
3127
# https://docs.python.org/3/library/fcntl.html#fcntl.lockf
3228
flags=portalocker.LOCK_EX | portalocker.LOCK_NB,
33-
**open_kwargs)
29+
# Support for passing through arguments to the open syscall
30+
# was added in Portalocker v1.4.0 (2019-02-11).
31+
buffering=0,
32+
)
3433

3534
def _try_to_create_lock_file(self):
3635
timeout = 5

setup.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,10 @@
2020
python_requires=">=3.7",
2121
install_requires=[
2222
'msal>=0.4.1,<2.0.0',
23-
24-
"portalocker<3,>=1.0;platform_system!='Windows'",
25-
"portalocker<3,>=1.6;platform_system=='Windows'",
23+
'portalocker<3,>=1.4',
2624

2725
## We choose to NOT define a hard dependency on this.
2826
# "pygobject>=3,<4;platform_system=='Linux'",
29-
30-
# Packaging package uses YY.N versioning so we have no upperbound to pin.
31-
# Neither do we need lowerbound because its `Version` API existed since its first release
32-
# https://github.com/pypa/packaging/blame/14.0/packaging/version.py
33-
'packaging',
3427
],
3528
tests_require=['pytest'],
3629
)

0 commit comments

Comments
 (0)