Skip to content

Commit

Permalink
Fix Travis test for build command.
Browse files Browse the repository at this point in the history
The orignal test was using `[ ! -e "dist/*.whl" ]` to try and detect
that a wheel was created (and an analogous command for the tarball), but it
turns out that this would succeed even if the build command completely fails!
The reason is that the shellw as expanding "dist/*.whl" to an empty
list, which the conditional took to mean that it didn't need to check
for the existence of *any* files.

This was replaced by a more robust command that checks that exactly one
of each file was created by the build.
  • Loading branch information
pganssle committed Nov 2, 2019
1 parent 69a237c commit 25f9c5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .travis.yml
Expand Up @@ -41,7 +41,12 @@ install:

script:
- tox
- if [[ $TOXENV == "build" ]]; then [ ! -e "dist/*.whl" ] && [ ! -e "dist/*.tar.gz" ]; fi
- |
if [[ $TOXENV == "build" ]]; then
# Check that exactly one tarball and one wheel are created
[ $(find . -iwholename 'dist/*.tar.gz' | wc -l) -eq 1 ]
[ $(find . -iwholename 'dist/*.whl' | wc -l) -eq 1 ]
fi
after_success:
- if [[ $TOXENV == "py" ]]; then tox -e coverage,codecov; fi

0 comments on commit 25f9c5e

Please sign in to comment.