Permalink
Browse files

Simplify CI by deleting redundant production of source distribution (#…

…590)

The command `python setup.py sdist` produces the archive meant to be
uploaded to pypi.  The archive is currently being uploaded by any CI
build running on the `master` branch.

Any CI build on the `master` branch currently runs `python setup.py
sdist` twice:
* Once during the `install` phase;
* Then, *after having cleaned the working directory*, by the `deploy`
  phase too.  More details on this further below.

The only effect of the `python setup.py sdist` run during the
`install` phase appears to be that PRs are checked for being able to
produce a source distribution.  This appears not designed on purpose,
as anyway `python setup.py install` shall detect all relevant major
issues.

So `python setup.py sdist` in the `install` phase appears redundant,
therefore delete it.

----

The CI `deploy` phase already runs `python setup.py sdist` - see
[doc](https://docs.travis-ci.com/user/deployment/pypi/#Uploading-different-distributions)
and code
[1](https://github.com/travis-ci/dpl/blob/v1.8.43/lib/dpl/provider/pypi.rb#L101)
[2](https://github.com/travis-ci/dpl/blob/v1.8.43/lib/dpl/provider/pypi.rb#L20).

The CI cleans the working directory before running the `deploy` phase
hence making the early `python setup.py sdist` ineffective.  As the
`skip_cleanup` option is not specified, before executing the `deploy`
phase the CI [runs `git stash
--all`](https://docs.travis-ci.com/user/deployment/#Uploading-Files),
that cleans the working directory [including untracked files and
ignored files](https://www.git-scm.com/docs/git-stash#_options) - as
can be seen by inspecting the Travis CI log of recent builds on master
branch:
> Cleaning up git repository with `git stash --all`. If you need build
  artifacts for deployment, set `deploy.skip_cleanup: true`. See
  https://docs.travis-ci.com/user/deployment/#Uploading-Files.
  • Loading branch information...
lucafavatella authored and kylepjohnson committed Oct 15, 2017
1 parent a3f7885 commit 76ddd9336ab627a63e14a5802c42c80d0d8cc5aa
Showing with 1 addition and 1 deletion.
  1. +1 −1 .travis.yml
View
@@ -6,7 +6,7 @@ python:
- '3.6'
install:
- python setup.py sdist install
- python setup.py install
before_script:
- pip install --upgrade pip

0 comments on commit 76ddd93

Please sign in to comment.