Commit graph

193 commits

Author SHA1 Message Date
Alena Volkova ea8393511a interactive bots: Create Front bot. 2018-03-08 07:38:35 -05:00
amanagr 5fda59dde0 Susi AI Bot: Create a susi ai bot.
This bot uses SUSI_SERVER API to get response.
2018-02-22 09:36:25 -05:00
Viraat Chandra b7b083f094 interactive bots: Add Trello Interactive Bot. 2018-02-16 09:54:55 -05:00
fredfishgames 3a438cafa9 zulip_bots: Migrate connect_four bot to new game_handler. 2018-01-22 11:30:31 -05:00
Steve Howell 25820c9bb2 provision: Do not even suggest the --force option.
Suggesting to users that they use '--force' during provision
is just asking for trouble.  We will probably want to deprecate
that altogether soon.
2018-01-19 07:50:40 -05:00
Eeshan Garg e528577f11 tools/release-packages: Generate Python3 dist for zulip_bots.
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.
2018-01-08 21:17:28 -03:30
Eeshan Garg 072d43b7c3 tools/release_packages: Stop generating sdists.
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!
2018-01-08 21:17:28 -03:30
Eeshan Garg e20b754498 zulip_bots: Use package_data instead of MANIFEST.in.
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.
2018-01-08 18:28:50 -03:30
neiljp (Neil Pilgrim) 2366b22405 Tools: Update tools/run-mypy to default to strict-optional. 2018-01-08 15:39:03 -05:00
Xavier Cooney 1de704394a interactive bots: Create idonethis bot. 2018-01-08 10:46:52 +01:00
fredfishgames 08bfe9d8c7 interactive bots: Create Salesforce bot. 2018-01-02 14:00:41 -05:00
Steve Howell 41b065eb76 tools: Fix python -> python3 for bots scripts.
This also turns off the custom lint check that was
preventing an explicit version for scripts in "tools".

