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 use of distutils #120

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, 2.7]
os: [ubuntu-latest, windows-latest, macos-latest]
Expand Down
4 changes: 2 additions & 2 deletions msal_extensions/cache_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import errno
import time
import logging
from distutils.version import LooseVersion

import portalocker
from packaging.version import Version


logger = logging.getLogger(__name__)
Expand All @@ -21,7 +21,7 @@ def __init__(self, lockfile_path):
self._lockpath = lockfile_path
# Support for passing through arguments to the open syscall was added in v1.4.0
open_kwargs = ({'buffering': 0}
if LooseVersion(portalocker.__version__) >= LooseVersion("1.4.0") else {})
if Version(portalocker.__version__) >= Version("1.4.0") else {})
Copy link
Contributor Author

@edgarrmondragon edgarrmondragon Oct 14, 2023

Choose a reason for hiding this comment

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

I don't think LooseVersion is really needed here and Version should be good enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

The LooseVersion() was introduced by @bluca . What do you think with this change, Luca?

Copy link
Contributor

Choose a reason for hiding this comment

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

looks good to me, thanks

self._lock = portalocker.Lock(
lockfile_path,
mode='wb+',
Expand Down
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
"pathlib2;python_version<'3.0'",
## We choose to NOT define a hard dependency on this.
# "pygobject>=3,<4;platform_system=='Linux'",

# Packaging package uses YY.N versioning so we have no upperbound to pin.
# Neither do we need lowerbound because its `Version` API existed since its first release
# https://github.com/pypa/packaging/blame/14.0/packaging/version.py
'packaging',
],
tests_require=['pytest'],
)