From 8ec053cb1a058abed798804457ce07c12b9f9951 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Tue, 6 Feb 2024 10:58:13 -0600 Subject: [PATCH] Support building colcon extensions with no setup.py This change uses a pip "download" operation to read the name of the package being built so that it can be removed from the constraints.txt prior to downloading dependencies. The package name must be removed from constraints.txt or pip will fail to install the package and its dependencies due to the conflict. Note that pytest-cov still requires a setup.cfg to be present - storing coverage information in pyproject.toml is not yet supported by this action. --- action.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index c7c9d93..c9a49c0 100644 --- a/action.yaml +++ b/action.yaml @@ -14,12 +14,14 @@ runs: else . $VENV/bin/activate fi - python -m pip install -U pip setuptools + python -m pip install -U pip setuptools wheel echo ::endgroup:: echo ::group::Install dependencies # Remove this package from constraints - grep -v "^$(python setup.py --name)@" ${GITHUB_ACTION_PATH}/constraints.txt > constraints.txt + PKG_NAME=$(pip download . --no-deps --pre --no-build-isolation | grep -i 'Successfully downloaded' | awk '{ print $NF }') + echo "Removing ${PKG_NAME} from constraints.txt" + grep -v "^${PKG_NAME}@" ${GITHUB_ACTION_PATH}/constraints.txt > constraints.txt # Install dependencies, including any 'test' extras, as well as pytest-cov python -m pip install -U -e .[test] pytest-cov -c constraints.txt echo ::endgroup::