The release-on-comment script is always executed on *master*, so we should
execute the `release.py` script using tox to ensure we create the
right environment.
Also fixed errors in the error handling code.
* enable tox -e docs natively on windows using a wrapper
* rename the towncrier script; run the towncrier command in a safer manner
* use subprocess.call; call exit() around main on towncrier wrapper
* change to sys.exit() instead of builtin exit()
Earlier pytest-bot would only print out the exception in cases of
failure but did not provide context on failing command and error from
command. This patch adds the errors from the command to the exception
message.
`Command` provides abstraction over the command to run and helps
in collecting errors from the first failing command only.
With this, we don't need to check `returncode` from each command that
we run, we can run all the commands and will have access to the error
from the first command that failed. This pattern was taken from Go.
Please refer: https://blog.golang.org/errors-are-values
While it might not help with the following, it certainly might happen as
well.
```
+ curl -S -L --connect-timeout 5 --retry 6 -s https://codecov.io/bash -o codecov-upload.sh
curl: (16) Error in the HTTP2 framing layer
```
Now `tox -e docs` will also include the draft changelog for the
next version (locally only).
`CHANGELOG.rst` now only points to the changelog on READTHEDOCS so
sphinx diretives can be used.
Followup to https://github.com/pytest-dev/pytest/pull/6272
Recently sometimes Azure has failed with:
++ curl -s https://codecov.io/bash
bash: /dev/fd/63: No such file or directory
This attempts to fix this by modifying report-coverage.sh slightly.
I was doing final tests on the script today, and forgot to change
the hardecoded "pytest-dev/pytest", which ended up publishing a
`4.99.10` release to the main repository by mistake, as my token
has access to both my fork and main repository.
I deleted the tag immeditely just a few seconds later, so hopefully
this won't cause major problems.
This change makes it safer to test this in the future, never publishing
to the main repository by mistake (as long as the tags are pushed to the
right repositories of course).
This should increase coverage for subprocesses, where previously
`source` paths were used only from the config file, but not the initial
`--source` argument.
Following the lead from tox, use a simple Python script instead of depending
on ``invoke``.
Other changes:
* Some colors using ``colorama``.
* Run ``pre-commit`` before the final commit to ensure everything is neatly
formatted.
* Drop generating local tag: legacy from the time we used ``devpi`` as staging
area, currently we no longer use it, and we should push a
tag from the last HEAD of the PR always to ensure it is correct.
Because setuptools_scm already includes all version-controlled files
in an sdist, we don't need to maintain a MANIFEST.in file and anymore
See pytest-dev/pytest-xdist#161