Skip to content

Commit

Permalink
Merge branch 'master' into cottsay/symlink-data
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Feb 3, 2024
2 parents 367200d + ad0feb4 commit f15b533
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 130 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy: ${{steps.load.outputs.strategy}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: colcon/ci
- id: load
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{matrix.python}}
Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{matrix.python}}
Expand Down
2 changes: 1 addition & 1 deletion colcon_core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2020 Dirk Thomas
# Licensed under the Apache License, Version 2.0

__version__ = '0.15.0'
__version__ = '0.15.2'
2 changes: 1 addition & 1 deletion colcon_core/executor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def add_executor_arguments(parser):
group.add_argument(
'--executor', type=str, choices=keys, default=default,
help=f'The executor to process all packages (default: {default})'
f'{descriptions}')
f'{descriptions}') # noqa: E131

for priority in extensions.keys():
extensions_same_prio = extensions[priority]
Expand Down
24 changes: 16 additions & 8 deletions colcon_core/extension_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
EXTENSION_POINT_GROUP_NAME = 'colcon_core.extension_point'


def _get_unique_distributions():
seen = set()
for dist in distributions():
dist_name = dist.metadata['Name']
if dist_name not in seen:
seen.add(dist_name)
yield dist


def get_all_extension_points():
"""
Get all extension points related to `colcon` and any of its extensions.
Expand All @@ -51,12 +60,7 @@ def get_all_extension_points():
colcon_extension_points.setdefault(EXTENSION_POINT_GROUP_NAME, None)

entry_points = defaultdict(dict)
seen = set()
for dist in distributions():
dist_name = dist.metadata['Name']
if dist_name in seen:
continue
seen.add(dist_name)
for dist in _get_unique_distributions():
for entry_point in dist.entry_points:
# skip groups which are not registered as extension points
if entry_point.group not in colcon_extension_points:
Expand All @@ -70,7 +74,7 @@ def get_all_extension_points():
f"from '{dist._path}' "
f"overwriting '{previous}'")
entry_points[entry_point.group][entry_point.name] = \
(entry_point.value, dist_name, dist.version)
(entry_point.value, dist.metadata['Name'], dist.version)
return entry_points


Expand All @@ -87,7 +91,11 @@ def get_extension_points(group):
# Python 3.10 and newer
query = entry_points(group=group)
except TypeError:
query = entry_points().get(group, ())
query = (
entry_point
for dist in _get_unique_distributions()
for entry_point in dist.entry_points
if entry_point.group == group)
for entry_point in query:
if entry_point.name in extension_points:
previous_entry_point = extension_points[entry_point.name]
Expand Down
3 changes: 3 additions & 0 deletions colcon_core/task/python/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ async def test(self, *, additional_hooks=None): # noqa: D102

logger.log(1, f"test.step() by extension '{key}'")
try:
if 'PYTHONDONTWRITEBYTECODE' not in env:
env = dict(env)
env['PYTHONDONTWRITEBYTECODE'] = '1'
return await extension.step(self.context, env, setup_py_data)
except Exception as e: # noqa: F841
# catch exceptions raised in python testing step extension
Expand Down
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ python_requires = >=3.6
install_requires =
coloredlogs; sys_platform == 'win32'
distlib
EmPy
EmPy<4
importlib-metadata; python_version < "3.8"
packaging
# the pytest dependency and its extensions are provided for convenience
Expand All @@ -44,7 +44,7 @@ zip_safe = false

[options.extras_require]
test =
flake8>=3.6.0,<6
flake8>=3.6.0,<7
flake8-blind-except
flake8-builtins
flake8-class-newline
Expand All @@ -68,8 +68,9 @@ exclude =
filterwarnings =
error
# Suppress deprecation warnings in other packages
ignore:Deprecated call to `pkg_resources.declare_namespace\('paste'\)`::
ignore:lib2to3 package is deprecated::scspell
ignore:pkg_resources is deprecated as an API::colcon_core.entry_point
ignore:pkg_resources is deprecated as an API::
ignore:SelectableGroups dict interface is deprecated::flake8
ignore:The loop argument is deprecated::asyncio
ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated::pydocstyle
Expand Down
2 changes: 1 addition & 1 deletion stdeb.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[colcon-core]
No-Python2:
Depends3: python3-distlib, python3-empy, python3-packaging, python3-pytest, python3-setuptools, python3 (>= 3.8) | python3-importlib-metadata
Depends3: python3-distlib, python3-empy (<4), python3-packaging, python3-pytest, python3-setuptools, python3 (>= 3.8) | python3-importlib-metadata
Recommends3: python3-pytest-cov
Suggests3: python3-pytest-repeat, python3-pytest-rerunfailures
Suite: focal jammy bullseye bookworm
Expand Down
3 changes: 3 additions & 0 deletions test/spell_check.words
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ hookimpl
hookwrapper
https
importlib
importorskip
isatty
iterdir
junit
Expand All @@ -56,6 +57,7 @@ lineno
linter
linux
lstrip
minversion
mkdtemp
monkeypatch
namedtuple
Expand All @@ -79,6 +81,7 @@ purelib
pydocstyle
pytest
pytests
pythondontwritebytecode
pythonpath
pythonscriptspath
pythonwarnings
Expand Down
Loading

0 comments on commit f15b533

Please sign in to comment.