Commit graph

1729 commits

Author SHA1 Message Date
Tim Abbott 9eda19d6cc zulip_botserver: Get rid of old six.moves for configparser. 2018-05-15 12:23:10 -07:00
neiljp (Neil Pilgrim) 6bbdc7d9d0 requirements: Upgrade to mypy 0.600. 2018-05-15 10:03:57 -07:00
novokrest 65ebd6e595 yoda: Pass API query parameters as params dict in requests.get(). 2018-05-15 09:12:40 -07:00
novokrest 5ad5e11587 link_shortener: Allow #% characters for shortening URL. 2018-05-15 09:12:40 -07:00
novokrest bccbda49f2 wikipedia: Pass API query parameters as params dict in requests.get(). 2018-05-15 09:12:40 -07:00
novokrest 8654ce53db weather: Pass API query parameters as params dict in requests.get(). 2018-05-15 09:12:40 -07:00
novokrest 927fcaa521 susi: Pass API query parameters as params dict in requests.get(). 2018-05-15 09:12:40 -07:00
novokrest 86ffbb2b4a stack_overflow: Pass API query parameters as params dict in requests.get(). 2018-05-15 09:12:40 -07:00
novokrest a38917723a idonethis: Pass API query parameters as params dict in requests methods. 2018-05-15 09:12:40 -07:00
Yago González e9a518e93e api: Warn when SSL/TLS validation is disabled. 2018-05-15 08:17:35 -07:00
Yago González d85792524e api: Allow disabling TLS verification via env vars. 2018-05-15 08:17:35 -07:00
Yago González 285464a367 api: Set required fields in the examples.
Now all the API examples have their corresponding arguments set as
required when they have to be present for the example to run.
2018-05-15 07:40:48 -07:00
Yago González cb171409c5 api: Fix edit-message example.
The message ID necessarily has to be an integer, and if no casting is
made it was being considered a string, causing problems when running
the example.
2018-05-15 07:40:48 -07:00
Guitar1st 2ba6f75fb3 zulip_botserver: Change style of type annotations to python3 2018-05-14 20:00:44 +00:00
Guitar1st 641665c338 zulip_botserver: Remove unused imports and do some other cleanup. 2018-05-14 20:00:44 +00:00
Yago González 292a3bc067 api: Add execution permissions to welcome-message. 2018-05-14 11:04:57 -07:00
Yago González 817636cbc6 api: Implement /users/me/<stream_id>/topics. 2018-05-14 11:04:57 -07:00
Tim Abbott b1ab308c26 botserver: Fix mypy error. 2018-05-14 10:07:02 -07:00
Tim Abbott 7124f9dc14 bot_server: Call the bot server initialization code. 2018-05-14 08:50:52 -07:00
Joshua Pan 33e8352998 requirements: Add 'security' extra_require for requests.
There were some issues running bots due to SSL issues.
Adding the extra_require requests[security] adds 3
additional packages that deal with these issues.
2018-05-14 04:28:53 -07:00
novokrest 5992050d82 run: Add bot handler's parent dir to the python sys path.
Fixes #356
2018-05-09 09:01:17 -07:00
Константин С. Новокрещенов d7d2f6bbd6 lib: Make StateHandler lazy.
Change StateHandler implementation to the following:
- do not fetch state in __init__();
- fetch every key only once on demand and cache it.

Fixes #359
2018-05-08 11:56:26 -07:00
rht e56a94c853 Dig a tunnel to matrix. 2018-05-07 09:07:36 -07:00
Rohitt Vashishtha a4b32a4dc8 tools/deploy: Read $SERVER and $TOKEN environment variables.
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.
2018-05-07 12:31:53 +05:30
novokrest bf9ad09bc2 deploy: Support new JSON-formatted responses from Botfarm. 2018-05-07 10:29:09 +05:30
novokrest e81942421e link_shortener: Print help when no links found. 2018-05-04 05:09:07 +05:30
novokrest 3db070b99e link_shortener: Migrate from goo.gl to bit.ly service.
Shorten URLs by using bit.ly service instead of goo.gl service.

