mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
[V3] Add tox (#1641)
* Configure tox environments for install, dev install and docs build * Configure Travis to run tox * Use 3.5.1 since it's our minimum supported version * Bump lower travis build version to 3.5.2 Turns out a dependency is incompatible with 3.5.1. * Modify Travis config to install from pipenv * Try without skipping the lock * Try without pip cache * D the dev install with pipenv * See if adding the pip cache back in breaks * Remove the development installation It doesn't really make any sense considering we already should be installed in develop mode, as does Travis. * Oops, tox should go under dev packages * Do black --check with tox * Uncache pip again... * Try a build matrix, and try ignoring virtualenvs * Activate pipenv shell on travis * Try installing prereleases * Try the build matrix like this * Try exclusion * Upgrade pip * Try this environment marker * Back to stages... * Try run over shell * Try skipping the lock again * This'll be faster but probably ignore 3.5 Because Travis * Just manually list sources for black to check * Magic? * What if I told you... That this worked perfectly on Tobotimus/Red-DiscordBot@test_travis_matrix * It couldn't possibly be this easy * Let's add some comments to be nice * Let's change back to trusty just in case the stages fuck up * Add another comment because why not * Let's try caching pip one more time * We don't need to whitelist these
This commit is contained in:
37
tox.ini
Normal file
37
tox.ini
Normal file
@@ -0,0 +1,37 @@
|
||||
# tox (https://tox.readthedocs.io/) is a tool for running tests
|
||||
# in multiple virtualenvs. This configuration file will run the
|
||||
# test suite on all supported python versions. To use it, "pip install tox"
|
||||
# and then run "tox" from this directory.
|
||||
|
||||
[tox]
|
||||
envlist =
|
||||
py35
|
||||
py36
|
||||
docs
|
||||
dev
|
||||
|
||||
[testenv]
|
||||
description = Run unit tests with pytest
|
||||
extras = voice, test, mongo
|
||||
deps =
|
||||
https://github.com/Rapptz/discord.py/archive/rewrite.zip#egg=discord.py[voice]
|
||||
-rrequirements.txt
|
||||
commands =
|
||||
python -m compileall ./redbot/cogs
|
||||
pytest
|
||||
|
||||
[testenv:docs]
|
||||
description = Attempt to build docs with sphinx-build
|
||||
whitelist_externals = sphinx-build
|
||||
basepython = python3.6
|
||||
extras = voice, docs, mongo
|
||||
commands =
|
||||
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" -W -bhtml
|
||||
sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" -W -blinkcheck
|
||||
|
||||
[testenv:style]
|
||||
description = Stylecheck the code with black to see if anything needs changes.
|
||||
basepython = python3.6
|
||||
extras = style
|
||||
commands =
|
||||
black -l 99 --check generate_strings.py setup.py tests redbot
|
||||
Reference in New Issue
Block a user