Commit Graph

148 Commits

Author SHA1 Message Date
Greg Price 9ef68d6d42 run-mypy: Add --version to check the version of mypy used. 2017-09-27 12:22:03 -07:00
Greg Price c46755d48d run-mypy: Reorder CLI options for clearer --help. 2017-09-27 12:22:03 -07:00
Greg Price 6697e3620b run-mypy: Give CLI option help a consistent style.
Most CLI tools (including GNU tools and Mercurial) use lowercase
sentence fragments, with no period, for option glosses, so we
follow that style.  Also make the voice and wording consistent,
and the quote type in the Python source.
2017-09-27 12:22:03 -07:00
Greg Price 8c50f7f8a3 run-mypy: Remove extra exclude quirk for nonexistent "stubs" directory.
This exclusion was getting snuck in at the end bypassing --all (and so
giving the lie to the --help documentation).  There is no "stubs"
directory in the tree in any case.
2017-09-27 12:22:03 -07:00
Greg Price be5b26dc68 tools/run-mypy: Cut redundant data from CLI parsing.
argparse has reasonable default behavior for the `dest` argument,
and for `default` at least in these two obvious cases.
So cut those out where we're just doing the default thing.

Also rewrap a couple of calls to fit at least in 100 columns.
2017-09-27 12:22:03 -07:00
Greg Price b8dcac1b42 run-mypy: Stop running `mypy --py2`.
Also unconditionally use the `mypy` from our virtualenv --
that's how we ensure we use a common version across different
Zulip developers and in CI.

And as a side effect of cutting some Python 2 vs. Python 3 logic,
fix a bug where `--all` was having no effect.
2017-08-16 17:54:43 -07:00
Greg Price a099e698e2 py3: Switch almost all shebang lines to use `python3`.
This causes `upgrade-zulip-from-git`, as well as a no-option run of
`tools/build-release-tarball`, to produce a Zulip install running
Python 3, rather than Python 2.  In particular this means that the
virtualenv we create, in which all application code runs, is Python 3.

One shebang line, on `zulip-ec2-configure-interfaces`, explicitly
keeps Python 2, and at least one external ops script, `wal-e`, also
still runs on Python 2.  See discussion on the respective previous
commits that made those explicit.  There may also be some other
third-party scripts we use, outside of this source tree and running
outside our virtualenv, that still run on Python 2.
2017-08-16 17:54:43 -07:00
Tim Abbott 52100e0b3b run-mypy: Remove requirement to be inside a Zulip venv.
It can be nice to just install+run mypy from outside.
2017-08-05 16:49:51 -07:00
Tim Abbott f7cfd76403 run-mypy: Check PROVISION_VERSION.
Since new mypy versions frequently break old versions, this check is a
useful way to help prevent problems where mypy output is wrong.

We could probably tighten this by checking explicitly the expected
mypy version from requirements.txt, but that's work.

Replaces #5026.
2017-08-05 16:18:48 -07:00
Greg Price 5784724d00 api: Update lint and analysis code to forget about now-gone files.
These files don't exist in this repository anymore, so there's
no need to mention them in exclude lists for lint and mypy.
2017-07-31 21:24:52 -07:00
Tim Abbott 27e1891706 mypy: Add flag to warn for unused ignores. 2017-07-27 16:12:26 -07:00
Cynthia Lin 9777496046 repository: Update information with Codecov migration. 2017-06-20 07:17:39 -04:00
Rohitt Vashishtha db9918f3d6 bots: Move contrib_bots to api/bots*.
This will make it convenient to include these bots in Zulip API
releases on pypi.

Fix #5009.
2017-06-01 12:31:54 -07:00
Aditya Bansal feffbb963b pep8: Add compliance with rule E261 run-mypy. 2017-05-31 17:07:15 -07:00
Tim Abbott ce26f0e086 integrations: Remove legacy basecamp integration.
Now that we have the webhook integration, there's no reason to
maintain the pre-webhook version.
2017-05-29 15:10:59 -07:00
Reid Barton ccb4c5c26f bots: Move zephyr-related files to api/integrations/zephyr/. 2017-05-26 15:07:02 -07:00
derAnfaenger 024101be6b bots: Add mypy annotations for bots framework.
This commit adds mypy annotations for both the main
bots and the bots testing runner. It involves a change
to the BotHandlerApi send_message and update_message
funtions, which is compatible with every bot.

Tweaked by tabbott to use more expressive annotations.
2017-05-26 10:25:06 -07:00
Eklavya Sharma 63cc8183ad tools/run-mypy: Add flags. 2017-05-23 12:02:57 -07:00
Eklavya Sharma bda5517b5c mypy: Upgrade to latest version of mypy. 2017-05-23 10:42:44 -07:00
Eeshan Garg b8f71c5d24 Document how to set up an Asana integration via Zapier.
Fixes #3948.
2017-03-21 19:56:47 -07:00
Tim Abbott 879d8cdca0 mypy: Stop using deprecated --silent-imports. 2017-02-10 23:53:44 -08:00
Tim Abbott bb5d81281c mypy: Upgrade to new package name and version 0.571.
Fixes #3448.
2017-02-10 23:53:44 -08:00
Tim Abbott 650469ead6 mypy: Make zerver/lib/ccache.py support python 3. 2017-02-10 23:53:44 -08:00
sinwar eab355b0cd tools: Create more consistent checks for venv.
This helps make the Zulip development environment somewhat more robust
to new contributors, since it will give them a nice warning if they
try running any of our development tools outside the Zulip virtualenv.