Fixes #187
2018-01-02 17:38:12 +01:00
Steve Howell 19c3792af5 tools/provision: Exit earlier for python2.
We really want to avoid confusing folks that just want
to work on bots in python3.
2018-01-02 17:38:12 +01:00
Viraat Chandra d62cc1ab58 update run-mypy: Add Baremetrics bot files. 2017-12-31 10:23:43 -05:00
Viraat Chandra a2557ccbe6 interactive bots: Create Mention bot. 2017-12-28 16:33:00 -05:00
Rhea Parekh 0bb50fdc4e slack importer: Shift the slack data conversion files to zulip server repo. 2017-12-27 07:54:42 -05:00
Robert Hönig 1599839956 Make git utility scripts executable. 2017-12-27 10:55:38 +01:00
neiljp (Neil Pilgrim) 134b94e630 requirements: Upgrade to mypy 0.560 & adjust generics flag.
This upgrades to the same mypy as zulip/zulip at this point.
2017-12-21 18:43:42 -05:00
Eeshan Garg 0e8a40b7c0 tools/release-packages: Document the release process.
This commit updates the command usage string to also document
the release process briefly.
2017-12-18 23:07:42 -03:30
Eeshan Garg 4dfa2d6f33 tools/release-packages: Add update-main-repo subcommand.
The ability to update the zulip/requirements/* files in the main
zulip repo has now been made a part of its own subcommand.

To update the requirements to install the packages off of the
0.4.0 tag, run:

./release-packages ZULIP_DIR_PATH 0.4.0

To update the requirements to install the packages off of the
commit hash abcdefg, but the version to be 0.4.0, run:

./release-packages ZULIP_DIR_PATh 0.4.0 --hash abcdefg
2017-12-18 22:47:42 -03:30
Eeshan Garg 3c23dd6c66 tools/release-packages: Remove the ability to push changes.
This commit removes the following:

* This script's dependency on gitpython, it is not maintained actively.
* The ability to push changes in this and the main zulip/ repo. Doing
  so automatically was turning out to be cumbersome and buggy and
  doing it manually doesn't take significantly longer anyway.
* The ability to automatically increment PROVISION_VERSION in
  zulip/version.py. Again, this was too buggy and it doesn't take
  much longer to just increment it by hand.

Removing the above features made the script a lot easier to maintain
and read.
2017-12-18 22:05:54 -03:30
Eeshan Garg 13985510b1 tools/release-packages: Isolate the build and cleanup commands.
This commit fixes a couple of things:

* Removes the command line argument called release_version, now
  one doesn't have to supply a version number when running just
  running --cleanup, for instance.
* Run --cleanup before building the wheels and sdists. This is so
  that outdated distributions are removed before generating new
  ones.
* Set IS_PYPA_PACKAGE back to False at the end of the --build
  process so that we don't accidentally set it to True. This was
  a huge bug in the previous version of the script.
2017-12-18 21:06:01 -03:30
Marco Burstein 878691a745 bots: Create Wit.ai Bot.
Wit.ai Bot communicates with the Wit.ai API. It can be configured with
any Wit.ai token and allows for setting up a custom handler function to
handle Wit.ai responses.
2017-12-18 10:32:05 -05:00
Robert Hönig b306324bfa zulip_bots: Make BotTestCase the only helper library.
Renames StubBotTestCase to BotTestCase and removes
legacy code for supporting both names.
2017-12-14 05:56:55 -05:00
Marco Burstein e9aa94f81c mypy: Add annotations for Link Shortener Bot.
Based on work started by @skunkmb.
2017-12-12 13:57:55 -06:00
Steve Howell c4b42ff599 lint: Prevent __future__ in zulip_bots/zulip_bots/bots.
We should eventually extend this lint rule to all of
zulip_bots.
2017-12-12 07:35:30 -06:00
Steve Howell fd069dff82 lint: Require python3 shebangs.
This commit was originally from @fredfishgames, but it
needed a big rebase due to use letting it sit too long.
Also, we decided not to have shebangs at the top of test
files.
2017-12-12 07:14:16 -06:00
neiljp (Neil Pilgrim) 28687f18ca mypy: Add --disallow-any=generics & extend typing accordingly.
Also reset typing of ExternalBotHandler to Any after discussion.
2017-12-11 20:14:00 -06:00
fredfishgames 424a4bb631 add _ to googletranslate and googlesearch 2017-12-11 13:15:43 -06:00
fredfishgames 657c6d7b9c interactive bots: Create DialogFlow bot. 2017-12-11 13:15:43 -06:00
Rohitt Vashishtha e5e5868414 tests: Add test_helloworld to run-mypy list. 2017-12-11 11:43:44 -06:00
Marco Burstein 3c66894aff incrementor: Clean up type annotation/conversion.
This adds mypy annotations, and we also make the type
conversions in `handle_message` be a little more clear.

(@showell helped clean up this commit a bit)
2017-12-11 10:59:40 -06:00
Marco Burstein 3c794b384b mypy: Add annotations for Yoda Bot. 2017-12-11 07:33:16 -06:00
Marco Burstein 8f64405bae mypy: Add annotations for Wikipedia Bot. 2017-12-11 07:26:43 -06:00
Marco Burstein 0467f83314 mypy: Add annotations for xkcd Bot. 2017-12-11 07:26:43 -06:00
Marco Burstein 700ce6a673 bots: Create Chess Bot.
Chess Bot is a bot that allows you to play chess against either another
user or the computer. Use `start with other user` or
`start as <color> with computer` to start a game.

In order to play against a computer, `chess.conf` must be set with the
key `stockfish_location` set to the location of the Stockfish program on
this computer.

Use `bot_handler.storage` to preserve game state across messages.

(@showell also did minor work here to have the test use verify_dialog()
and have the bot respond to empty messages)
2017-12-10 09:14:32 -06:00
Kai Chen d33e9b9d92 mypy: Add annotations for converter. 2017-12-10 04:59:27 -08:00
Sivagiri Visakan 381401b11b bots: Add mypy to youtube bot 2017-12-09 03:56:33 -08:00
fredfishgames ab9128d939 mypy: Add annotations for weather. 2017-12-08 14:55:35 -08:00
fredfishgames f7f54d159f mypy: Add annotations for virtual_fs. 2017-12-08 14:55:35 -08:00
fredfishgames 5673b49826 Added self: Any linter test 2017-12-08 10:48:42 -08:00
Steve Howell 8c73adb6b6 Make tools/review executable. 2017-12-08 10:47:36 -08:00
fredfishgames 9d5fbc2b5b mypy: Add annotations for help. 2017-12-07 19:12:39 -08:00
fredfishgames 40c09b4b16 mypy: Add annotations for googlesearch. 2017-12-07 19:12:39 -08:00
fredfishgames b7dbe7af41 mypy: Add annotations for github_detail. 2017-12-07 19:12:39 -08:00
Jerry Zhang 77e9be0783 bots/giphy: Use Python 3 type mypy annotations. 2017-12-07 00:22:57 -03:30
Jerry Zhang 95b8ea4751 bots/followup: Use Python 3 type mypy annotations. 2017-12-07 00:22:57 -03:30
Rohitt Vashishtha e5685adf2e tests: Do not generate coverage report on Python 2.
Since we have dropped Python 2 support for the bots and botserver
packages, we now have 'invalid' syntax if we run coverage
for all packages in a Python 2 environment.
2017-12-04 07:27:20 -08:00
Rohitt Vashishtha 69ad29faad tools: Allow force including files for mypy. 2017-12-04 07:27:20 -08:00
Rhea Parekh 1d2d6c9cf7 slack: Fix travis tests. 2017-12-03 10:30:02 -08:00
Steve Howell fc251460fa bot tests: Eliminate BotTestCaseBase.
We now just put `test_bot_usage` in StubBotTestCase and have
BotTestCase inherit from that.
2017-12-01 07:00:20 -08:00
Steve Howell 205f7c16c7 Add StubBotTestCase and StubBotHandler.
We will start to use these for some of our bot test code.
2017-12-01 07:00:20 -08:00
Robert Hönig 4ca11fdd67 Make venv creation with Python 2 harder.
Python 2 venvs can now only be created with
tools/provision --force.
2017-11-30 02:07:55 -08:00
neiljp (Neil Pilgrim) 1e5e931421 Tests: Extend test-lib script to support coverage parameter & add to test-main 2017-11-29 17:07:30 -08:00
Steve Howell efeac92d42 Add tools/test-lib.
This starts to add direct test coverage on
zulip_bots/zulip_bots/lib.py.

It is not yet integrated into tools/test-main.
2017-11-29 13:45:51 -08:00
Robert Hönig 13d181cd09 Remove Python 2.7 testing for zulip_bots and zulip_botserver. 2017-11-28 15:42:22 -08:00
Steve Howell 80e4ef9f72 Create terminal.py to run bots in the terminal.
This program replaces zulip_bot_output.py, which had
gotten a little out of date.

It should be able to simulate a terminal conversation for
all of our bots, including those that use "advanced" features:

    third party config files: tested with giphy
    message updates: tested with incrementor
    storage: tested with virtual_fs and others
2017-11-28 10:52:13 -08:00
derAnfaenger c264f7ef12 provisioning: Enhance warning for Python 2.7.
Color-highlight the warning. Use print instead
of warnings.warn (this omits unnecessary debug info).
2017-11-23 15:20:34 -08:00
derAnfaenger 819d5f6ebe provisioning: Fix real and venv Python version mixup. 2017-11-23 15:20:34 -08:00
Steve Howell 57f7088304 Ignore prior coverage data in tools/test-main.
Before this patch, we were reading in old coverage data every
time we ran test-main and had a .coverage file lying around.
This would cause inaccurate data when you changed code, and it
would cause crashes if you moved your working directory on the
file system.
2017-11-20 12:48:36 -08:00
derAnfaenger 9c37f92a01 zulip_bots: Add common tests.
unittest includes by default all module-level classes that inherit
from TestCase and implement at least one method starting with 'test'.
Since it doesn't provide a convenient way for excluding TestSuites,
we need to manually filter out the unwanted testing of our test base
class itself.
2017-11-14 09:39:00 -08:00
Eeshan Garg 0a70a6b46f test-static-analysis: Fix trailing whitespace errors. 2017-11-10 19:24:59 -03:30
Eeshan Garg 0590671fc6 tools/provision: Support specifying path to Python interpreter. 2017-11-10 17:42:38 -03:30
Steve Howell bad8dccef7 provision: Make instructions to source venv more obvious.
(This cleans up the print formatting a bit in tools/provision
and adds an explicit step in README.md.)
2017-11-10 13:04:59 -08:00
derAnfaenger 80534a50b6 zulip_bots: Add directory for unmaintained bots. 2017-11-02 15:15:47 +01:00
Tim Abbott 075e368818 run-mypy: Document why certain files are not mypy-checked. 2017-10-26 23:02:52 -07:00
Alena Volkova 25d6c68d4d mypy: zulip_botserver: Fix errors in setup.py. 2017-10-27 00:56:16 -04:00
Alena Volkova ed51cabf1b mypy: zulip_botserver: Fix errors in zulip_botserver/server.py. 2017-10-27 00:56:16 -04:00
Alena Volkova 81205ea813 mypy: zulip_botserver: Fix errors in tests/__init__.py. 2017-10-27 00:56:16 -04:00
Alena Volkova fd519252d6 mypy: zulip_bots: Fix errors in zulip_bots/zulip_bot_output.py. 2017-10-27 00:56:16 -04:00
Alena Volkova 5e7f4c595f mypy: zulip_bots: Annotate zulip_bots/test_run.py. 2017-10-27 00:56:16 -04:00
Alena Volkova afb9886553 mypy: zulip_bots: Fix errors in zulip_bots/test_lib.py. 2017-10-27 00:56:16 -04:00
Alena Volkova 6546917088 mypy: zulip_bots: Annotate zulip_bots/run.py. 2017-10-27 00:56:16 -04:00
Alena Volkova 47d8ab8f9a mypy: zulip_bots: Fix errors in zulip_bots/provision.py. 2017-10-27 00:56:15 -04:00
Alena Volkova 3a20dee621 mypy: zulip_bots: Fix errors in zulip_bots/lib.py. 2017-10-27 00:56:15 -04:00
Alena Volkova ad050fc806 mypy: zulip_bots: Fix errors in setup.py. 2017-10-27 00:56:15 -04:00
Alena Volkova 3d282a12a7 mypy: zulip_bots: Fix errors in generate_manifest.py. 2017-10-27 00:56:06 -04:00
Alena Volkova fe6deb2e03 mypy: zulip: Fix errors in tests/test_default_arguments.py. 2017-10-27 00:56:06 -04:00
Alena Volkova 99785a1be4 mypy: zulip: Fix errors in tests/__init__.py. 2017-10-27 00:56:06 -04:00
Alena Volkova 671a078137 mypy: zulip: Fix errors in integrations/zephyr/process_ccache. 2017-10-27 00:56:06 -04:00
Alena Volkova 8becce7c98 mypy: zulip: Annotate integrations/svn/zulip_svn_config.py. 2017-10-27 00:56:06 -04:00
Alena Volkova ab192fe937 mypy: zulip: Annotate integrations/perforce/zulip_perforce_config.py. 2017-10-27 00:56:06 -04:00
Alena Volkova 7ad3324aaa mypy: zulip: Fix errors in integrations/log2zulip/log2zulip. 2017-10-27 00:55:54 -04:00
Alena Volkova 995dc33334 mypy: zulip: Fix errors in integrations/irc/irc_mirror_backend.py. 2017-10-26 17:02:14 -04:00
Alena Volkova af957c18fe mypy: zulip: Annotate integrations/git/zulip_git_config.py. 2017-10-26 17:02:14 -04:00
derAnfaenger 839bbf0db4 tools: Enhance output of run-mypy.
This removes the excessively verbose lists of files
to be tested, and flushes the output after every print
to update the user on the current status in real time.
2017-10-20 08:30:33 -07:00
Eeshan Garg 5235892aef release-packages: Fix glob pattern for twine.upload. 2017-10-09 14:07:19 -02:30
Eeshan Garg 81073f9234 packaging: Automate the package release process.
This commit adds a script to automate the PyPA release of the
zulip, zulip_bots and zulip_botserver packages.

The tools/release-packages script would take care of uploading
the packages to PyPA, and push commits to both repos updating the
package versions. If you have commit access to the repos, you
can --push upstream to master. If not, then you can --push
origin to a new branch on your fork and create a PR for those
changes.

Ideally, a release shouldn't take longer than however long it
takes one to type the above command. If you have SSH set up on
GitHub, you won't need to type in your GitHub username and
password. You can also store your PyPA credentials in a file
in your home directory; it isn't very secure, but it saves
time nevertheless.
2017-10-05 12:01:37 -07:00
Eeshan Garg 07edd4aa9b zulip_bots: Add custom command for generating MANIFEST.in.
We now have a custom command in zulip_bots/setup.py to generate
a MANIFEST.in. To generate a MANIFEST for a PyPA release, we
can now run:

python setup.py gen_manifest --release

To generate a non-release MANIFEST, we can run:

python setup.py gen_manifest

This allows us to automate the MANIFEST generation in our
release automation script.
2017-10-05 12:01:37 -07:00
Alena Volkova c3a213269f provision: Make sure the correct version of pip is installed.
pip 8.0+ is required to successfully run the script (otherwise, the prefix
option doesn't work). pip 9.0+ is installed because of the safety features.
2017-09-29 16:00:01 -07:00
Alena Volkova e1def40edc provision: Remove unnecessary imports. 2017-09-29 15:58:00 -07:00
Alena Volkova 21bc4778b0 provision: Give a clear error message when virtualenv is missing.
Without this tweak, running the script results in a vague "No such file or
directory" error if the virtualenv package is not installed.
2017-09-29 15:57:23 -07:00
derAnfaenger 449d5faa59 mypy: Run mypy for each package separately. 2017-09-27 20:40:08 -07:00
derAnfaenger abe9338cfe mypy: Add erroring files to exclude list. 2017-09-27 11:44:28 +02:00
derAnfaenger 174d11ec36 lister: Make excluding directories work on Windows. 2017-09-27 11:44:20 +02:00
derAnfaenger 9ddb5518f4 tools: Remove duplicate lister.py 2017-09-27 10:49:41 +02:00
derAnfaenger 5ecc26886a travis: Run mypy and linter in a single job. 2017-09-27 10:27:37 +02:00
derAnfaenger 123c49291a provision: Don't fail on mypy install for Python 2. 2017-09-15 13:24:35 +02:00
derAnfaenger 035f0c3268 tools: Add mypy runner.
Unless otherwise specified, `tools/run-mypy` will right now only
check annotations in core files of the `zulip` package.
2017-09-15 13:24:20 +02:00
derAnfaenger 20f01fec85 provision: Put venv activation path in quotes.
This makes the command work with Windows paths with spaces in them.
2017-09-12 16:48:37 +02:00