Commit graph

20 commits

Author SHA1 Message Date
Anders Kaseorg 34f5c4ef02 git: Fix git_repository_name.
Without universal_newlines=True or text=True, subprocess.check_output
returns bytes, not str, so it makes no sense to compare its return to
"true".  But upstream Git’s behavior only depends on the filename, not
whether the repository is bare; emulate this more closely.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 21:01:05 -07:00
Anders Kaseorg 53e59c8c09 Rename default branch to ‘main’
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 12:50:52 -07:00
PIG208 9ce7c52a10 pyupgrade: Reformat with --py36-plus.
This includes mainly fixes of string literals using f-strings or
.format(...), as well as unpacking of list comprehensions.
2021-06-02 18:45:57 -07:00
PIG208 e27ac0ddbe pyupgrade: Replace Text with str.
We uses `pyupgrade --py3-plus` to automatically replace all occurence
of `Text`. But manual fix is required to remove the unused imports. Note
that with this configuration pyupgrade also convert string literals to
.format(...) style, which is manually not included in the commit as well.
2021-06-02 18:45:57 -07:00
PIG208 6f3f9bf7e4 black: Reformat without skipping string normalization. 2021-06-02 18:45:57 -07:00
PIG208 fba21bb00d black: Reformat skipping string normalization. 2021-06-02 18:45:57 -07:00
PIG208 5580c68ae5 isort: Reformat using isort. 2021-06-02 18:45:57 -07:00
Anders Kaseorg 717a549f4b mypy: Prohibit unreachable code.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-04 15:17:09 -08:00
Anders Kaseorg 17cf26aa1f cleanup: Move line breaks before binary operators.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg 5428c5f296 typing: Convert function type annotations to Python 3 style.
Generated by com2ann (slightly patched to avoid also converting
assignment type annotations, which require Python 3.6), followed by
some manual whitespace adjustment, and two fixes for use-before-define
issues:

-    def set_zulip_client(self, zulipToJabberClient: ZulipToJabberBot) -> None:
+    def set_zulip_client(self, zulipToJabberClient: 'ZulipToJabberBot') -> None:

-def init_from_options(options: Any, client: Optional[str] = None) -> Client:
+def init_from_options(options: Any, client: Optional[str] = None) -> 'Client':

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Anders Kaseorg e30b3b094b Modernize legacy Python 2 syntax with pyupgrade.
Generated by `pyupgrade --py3-plus --keep-percent-format` followed by
manual indentation fixes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 15:04:36 -07:00
rht 1412403037 integrations: Remove from __future__ imports. 2020-04-02 13:02:28 -04:00
rht a465467388 integrations: Switch to python3. 2020-04-02 13:02:28 -04:00
neiljp (Neil Pilgrim) 436b619021 integrations: Use universal_newlines in check_output to output as str.
Picked up by mypy; otherwise output is in bytes (at least on python 3).
2020-03-24 21:25:45 -07:00
rht 8a74f576a3 python: Remove per-file copyright notices.
These notices are redundant and obscure what are often very short
example scripts.
2020-03-23 12:52:52 -07:00
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
neiljp (Neil Pilgrim) 33ccc04a32 mypy: Amend code & typing of integrations, to pass with strict-optional. 2018-01-02 14:05:33 -05:00
Alena Volkova af957c18fe mypy: zulip: Annotate integrations/git/zulip_git_config.py. 2017-10-26 17:02:14 -04:00
derAnfaenger 50d8c5f7fe zulip package: Add requirements.txt for each integration. 2017-09-12 01:39:21 -07:00
Eeshan Garg 3d0f7955b6 api: Move the API package to a dedicated subdirectory.
In order to keep all three packages (zulip, zulip_bots,
zulip_botserver) in the same repo, all package files must now
be nested one level deeper.

For instance, python-zulip-api/zulip_bots/zulip_bots/bots/, instead
of python-zulip-api/zulip_bots/bots/.
2017-07-18 02:20:32 -02:30