Anders Kaseorg
e08a24e47f
ruff: Fix UP006 Use `list` instead of `List` for type annotation.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-13 22:28:22 -07:00
Anders Kaseorg
098a514599
python: Use Python 3.8 shlex.join function.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-04-27 12:57:49 -07:00
Anders Kaseorg
97e4e9886c
python: Replace universal_newlines with text.
...
This is supported in Python ≥ 3.7.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-23 22:16:01 -08:00
Anders Kaseorg
646c04eff2
Rename default branch to ‘main’.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-09-06 12:56:35 -07:00
Anders Kaseorg
6e4c3e41dc
python: Normalize quotes with Black.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-12 13:11:19 -08:00
Anders Kaseorg
11741543da
python: Reformat with Black, except quotes.
...
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-12 13:11:19 -08:00
Anders Kaseorg
aaa7b766d8
python: Use universal_newlines to get str from subprocess.
...
We can replace ‘universal_newlines’ with ‘text’ when we bump our
minimum Python version to 3.7.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-10-30 11:36:38 -07:00
Anders Kaseorg
74c17bf94a
python: Convert more percent formatting to Python 3.6 f-strings.
...
Generated by pyupgrade --py36-plus.
Now including %d, %i, %u, and multi-line strings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-14 23:27:22 -07:00
Anders Kaseorg
365fe0b3d5
python: Sort imports with isort.
...
Fixes #2665 .
Regenerated by tabbott with `lint --fix` after a rebase and change in
parameters.
Note from tabbott: In a few cases, this converts technical debt in the
form of unsorted imports into different technical debt in the form of
our largest files having very long, ugly import sequences at the
start. I expect this change will increase pressure for us to split
those files, which isn't a bad thing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-11 16:45:32 -07:00
Anders Kaseorg
67e7a3631d
python: Convert percent formatting to Python 3.6 f-strings.
...
Generated by pyupgrade --py36-plus.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-06-10 15:02:09 -07:00
Anders Kaseorg
5901e7ba7e
python: 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 six fixes for runtime issues:
- def __init__(self, token: Token, parent: Optional[Node]) -> None:
+ def __init__(self, token: Token, parent: "Optional[Node]") -> None:
-def main(options: argparse.Namespace) -> NoReturn:
+def main(options: argparse.Namespace) -> "NoReturn":
-def fetch_request(url: str, callback: Any, **kwargs: Any) -> Generator[Callable[..., Any], Any, None]:
+def fetch_request(url: str, callback: Any, **kwargs: Any) -> "Generator[Callable[..., Any], Any, None]":
-def assert_server_running(server: subprocess.Popen[bytes], log_file: Optional[str]) -> None:
+def assert_server_running(server: "subprocess.Popen[bytes]", log_file: Optional[str]) -> None:
-def server_is_up(server: subprocess.Popen[bytes], log_file: Optional[str]) -> bool:
+def server_is_up(server: "subprocess.Popen[bytes]", log_file: Optional[str]) -> bool:
- method_kwarg_pairs: List[FuncKwargPair],
+ method_kwarg_pairs: "List[FuncKwargPair]",
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:42:48 -07:00
Anders Kaseorg
de5e3d3fbd
tools/review: Don’t pretend to emulate shell=True either.
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-07-30 22:39:08 -07:00
rht
f15bdce90e
tools: Remove print_function.
...
Tweaked by tabbott to exclude the linter libraries.
2017-09-29 15:44:56 -07:00
Steve Howell
c26e000d4e
Fix tools/review for python3.
2017-08-17 17:40:24 -04: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
sinwar
6f0564e9f4
python: Fix remaining bare excepts in codebase.
...
Fixes #2862 .
2017-03-05 16:17:04 -08:00
Tim Abbott
9cc83f87fc
lint: Clean up E241 PEP-8 rule.
2017-01-23 21:21:14 -08:00
Steve Howell
baef662dcb
Add tools/review for reviewing PRs.
...
This script ensures you are starting on master in a pristine
state, and then it creates a branch called review-NNNN for
PR #NNNN in your local repo, along with some basic stats about
the PR.
2017-01-12 15:26:40 -08:00
Tim Abbott
5e0b6b809a
Clean up tools/ by deleting files and moving others to deprecated/
...
(imported from commit 57a8e6c3bd746e83e2d22e941a8321ead1396aef)
2015-09-20 00:18:48 -07:00
Tim Abbott
602077f75b
We're no longer using the review script.
...
(imported from commit 9840ebdfdacee6e3cb32934b81502c70c133e2b0)
2015-09-20 00:10:54 -07:00
Reid Barton
9c310c6cdd
Update review email address
...
(imported from commit 2642b9fb91ab4ca0445063bccc0d46738adb64eb)
2015-08-17 15:24:33 -07:00
Jason Michalski
53b02a694a
Update the review script to use @dropbox.com
...
(imported from commit 30c8c516d0542c1319cb2faf5a9da8e9c8b26041)
2015-01-30 23:39:47 -08:00
Zev Benjamin
fc828ed116
Update review script
...
(imported from commit f8902233a29dcde900218fc7a62735024eb67974)
2015-02-05 22:46:30 -08:00
Luke Faraone
1b5c1ac021
Update style of client strings.
...
(imported from commit 1516461cf53b2715de68e01f16bb8a8cc33c48ad)
2013-12-09 11:47:52 -05:00
Tim Abbott
a616800d8d
review: Rename humbug => zulip in test git repo path.
...
(imported from commit 1551003af066401914dbc055e75769911a335441)
2013-10-31 15:29:49 -04:00
Jessica McKellar
cdc6c50620
Unbreak non-stdout review script invocations.
...
The API directory wasn't making it onto sys.path in time anymore.
(imported from commit d4ed145913e0119d56de435811f793895da175fe)
2013-10-07 15:43:17 -04:00
Steve Howell
84c147a379
Abort the review script when pointed to localhost.
...
(imported from commit 3a7b2123f9667508425dc8e33300a28294b58f2d)
2013-10-06 15:30:00 -04:00
Luke Faraone
6e81fd46af
Update review script to accept non-ASCII branch names
...
(imported from commit 391dd3a549c4a2f4766105b85a6ebc885a293db2)
2013-08-15 10:56:46 -04:00
Tim Abbott
747a9c536f
Rename the 'humbug' API module to 'zulip'.
...
(imported from commit b3a3d7c05459cbb0110cd0fbe2197d779f3a6264)
2013-08-08 10:22:31 -04:00
Tim Abbott
e111a2f9a5
[manual] Rename Django app from zephyr to zerver.
...
This needs to be deployed to both staging and prod at the same
off-peak time (and the schema migration run).
At the time it is deployed, we need to make a few changes directly in
the database:
(1) UPDATE django_content_type set app_label='zerver' where app_label='zephyr';
(2) UPDATE south_migrationhistory set app_name='zerver' where app_name='zephyr';
(imported from commit eb3fd719571740189514ef0b884738cb30df1320)
2013-08-06 07:39:36 -04:00
Scott Feeney
0a3d24826e
Zulipify the review script
...
* CC to code-review@zulip.com
* If domains are omitted, assume @zulip.com
* Don't set email or site explicitly, instead relying on ~/.humbugrc
(imported from commit 9700a0e3d6aac97c8030dcbaba7790018173929a)
2013-07-23 14:53:34 -04:00
Michael McCanna
d284c92ea0
Reworded usage help for tools/review
...
(imported from commit 75595c9fde0ce37ec052c18fbb4b4d35623fe1ce)
2013-07-03 14:16:56 -04:00
Scott Feeney
83cd963c49
Remove unused imports
...
(imported from commit 9e3050c72a2d1137b9096c6cfa1c3945341b9a56)
2013-06-27 16:22:39 -04:00
Steve Howell
2bacaf2213
Fix % formatting style in miscellaneous places.
...
(imported from commit 917196024c981f879355c728da9b4590e964eeef)
2013-06-27 14:41:17 -04:00
Michael McCanna
425a247569
Fix path injection for tools/review
...
(imported from commit 25bac426b71a55f29faa232dcac1d957f2941182)
2013-06-21 11:44:40 -04:00
acrefoot
0972c1e677
[manual] Modify review to allow testing+review in the background
...
Does a test-all using /tmp.
Not safe to run with other tests simultaneously.
You use it just like tools/review, and on a successful test-all
it will submit the code review, without tying up your git working directory.
It depends on new patches to the acrefoot-bulk_create_with_id-1.5.1 branch of
django. Updating this is the [manual] step required. Since test-all doesn't happen
on staging or prod, this is not required for this commit to be deployed, but other
django patches will help with the SSL connection errors we've been seeing.
(imported from commit 3fd3ff00240a2d648c4c54748a8a70616067ef7d)
2013-06-06 17:36:02 -04:00
acrefoot
8447174325
Make testing message appear on its own line in code reviews
...
(imported from commit 5d37c7dc51723d08aac7d12fa71e9d7da0f3f62c)
2013-06-05 15:38:16 -04:00
Keegan McAllister
e4d6a6d3cd
review: Send @username syntax rather than @username@humbughq.com
...
(imported from commit ab7d1120aba829fd629e705409b3677e6cb49dbd)
2013-02-05 15:51:22 -05:00
Tim Abbott
eb4930591d
Send review requests to stream review.
...
(imported from commit 6e2e5ad2a4fadd2693341cb044c3e2152c787952)
2013-02-01 16:48:35 -05:00
Tim Abbott
df5cef6a0d
review: Use a more information Humbug message content.
...
(imported from commit 1c6ecce9920287b07527002421861dfe24817409)
2013-02-01 16:48:35 -05:00
Leo Franchi
54cfea9252
Use /usr/bin/env python in review script
...
(imported from commit a56c09e617ee89858fcac3d60deb549754d465f1)
2013-01-31 11:54:25 -05:00
Tim Abbott
46f956c57e
review: Drop the line about advancing master.
...
(imported from commit 93a4f9b66a83efe69e7ee6638b6edc34b7f52d79)
2013-01-30 15:34:34 -05:00
Tim Abbott
b81aa35c24
review: Fix exception running review on some detached HEADs.
...
(imported from commit 8f6e4a82ade10945cfac0104e4f8ff5d48379348)
2013-01-30 15:34:33 -05:00
Tim Abbott
f701a38287
review: Automatically push personal local branches to the remote.
...
(imported from commit 29cf7d7316eb3666e2f8b39aacf3baa86990bace)
2013-01-30 15:34:33 -05:00
Tim Abbott
7a7fc54234
review: Get the current user's email via a function.
...
(imported from commit 082b035912395c56e89ace1622ef885562d13669)
2013-01-30 15:34:33 -05:00
Keegan McAllister
9125489c20
Rename class HumbugAPI to Client
...
(imported from commit 4270f31fc5febcd9c444d0d133a1dad3860618f0)
2012-12-03 15:54:54 -05:00
Keegan McAllister
bd7b7adb6b
Rename api.common to humbug
...
Fixes #482 .
(imported from commit 1bd6a7fd993d8d5e225e0311c288dbce0c369a40)
2012-12-03 15:54:54 -05:00
Tim Abbott
7314c12527
api: Read the API key from ~/.humbug-api-key by default.
...
(imported from commit 309469a0955969eafd78fbdf89d9651cb530010d)
2012-11-26 12:25:38 -05:00
Tim Abbott
b8f65fb8aa
review: Fix review with new to: sending.
...
(imported from commit 67f588afbc6ec6556d31827c8c9495fbaa59fadf)
2012-11-15 16:27:05 -05:00
Zev Benjamin
796869863c
review: fix for send_message API change
...
(imported from commit 2a171dc298449e2dacc2f8250e81577741122464)
2012-11-13 16:09:43 -05:00