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 pkg_resources from osrf_pycommon. #66

Merged
merged 6 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python:
- "3.7"
- "3.8"
install:
- pip install coverage nose flake8 mock
- pip install coverage nose flake8 mock importlib-metadata
- pip install git+https://github.com/PyCQA/flake8-import-order.git
script:
- PYTHONASYNCIODEBUG=1 python setup.py nosetests -s --with-coverage --cover-inclusive
Expand Down
6 changes: 3 additions & 3 deletions osrf_pycommon/cli_utils/verb_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sys
import inspect

import pkg_resources
import importlib_metadata
clalancette marked this conversation as resolved.
Show resolved Hide resolved


def call_prepare_arguments(func, parser, sysargs=None):
Expand Down Expand Up @@ -149,7 +149,7 @@ def list_verbs(group):
:rtype: list of str
"""
verbs = []
for entry_point in pkg_resources.iter_entry_points(group=group):
for entry_point in importlib_metadata.entry_points().get(group, []):
verbs.append(entry_point.name)
return verbs

Expand All @@ -162,7 +162,7 @@ def load_verb_description(verb_name, group):
:returns: verb description
:rtype: dict
"""
for entry_point in pkg_resources.iter_entry_points(group=group):
for entry_point in importlib_metadata.entry_points().get(group, []):
if entry_point.name == verb_name:
return entry_point.load()

Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<license>Apache License 2.0</license>

<exec_depend>python3-importlib-metadata</exec_depend>
wjwwood marked this conversation as resolved.
Show resolved Hide resolved
<exec_depend>python3-mock</exec_depend>

<export>
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import sys

from setuptools import find_packages
from setuptools import setup


install_requires = [
'setuptools',
]
if sys.version_info < (3, 8):
install_requires.append('importlib-metadata')
package_excludes = ['tests*', 'docs*']
packages = find_packages(exclude=package_excludes)

Expand Down
2 changes: 1 addition & 1 deletion stdeb.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[DEFAULT]
Depends3: python3-setuptools
Depends3: python3-setuptools, python3-importlib-metadata
Conflicts3: python-osrf-pycommon
Suite3: xenial yakkety zesty artful bionic cosmic disco eoan focal stretch buster
wjwwood marked this conversation as resolved.
Show resolved Hide resolved
X-Python3-Version: >= 3.5
Expand Down