Skip to content

Commit 2fa3aea

Browse files
committed
Don't ignore setup.py even if a setup.cfg file exists
Even if using a setup.cfg, you need a setup.py to pull in its data, and that setup.py may have additional data in it which we were previously ignoring
1 parent d890e83 commit 2fa3aea

1 file changed

Lines changed: 5 additions & 22 deletions

File tree

  • colcon_ros/package_identification

colcon_ros/package_identification/ros.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from colcon_core.package_identification import logger
1010
from colcon_core.package_identification \
1111
import PackageIdentificationExtensionPoint
12-
from colcon_core.package_identification.python import get_configuration
1312
from colcon_core.plugin_system import satisfies_version
1413
from colcon_core.plugin_system import SkipExtensionException
1514
from colcon_python_setup_py.package_identification.python_setup_py \
@@ -102,28 +101,12 @@ def identify(self, desc): # noqa: D102
102101
desc.dependencies['test'].add(DependencyDescriptor(
103102
d.name, metadata=_create_metadata(d)))
104103

105-
# for Python build types ensure that a setup.py file exists
106104
if build_type == 'ament_python':
107-
setup_cfg = desc.path / 'setup.cfg'
108-
for _ in (1, ):
109-
# try to get information from setup.cfg file
110-
if setup_cfg.is_file():
111-
config = get_configuration(setup_cfg)
112-
name = config.get('metadata', {}).get('name')
113-
if name:
114-
options = config.get('options', {})
115-
116-
def getter(env):
117-
nonlocal options
118-
return options
119-
break
120-
else:
121-
# use information from setup.py file
122-
123-
def getter(env): # noqa: F811
124-
nonlocal desc
125-
return get_setup_arguments_with_context(
126-
str(desc.path / 'setup.py'), env)
105+
# use information from setup.py file
106+
def getter(env): # noqa: F811
107+
nonlocal desc
108+
return get_setup_arguments_with_context(
109+
str(desc.path / 'setup.py'), env)
127110

128111
desc.metadata['get_python_setup_options'] = getter
129112

0 commit comments

Comments
 (0)