Skip to content

Commit

Permalink
Fix run-in-container wrapper script
Browse files Browse the repository at this point in the history
The container image was adapted for local use in 064fdea, which means the default entrypoint is f-e-d-c itself.
However, test suites from CONTRIBUTING.md don't run in the container, since they need to be run from python3 normally. So fix by selectively setting entrypoint to python3 in the run-in-container wrapper script.

Black was removed since it is run by CI and no longer present in the image, and should be easy to install in a Toolbox or elsewhere.
  • Loading branch information
vchernin committed Feb 10, 2022
1 parent dc345e5 commit d4a2c2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ whose only dependency is the `podman` command:
# Run one suite of tests
./run-in-container.sh python3 -m unittest tests.test_appdata

# Apply code formatting
./run-in-container.sh black .

# More information
./run-in-container.sh python3 -m unittest --help
```
8 changes: 8 additions & 0 deletions run-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ GIT_USER_EMAIL=$(git config user.email)

CWD=$(pwd)

PYTHON_ENTRYPOINT=""

if [ "$1" == "python3" ]; then
PYTHON_ENTRYPOINT="--entrypoint=python3"
shift # don't pass first argument since setting entrypoint
fi

podman run --rm --privileged \
-v $HOME:$HOME:rslave \
-v $CWD:$CWD:rslave \
Expand All @@ -14,5 +21,6 @@ podman run --rm --privileged \
-e GIT_COMMITTER_NAME="$GIT_USER_NAME" \
-e GIT_AUTHOR_EMAIL="$GIT_USER_EMAIL" \
-e GIT_COMMITTER_EMAIL="$GIT_USER_EMAIL" \
$PYTHON_ENTRYPOINT \
-it ghcr.io/flathub/flatpak-external-data-checker \
$*

0 comments on commit d4a2c2a

Please sign in to comment.