Commit graph

655 commits

Author SHA1 Message Date
Anders Kaseorg
272c63bfd3 ruff: Fix B009 Do not call getattr with a constant attribute value.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
ad9c085614 ruff: Fix PIE808 Unnecessary start argument in range.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
8b5b3958e1 ruff: Fix SIM201 Use … != … instead of not … == ….
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
93156d994a ruff: Fix SIM118 Use key in dict instead of key in dict.keys().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
6a37290cec ruff: Fix SIM114 Combine if branches using logical or operator.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
b009dcd7d3 ruff: Fix SIM108 Use ternary operator instead of if-else-block.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
6a4ad8861b ruff: Fix SIM103 Return the condition directly.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
58a3026f37 ruff: Fix SIM102 Use a single if statement instead of nested if statements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 18:17:39 -07:00
Anders Kaseorg
13e860ee10 ruff: Fix C417 Unnecessary map usage (rewrite using a generator expression).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 17:36:51 -07:00
Anders Kaseorg
353c2de050 ruff: Fix EXE002 The file is executable but no shebang is present.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 16:54:40 -07:00
Anders Kaseorg
ca3e5a2746 ruff: Fix EXE001 Shebang is present but file is not executable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-29 16:54:40 -07:00
Anders Kaseorg
235f92afb0 ruff: Fix TRY401 Redundant exception object included in logging.exception call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-28 16:29:20 -07:00
Anders Kaseorg
6b2861c3ec ruff: Fix G004 Logging statement uses f-string.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-28 16:18:11 -07:00
Anders Kaseorg
d85ace8e7e ruff: Fix G003 Logging statement uses +.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-28 16:17:21 -07:00
Anders Kaseorg
88ab78ee25 ruff: Fix RSE102 Unnecessary parentheses on raised exception.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-28 16:17:21 -07:00
Anders Kaseorg
63246e4369 ruff: Fix RUF010 Use explicit conversion flag.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 22:41:04 -07:00
Anders Kaseorg
52a7b0b6a3 ruff: Fix ISC003 Explicitly concatenated string should be implicitly concatenated.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 22:14:10 -07:00
Anders Kaseorg
c471f26d45 ruff: Fix ISC001 Implicitly concatenated string literals on one line.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 22:14:10 -07:00
Anders Kaseorg
2f581293d9 ruff: Fix FLY002 Consider f-string instead of string join.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 22:09:17 -07:00
Anders Kaseorg
fcd4fe330d ruff: Fix UP031 Use format specifiers instead of percent format.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 22:04:41 -07:00
Anders Kaseorg
ddccf0eda3 ruff: Fix UP032 Use f-string instead of format call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 22:01:58 -07:00
Anders Kaseorg
a49add3d02 lint: Replace Black with Ruff.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 19:08:40 -07:00
Anders Kaseorg
01a27a3a1b lint: Replace Flake8 with Ruff.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 18:58:49 -07:00
Anders Kaseorg
5c299c7eff google_search: Add missing type annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 17:47:53 -07:00
Anders Kaseorg
602ebb18fe connect_four: Add missing type annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-27 17:40:41 -07:00
Anders Kaseorg
6cb1d5f775 mypy: Enable explicit-override error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-26 14:03:17 -07:00
Anders Kaseorg
43654b9cf2 mypy: Enable ignore-without-code error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-26 13:43:42 -07:00
Anders Kaseorg
95b33b83b5 mypy: Enable redundant-expr error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-26 13:41:24 -07:00
Anders Kaseorg
e747d3b712 mypy: Enable no_implicit_reexport.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-26 13:38:57 -07:00
Anders Kaseorg
3b4867ad46 simple_lib: Add type annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 16:59:41 -07:00
Anders Kaseorg
f55d5ea555 Mark Python 3.11 supported.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 16:00:47 -07:00
Anders Kaseorg
183bb933b4 test_run: Patch importlib.import_module last.
importlib.import_module is now used in the implementation of
unittest.mock.patch.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 15:58:50 -07:00
Anders Kaseorg
98e23bdfd4 Remove Python 3.7 support.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 13:23:37 -07:00
Anders Kaseorg
a9607dfdf9 Convert type comments to Python ≥ 3.6 variable annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-18 01:04:47 -07:00
Anders Kaseorg
8abca34a05 youtube: Fix for HTTPError stub change.
https://github.com/python/typeshed/pull/10875

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-17 19:03:47 -07:00
Zixuan James Li
1b8f1d6e51 lint: Pin black to avoid inconsistent formatting.
This also runs black to reformat the affected files, which had been
causing failures because of upstream updates.

Ideally, we need a more sophisticated toolchain for managing the
versions of the dependencies instead of just requirements.txt. This
should be due in a possible future cleanup.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-05-29 10:53:22 -07:00
Anders Kaseorg
c94da617ed Remove Python 3.6; add Python 3.10.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-01-24 12:04:59 -08:00
Anders Kaseorg
d26416a1e7 Release version 0.8.2.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-03-15 17:44:12 -07:00
Anders Kaseorg
05d591a906 Remove legacy distutils support.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-28 10:35:58 -08:00
Anders Kaseorg
113f9cb885 converter: Reformat with Black 22.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-09 18:51:30 -08:00
Eeshan Garg
74d716289b tools: Delete the release-packages script.
This script has been outdated for a long time now and has been
obsoleted by some recent changes in how packages should be built
and distributed. In general, the release process is now too
complicated to automate, so we are better off just making the
release manually.
2022-01-05 08:11:58 +05:30
neiljp (Neil Pilgrim)
e0f3bd4143 bots: Migrate source file for zulip-bot-shell to similar name. 2021-11-21 21:06:40 -08:00
neiljp (Neil Pilgrim)
cca1b7d679 mypy: Add types to terminal.py. 2021-11-21 21:06:40 -08:00
neiljp (Neil Pilgrim)
4982adcb17 bots: Migrate script name from zulip-terminal to zulip-bot-shell.
This change is intended to reduce confusion between zulip-bot-shell
(test bots interactively without a server) and the zulip/zulip-terminal
project and its associated command (zulip-term).
2021-11-19 11:48:37 -08:00
Eeshan Garg
76b8aacf5c zulip_bots: Remove include_package_data=True argument from setup().
According to the `setuptools` docs, once `include_package_data=True`
is passed to `setup()`, it will only include package data specified
in `MANIFEST.in`, and will ignore the `package_data` argument passed
to `setup()`. Thus, the `py.typed` file was not included in our
latest PyPI release 0.8.1.

A quick way to fix this is to remove the `include_package_data=True`
argument and to let our explicit `package_data` argument values
govern what data is included in the release.

See https://github.com/pypa/setuptools/issues/1461 for background.
2021-10-27 11:15:01 -07:00
Eeshan Garg
fec8cc50c4 pypi: Release version 0.8.1. 2021-10-19 18:03:52 -04:00
Anders Kaseorg
d32d442c44 Upgrade mypy to 0.910.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 20:19:05 -07:00
Anders Kaseorg
189cf48573 chessbot: Upgrade python-chess to chess.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 19:01:58 -07:00
Anders Kaseorg
1e6513136a tests: Set encoding for mock HTTP responses.
Fixes warnings like ‘UserWarning: Trying to detect encoding from a
tiny portion of (2) byte(s).’

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 18:03:52 -07:00
Anders Kaseorg
e8bb65b188 tests: Replace deprecated assertRaisesRegexp with assertRaisesRegex.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-08-24 17:20:53 -07:00