Fixes #367
2018-05-04 05:09:07 +05:30
Novokreshchenov Konstantin dcd4c4a96e deploy: Add tools/deploy ls command.
Displays bot's name, status, email and site. Add `--format` to
pretty-print the list of bots.
2018-05-03 03:34:00 +05:30
Shivamgera 627e9e69d0 docs: Add python3 to ./tools/provision command.
Documentation tweaked by tabbott.
2018-05-02 12:18:27 -07:00
neiljp (Neil Pilgrim) 55d75b11bc packaging: Add py.typed marker file & install in setup.py.
This follows the provisional new PEP 561:
https://www.python.org/dev/peps/pep-0561/.
2018-05-02 12:13:26 -07:00
neiljp (Neil Pilgrim) 7339adc7cf requirements: Upgrade to mypy 0.590. 2018-05-02 12:13:26 -07:00
novokrest 42c474d273 deploy: Add tools/deploy delete command. 2018-05-02 23:27:43 +05:30
Eeshan Garg f4bdb059db pypi: Release version 0.4.6.
This includes a critical bug fix for call_on_each_event.
2018-04-27 01:43:42 -02:30
Tim Abbott d40328a311 api: Fix call_on_each_events handling of empty event_types.
The root issue here is that we had been using `None` as a way of
encoding `event_types` as being an argument to not pass to the server
in the API codebase, but the marshalling to send this over the wire
didn't handle that possibility correctly.

This was incorrectly "fixed" in
409bb587429ec4dcb1220a8ed85ec1618ffde0ed; the root cause of the issue
was the refactor to the new approach for registering API endpoints.
2018-04-25 23:01:37 -07:00
Eeshan Garg 0f448579ab pypi: Release 0.4.5.
We just made a minor change to our Git integration, so that warranted
a new release so I could update the docs on the zulip/zulip repo.
2018-04-23 18:50:56 -02:30
Eeshan Garg 5f20512601 integrations/git: Allow users to specify a stream for notifications.
Previously, all notifications went to "commits", now users can
modify the constant at the top to change that.
2018-04-23 18:38:16 -02:30
Anupam-dagar 345666ca58 tools/deploy: Add command to receive logs for the specified bot. 2018-04-20 04:57:39 +05:30
Eeshan Garg 2d46445ab5 pypi: Release version 0.4.4.
This includes some important changes after the release of pip 10.
2018-04-16 17:05:27 -02:30
Puneeth Chaganti 3c53c36c21 tools: Call pip from a sub-process instead of importing it
The pip documentation recommends calling pip using a subprocess, instead of
importing it and using it's internal API. The API of pip==10.0.0 is different
from that of older versions, and provisioning is broken with this version.

[pip docs]:
https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program

Closes #370
2018-04-16 12:16:23 -07:00
neiljp (Neil Pilgrim) 55aff6f64b mypy: Improve typing of bots & API; enforce no_implicit_optional. 2018-04-06 13:45:11 -04:00
neiljp (Neil Pilgrim) 7dc0703397 tools: Move strict-optional to mypy.ini & remove option from run-mypy. 2018-04-06 13:45:11 -04:00
neiljp (Neil Pilgrim) 6cbe1f5ba7 tools: Migrate core run-mypy options to mypy.ini.
Add traceback option, as used in core Zulip run-mypy.
2018-04-06 13:45:11 -04:00
Ricky dad7eddcc6 beeminder bot: Add beeminder bot. 2018-04-04 14:23:32 -04:00
Eeshan Garg 60e02ed979 pypi: Release version 0.4.3.
Making this release due to recent changes made to the Trello script.
2018-04-03 22:05:39 -02:30
Eeshan Garg fa759fc97c integrations/trello: Improve the Trello script.
This commit makes a bunch of improvements:

1. Use format() for string formatting instead of the old style.
2. Stop returning stuff where we don't have to.
3. URL generation should not be done by the script, especially
   since our eventual goal is for the Zulip server to automatically
   generate a webhook URL. So the user should be able to supply
   the URL in the config file. Plus, this makes it easier to test
   the script with non-Zulip URLs (such as RequestBin).
4. Removed unnecessary arguments.
2018-04-03 21:52:10 -02:30
neiljp (Neil Pilgrim) 0f29e9f71b mypy: Improve type annotations in Zulip API.
- Reduce use of Any, eg. in Callable parameters & narrow List;
- Use Optional where appropriate in more locations.
2018-03-31 15:45:54 -07:00
neiljp (Neil Pilgrim) 83b41a2e9e zulip: Amend default value of remove_subscriptions:principals to None.
Having a default parameter as '[]' may not be an issue with the current
implementation, but general practice is to default to None and assign
a default list subsequently.
2018-03-31 15:45:25 -07:00
Eeshan Garg 7e360c244c pypa: Release version 0.4.2. 2018-03-31 17:19:23 -02:30
amanagr aa5df127ae API: Use session.headers.update method to add user-agent header.
Directly assigning session.headers overrides the default header
paramers and removes `{'Accept-Encoding': 'gzip, deflate'}` from
the headers.
2018-03-30 13:10:04 -07:00
Rohitt Vashishtha e49ecfcd39 mypy: Support files without extensions for scripts in /tools.
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.
2018-03-30 07:54:10 -04:00