The previous style was causing duplicate tests for the dropbox_share bot
for the unittest runner, due to globbing of test_*.py giving duplicates.
However, it also avoids unintentional duplication of bot names to test
on the command line being tested multiple times, though again only with
the unittest runner.
* Add pytest to requirements.txt
* Add pass-through option to run pytest in verbose mode
* Use various default pytest options
* Exclude merels bot for now
Previously the test-bots script filtered out base-class tests from
BotTestCase. With this change, BotTestCase continues to inherit from
unittest.TestCase, but the default test_* methods previously in this
class are now in a new DefaultTests class, which does not. Instead, each
bot needs to inherit from BotTestCase and DefaultTests *explicitly*.
This avoids the need to filter out the base-class tests, which
simplifies the test-bots script, and may ease any migration to eg.
pytest.
The DefaultTests class does require some non-implemented methods which
BotTestCase provides.
A lot of these bot dependencies are pretty hefty and shouldn't be
installed as part of the zulip_bots package. So the installation of
these belongs in tools/provision, not in setup.py.
This simplifies the usage of the script by eliminating the need to
pass --server=$SERVER and --token=$TOKEN in each call to the script.
Also renames key=>token for consistency.
This assumes that files passed in force_include without any extension are meant
to be run with mypy, and thus assumed to be python scripts.
Also, we ignore the most of the tools dir, except for the tools/deploy script
for which #349 adds type annotations.
This script interfaces with a Zulip Botfarm - a flask server that wraps
docker and runs Zulip bots using the docker engine. This allows for
remotely hosting bots for better uptime, and reduces the configuration
steps needed for safely hosting a bot online.
Now that zulip_bots is fully Python3, it makes sense to only
generate a Python3 wheel dist for it. zulip and zulip_botserver
are still distributed as a py2/py3 universal wheel.
Now that we do not use MANIFEST.in for zulip_bots, it doesn't
make sense to distribute sdists, because sdists don't pick up
data files specified in the package_data argument to setup().
Also, it isn't a huge deal if we don't distribute sdists for our
packages. Most PyPI projects only release wheels and pip will also
use wheels if available. So, this made sense!
This commit removes generate_manifest.py and package data files
are now included using the package_data kwarg to setup().
This is because, in certain situations, MANIFEST.in is a bit
finicky. For instance installing a package using:
python setup.py install
doesn't include files specified in MANIFEST.in, while using
pip install ./zulip_bots
does. package_data doesn't pose this problem, ergo it's better
for us.