Fixes #3468.
2017-02-06 21:50:32 -08:00
Tim Abbott 24df5fbd97 Delete remains of deprecated inject-messages. 2017-01-07 10:53:20 -08:00
AZtheAsian 0dc9ac7dac Delete deprecated iframe-bot. 2017-01-07 10:53:20 -08:00
AZtheAsian e8dafcd905 mypy: Add annotations to api/integrations/asana/zulip_asana_mirror. 2017-01-05 11:08:21 -08:00
ausDensk 059b124027 mypy: Annotate /api/integrations/rss/rss-bot.
With a few tweaks by tabbott.
2017-01-04 22:42:11 -08:00
AZtheAsian c155b9162d mypy: Annotate api/integrations/codebase/zulip_codebase_mirror. 2017-01-03 20:23:06 -08:00
Jackson 98ca518461 mypy: Add annotations to api/integrations/basecamp/zulip_basecamp_mirror 2017-01-03 18:34:26 -08:00
Jackson 566d55b7c6 mypy: Annotate api/integrations/hg/zulip-changegroup.py 2017-01-03 11:44:43 -08:00
anirudhjain75 5f4a822655 mypy: Annotate zerver/tests/test_decorators.py. 2017-01-02 08:59:49 -08:00
Sampriti Panda 246ac7cadc mypy: Annotate api/integrations/twitter/twitter-search-bot 2017-01-02 08:01:37 -08:00
Jackson 88da3dea7e mypy: Annotate api/integrations/trac/zulip_trac.py 2016-12-30 20:05:14 -08:00
Tommy Ip 29c291b981 mypy: Annotate *api/integrations/perforce/zulip_change-commit.py*. 2016-12-30 15:19:34 -08:00
lonerz 3c1c65eaf8 mypy: Annotate api/integrations/twitter/twitter-bot 2016-12-30 11:40:45 -08:00
Tommy Ip 7f187418d4 mypy: Annotate *api/integrations/nagios/nagios-notify-zulip*. 2016-12-28 15:44:47 -08:00
Tommy Ip 3d015eb259 mypy: Annotate *api/integrations/svn/post-commit*. 2016-12-28 08:54:53 -08:00
Tim Abbott 45324e08c1 bots: Fix jabber_mirror_backend annotations.
mypy was super confused because the name "zulip" was both an import
and a global variable in the file.
2016-12-27 21:39:32 -08:00
Steve Howell 680ff3f80c Remove mypy exemption for api/zulip/__init__.py.
This required instead exempting these files:

    bots/jabber_mirror_backend.py
    tools/deprecated/iframe-bot/show-last-messages

Turning on mypy for the API exposes issues in the annotations
of other files.
2016-12-21 11:22:42 -08:00
Zac Pullar-Strecker 4eb6adf547 mypy: Annotate zerver/tests/test_narrow.py 2016-12-09 05:48:22 -08:00
anirudhjain75 4bb6735e77 Annotate zephyr_mirror_backend.py.
With some tweaks by tabbott to update tuple->Tuple and update comments.
2016-12-07 15:57:55 -08:00
Tudor Nazarie 5b22959f1c Annotate bots/jabber_mirror_backend.py 2016-12-06 09:52:08 -08:00
Joy Chen 77938f6247 mypy: Annotate *bots/githook-post-receive* 2016-12-03 15:58:22 -06:00
Jason Le 144d82305d mypy: Annotate puppet/zulip_ops. 2016-12-03 11:00:25 -08:00
Heidi Dong ba7d4e7452 mypy: Annotate bots/gcal-bot. 2016-11-29 20:49:11 -08:00
Tommy Ip 844e32ccc5 tools: Remove deprecated generate-activity-metrics.py.
The script uses hardcoded hostnames that do not exist anymore,
its functionality is available through directly querying the Zulip
database.
2016-11-29 09:27:59 -08:00
Tim Abbott 36e336edc3 puppet: Rename zulip_internal to zulip_ops.
The old "zulip_internal" name was from back when Zulip, Inc. had two
distributions of Zulip, the enterprise distribution in puppet/zulip/
and the "internal" SAAS distribution in puppet/zulip_internal.  I
think the name is a bit confusing in the new fully open-source Zulip
work, so we're replacing it with "zulip_ops".  I don't think the new
name is perfect, but it's better.

In the following commits, we'll delete a bunch of pieces of Zulip,
Inc.'s infrastructure that don't exist anymore and thus are no longer
useful (e.g. the old Trac configuration), with the goal of cleaning
the repository of as much unnecessary content as possible.
2016-10-16 19:23:27 -07:00
Tim Abbott 217212b773 run-mypy: Use the experimental new mypy cache.
This makes iteratively running mypy approximately 5x faster.

Fixes #1981.
2016-10-15 22:57:11 -07:00
Tim Abbott 9e503f2dcf run-mypy: Check scripts by default.
Previously, we checked scripts in a separate run to work around mypy
not supporting multiple scripts with the same name.  Since we have
fixed that issue, we can restore the original behavior.

We leave the --scripts-only option available, though I'm not sure it's
particularly useful and we'll probably eventually remove it.
2016-10-15 22:53:29 -07:00