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

feat: replace lib imports by importlib #192

Merged
merged 7 commits into from
Aug 8, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ In [3]: with CLIENT.read('models/2.json', encoding='utf-8') as reader:

## Features

* Python (2 and 3) bindings for the [WebHDFS][] (and [HttpFS][]) API,
* Python 3 bindings for the [WebHDFS][] (and [HttpFS][]) API,
supporting both secure and insecure clusters.
* Command line interface to transfer files and start an interactive client
shell, with aliases for convenient namenode URL caching.
Expand Down
2 changes: 1 addition & 1 deletion hdfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import logging as lg


__version__ = '2.7.0'
__version__ = '2.7.1'
__license__ = 'MIT'


Expand Down
7 changes: 6 additions & 1 deletion hdfs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from .client import Client
from .util import HdfsError
from functools import wraps
from imp import load_source
from logging.handlers import TimedRotatingFileHandler
from six.moves.configparser import ParsingError, RawConfigParser
from tempfile import gettempdir
Expand All @@ -21,6 +20,12 @@
import os.path as osp
import sys

try:
# Python 3.12 and above
from importlib import load_source
except ImportError:
# Below Python 3.12
from imp import load_source

_logger = lg.getLogger(__name__)

Expand Down
7 changes: 6 additions & 1 deletion test/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
"""Test that the examples run correctly."""

from hdfs import Config
from imp import load_source
from six import add_metaclass
from test.util import _IntegrationTest
import os
import os.path as osp
import pytest

try:
# Python 3.12 and above
from importlib import load_source
except ImportError:
# Below Python 3.12
from imp import load_source

class _ExamplesType(type):

Expand Down