Skip to content

Commit

Permalink
Revert "Use functools.lru_cache to cache extension point discovery"
Browse files Browse the repository at this point in the history
This reverts commit 1b85894.
  • Loading branch information
cottsay committed Feb 16, 2024
1 parent 1b85894 commit 5178d46
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
4 changes: 0 additions & 4 deletions colcon_core/extension_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Licensed under the Apache License, Version 2.0

from collections import defaultdict
from functools import lru_cache
import os
import traceback

Expand Down Expand Up @@ -47,7 +46,6 @@ def _get_unique_distributions():
yield dist


@lru_cache()
def get_all_extension_points():
"""
Get all extension points related to `colcon` and any of its extensions.
Expand Down Expand Up @@ -80,7 +78,6 @@ def get_all_extension_points():
return entry_points


@lru_cache()
def get_extension_points(group):
"""
Get the extension points for a specific group.
Expand Down Expand Up @@ -139,7 +136,6 @@ def load_extension_points(group, *, excludes=None):
return extension_types


@lru_cache()
def load_extension_point(name, value, group):
"""
Load the extension point.
Expand Down
3 changes: 0 additions & 3 deletions test/test_extension_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def test_extension_point_blocklist():

# successful loading of entry point not in blocklist
load.reset_mock()
load_extension_point.cache_clear()
with EnvironmentContext(COLCON_EXTENSION_BLOCKLIST=os.pathsep.join([
'group1.extB', 'group2.extC'])
):
Expand All @@ -110,7 +109,6 @@ def test_extension_point_blocklist():

# entry point in a blocked group can't be loaded
load.reset_mock()
load_extension_point.cache_clear()
with EnvironmentContext(COLCON_EXTENSION_BLOCKLIST='group1'):
with pytest.raises(RuntimeError) as e:
load_extension_point('extA', 'eA', 'group1')
Expand All @@ -119,7 +117,6 @@ def test_extension_point_blocklist():
assert load.call_count == 0

# entry point listed in the blocklist can't be loaded
load_extension_point.cache_clear()
with EnvironmentContext(COLCON_EXTENSION_BLOCKLIST=os.pathsep.join([
'group1.extA', 'group1.extB'])
):
Expand Down

0 comments on commit 5178d46

Please sign in to comment.