Skip to content

Commit

Permalink
Support building colcon extensions with no setup.py (#14)
Browse files Browse the repository at this point in the history
This change separates the installation of the package being tested from
the installation of its dependencies. After initial installation, the
package's name is found using `pip list` and excluded from the org-level
constraints file that's used to ensure that HEAD is used for each of
those repositories.

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 authored Feb 7, 2024
1 parent 474c0a0 commit 214e307
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ runs:
python -m pip install -U pip setuptools
echo ::endgroup::
echo ::group::Install package
python -m pip install -U -e .[test] --no-deps
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 list --local --editable --format json | jq '.[0].name' -r)
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 214e307

Please sign in to comment.