Skip to content

Commit

Permalink
Support building colcon extensions with no setup.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cottsay committed Feb 6, 2024
1 parent 641cfdf commit 8ec053c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down

0 comments on commit 8ec053c

Please sign in to comment.