Skip to content

Commit

Permalink
[ARROW-208] Replaced deprecated pkg_resource with packaging.version (m…
Browse files Browse the repository at this point in the history
…ongodb-labs#188)

* Replaced deprecated pkg_resource with packaging.version
  • Loading branch information
caseyclements authored Jan 29, 2024
1 parent 754ca75 commit 4613e7a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bindings/python/pymongoarrow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@

# We must import pyarrow before attempting to load the Cython module.
import pyarrow as pa # noqa: F401
from packaging.version import parse as _parse_version

from pymongoarrow.version import _MIN_LIBBSON_VERSION, __version__ # noqa: F401

try:
from packaging.version import parse as _parse_version
except ImportError:
from distutils.version import LooseVersion as _LooseVersion

def _parse_version(version):
return _LooseVersion(version)


try:
from pymongoarrow.lib import libbson_version
except ImportError:
Expand Down
4 changes: 4 additions & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ filterwarnings = [
"error",
# https://github.com/dateutil/dateutil/issues/1314
"module:datetime.datetime.utc:DeprecationWarning",
# https://jira.mongodb.org/browse/ARROW-204
'ignore:Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.',
# https://jira.mongodb.org/browse/ARROW-206
'ignore:DatetimeTZBlock is deprecated and will be removed in a future version. Use public APIs instead.'
]

[tool.ruff]
Expand Down

0 comments on commit 4613e7a

Please sign in to comment.