Skip to content

Commit 561c0b2

Browse files
authored
Merge pull request #1086 from launchableinc/deprecated-pkg-resources
pkg_resources is deprecated
2 parents 837737a + f6397ab commit 561c0b2

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

launchable/version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pkg_resources import DistributionNotFound, get_distribution
1+
from importlib_metadata import PackageNotFoundError, version
22

33
try:
4-
__version__ = get_distribution("launchable").version
5-
except DistributionNotFound:
4+
__version__ = version("launchable")
5+
except PackageNotFoundError:
66
# package is not installed
77
pass

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ install_requires =
2424
more_itertools>=7.1.0;python_version>='3.6'
2525
python-dateutil
2626
tabulate
27+
importlib-metadata
2728
python_requires = >=3.6
2829
setup_requires =
2930
setuptools-scm

tests/commands/test_api_error.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_record_commit(self):
9898
self.assertEqual(result.exception, None)
9999

100100
server.shutdown()
101-
thread.join()
101+
thread.join(timeout=3)
102102

103103
@responses.activate
104104
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.launchable_token})
@@ -134,7 +134,7 @@ def test_record_build(self):
134134
self.assert_tracking_count(tracking=tracking, count=3)
135135

136136
success_server.shutdown()
137-
thread.join()
137+
thread.join(timeout=3)
138138

139139
# case: exe.jar catches error
140140
error_server = HTTPServer(("", 0), ErrorCommitHandlerMock)
@@ -168,7 +168,7 @@ def test_record_build(self):
168168
self.assert_tracking_count(tracking=tracking, count=3)
169169

170170
error_server.shutdown()
171-
thread.join()
171+
thread.join(timeout=3)
172172

173173
@responses.activate
174174
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.launchable_token})

0 commit comments

Comments
 (0)