Skip to content

Commit

Permalink
add importlib_resources & importlib_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-muir committed May 22, 2024
1 parent d5d03f9 commit 2632df0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 2 additions & 0 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ cryptography>=1.5
boto3>=1.1.1
click>=6.6
PyYAML>=3.10
importlib_resources>=5.12
importlib_metadata>=7.1.0
4 changes: 2 additions & 2 deletions credsmash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import importlib_resources

import pkg_resources
__version__ = pkg_resources.resource_string(__name__, 'VERSION')
__version__ = importlib_resources.files(__name__).joinpath('VERSION').read_bytes().decode('utf-8').strip()
9 changes: 4 additions & 5 deletions credsmash/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
import logging
import operator
import os
import sys

import boto3
import click
import pkg_resources
import importlib_metadata
import six

import credsmash.api
Expand Down Expand Up @@ -42,8 +41,8 @@ def session(self):

@staticmethod
def load_entry_point(group, name):
entry_points = pkg_resources.iter_entry_points(
group, name
entry_points = importlib_metadata.entry_points(
group=group, name=name
)
for entry_point in entry_points:
return entry_point.load()
Expand Down Expand Up @@ -396,7 +395,7 @@ def cmd_put_many(ctx, source, fmt, compare=True):


# Load any extra CLI's
for ep in pkg_resources.iter_entry_points('credsmash.cli'):
for ep in importlib_metadata.entry_points(group='credsmash.cli'):
try:
ep.load()
except ImportError:
Expand Down
15 changes: 9 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ def find_version(*file_paths):
'credsmash': ['VERSION']
},

python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*",
python_requires=">=3.8",
install_requires=[
'cryptography',
'boto3',
'click',
'six'
'six',
'importlib_resources',
'importlib_metadata'
],
tests_require=[
'pytest',
Expand Down Expand Up @@ -74,10 +76,11 @@ def find_version(*file_paths):
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
)

0 comments on commit 2632df0

Please sign in to comment.