Skip to content
Merged
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
10 changes: 6 additions & 4 deletions colcon_python_setup_py/package_identification/python_setup_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import sys
from threading import Lock
import traceback
from typing import Mapping
import warnings

from colcon_core.package_identification \
Expand Down Expand Up @@ -239,12 +240,12 @@ def get_setup_arguments_with_context(setup_py, env):
_process_pool = multiprocessing.Pool()


def get_setup_information(setup_py, *, env):
def get_setup_information(setup_py: Path, *, env: Mapping[str, str]):
"""
Dry run the setup.py file and get the configuration information.

:param Path setup_py: path to a setup.py script
:param dict env: environment variables to set before running setup.py
:param setup_py: path to a setup.py script
:param env: environment variables to set before running setup.py
:return: dictionary of data describing the package.
:raise: RuntimeError if the setup script encountered an error
"""
Expand All @@ -253,7 +254,8 @@ def get_setup_information(setup_py, *, env):
run_setup_py,
kwds={
'cwd': os.path.abspath(str(setup_py.parent)),
'env': env,
# might be os.environ, which is not picklable
'env': dict(env),
'script_args': ('--dry-run',),
'stop_after': 'config'
}
Expand Down