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
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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking about the ways this could fail:

  • For this to work, pip list must be omitting setuptools and pip (installed above)
  • The python setup action could also start installing stuff that gets listed although I suppose the --local filters those out.

Copy link
Member Author

@cottsay cottsay Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the combination of --local and --editable that really narrows it down. Only stuff in the venv should show up due to --local, and there's only one thing we're installing with --editable and that's our target.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(note that we created a fresh venv on line 11)

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