Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Don't ignore setup.py even if a setup.cfg file exists #66

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions colcon_ros/package_identification/ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from colcon_core.package_identification import logger
from colcon_core.package_identification \
import PackageIdentificationExtensionPoint
from colcon_core.package_identification.python import get_configuration
from colcon_core.plugin_system import satisfies_version
from colcon_core.plugin_system import SkipExtensionException
from colcon_python_setup_py.package_identification.python_setup_py \
Expand Down Expand Up @@ -104,28 +103,12 @@ def identify(self, desc): # noqa: D102
desc.dependencies['test'].add(DependencyDescriptor(
d.name, metadata=_create_metadata(d)))

# for Python build types ensure that a setup.py file exists
if build_type == 'ament_python':
setup_cfg = desc.path / 'setup.cfg'
for _ in (1, ):
# try to get information from setup.cfg file
if setup_cfg.is_file():
config = get_configuration(setup_cfg)
name = config.get('metadata', {}).get('name')
if name:
options = config.get('options', {})

def getter(env):
nonlocal options
return options
break
else:
# use information from setup.py file

def getter(env): # noqa: F811
nonlocal desc
return get_setup_arguments_with_context(
str(desc.path / 'setup.py'), env)
# use information from setup.py file
def getter(env): # noqa: F811
nonlocal desc
return get_setup_arguments_with_context(
str(desc.path / 'setup.py'), env)

desc.metadata['get_python_setup_options'] = getter

Expand Down