Skip to content

Commit

Permalink
npm audit fix & replace deprecated pkg_resources & get ready for 0.7.…
Browse files Browse the repository at this point in the history
…0-a2 (#146)

closes: #111

After this, ready to release a new version to PyPI

* run npm audit fix to update (some of) the packages with vulnerabilities
* use importlib.metadata instead of the deprecated pkg_resources on python >= 3.8
  • Loading branch information
fohrloop authored Oct 9, 2024
1 parent 7563645 commit a81e9ae
Show file tree
Hide file tree
Showing 3 changed files with 5,766 additions and 3,276 deletions.
21 changes: 14 additions & 7 deletions dash_uploader/utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import logging
from typing import final
from packaging import version
import pkg_resources
import sys
import time

## Dash version
dash_version_str = pkg_resources.get_distribution("dash").version
dash_version = version.parse(dash_version_str)
from packaging.version import parse as parse_version

if sys.version_info < (3, 8):
import pkg_resources

DASH_VERSION_STR = pkg_resources.get_distribution("dash").version
else:
from importlib.metadata import version as get_version

DASH_VERSION_STR = get_version("dash")

DASH_VERSION = parse_version(DASH_VERSION_STR)


def dash_version_is_at_least(req_version="1.12"):
Expand All @@ -17,7 +24,7 @@ def dash_version_is_at_least(req_version="1.12"):
the argument "req_version".
This is a private method, and should not be exposed to users.
"""
return dash_version >= version.parse(req_version)
return DASH_VERSION >= parse_version(req_version)


def retry(wait_time, max_time):
Expand Down
Loading

0 comments on commit a81e9ae

Please sign in to comment.